The Windows systeminfo command displays a lot of information! Use findstr to filter its output:
systeminfo | findstr /B /C:"OS Name" `
/C:"OS Version" `
/C:"System Type"
This can be used to semi-reliably determine if a machine is part of a domain.
systeminfo | findstr Domain
(Non-AD joined machines will almost always use WORKGROUP for the Domain
, while AD-joined machines will often use a fully qualified DNS domain here.)