How can I get this script to show serial number as well as name and model in the output? Also I would like to output to Excel.
Also, is using a txt file list the best way to input the list of PCs?
I am just getting my feet wet in PS Scripting so would love some assistance.
You will have to create an object and concatenate the output of your 2 commands. Then you can pipe that output to whatever you like / need. In my example here it’s piped to a csv file what’s almost perfect to open it in Excel.
I settled on this using Configuration Manager. Though now I run into RPC server unavailable errors for some of the machines. Though that’s a separate issue.
Thanks for your help and suggestions. Powershell is a powerful tool that I am keen to learn.
If you like to learn a little more about Powershell and spend some time you could take a look at this: MVA Advanced Tools and Scripting with Powershell 3.0 Jump Start
When they come to the lession for error handling that fits almost prefectly to your RPC unavailable errors you mentioned.