Windows 10

The most useful PowerShell cmdlet I didn’t know existed

Sometimes I should probably pay more attention.  I use PowerShell a lot.  I use Windows 10 a lot.  But I still missed this one:

image
image
image

Some highlights:

  • 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

6 replies »

  1. Nice! Needed this “one stop shop” for some image logging I was scripting, perfect timing!

    This is like when someone told me the computer name was in the default Windows File Explorer window in Windows 7 – my reaction was “when did they put that in there?!” and if course it was always there under my nose. By the way this was something I missed in 8, 8.1 and all the 10 builds.

    Like

Leave a Reply to Michael Niehaus Cancel reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s