Trust me, this is not a new thing, rather I get the question every time on a session (before or after) or when working on a customer site, how can I extract the Make and Model from the machine? So, as long as people are asking me, I think I should answer, right? :-)
Make and Model is commonly used in deployment solutions to figure out what drivers that needs to download to each machine during install. It is a part of the SMBBios information and can be accessed using WMI, in WMIC it is called Name and Vendor and in PowerShell it is called Manufacturer and Model. Now, lets take a look.
The Old WMI Method:
Execute wmic csproduct get name,vendor from a CMD prompt.
The New POSH Method:
Execute Get-WmiObject Win32_ComputerSystem | Select Model,Manufacturer from a PowerShell prompt.
Categories: Deployment, Drivers, MDT, PowerShell, SCCM, WMI
I am trying to understand why is it better? I need to type more and i need to remember a wmi class? Getting same information?
Never told you it was better :-)
But, first of all, PowerShell is a script language and therefore the values you get back is objects that could be used as conditions and so on, you could basically build anything you like, and you can automate it. Trying the same thing with wmic.exe is not really doable.
Second, since it is PowerShell that also means you could type things differently, meaning shorter, so it is also possible to type “gwmi win32_computersystem” to get the same information, just in another form.
Yes, you do need to remember WIN32 classes, but that’s like everything else you need to remember
Another reason to move towards using PowerShell is that wmic was deprecated in Windows Server 2012.
The WMI command-line tool (Wmic) is deprecated. Use PowerShell cmdlets instead.
Now, that is a very good reason :-)