Sometimes I should probably pay more attention. I use PowerShell a lot. I use Windows 10 a lot. But I still missed this one:
- Want to know if the device is joined to AD? Check CsPartOfDomain. Want to know what domain? Look at CsDomain (which will be WORKGROUP on an AAD-joined device).
- Need to know if the device is UEFI or not? Check to see if the BiosFirmwareType is Uefi.
- Want to know how long Windows has been running since the last reboot? Check OsUptime or OsLastBootUpTime.
- How about the Windows SKU? OsOperatingSystemSKU will tell you that.
- Need to get a list of languages that are installed? OsMuiLanguages has that list.
Overall, it’s kind of like MSINFO32 but in PowerShell, and then some. Sure, you can find all of this stuff elsewhere (multiple cmdlets, WMI, registry locations, etc.) but remembering one cmdlet is much easier.
Categories: Windows 10