Getting Computer name, serial number and model of list of machines

Welcome Forums General PowerShell Q&A Getting Computer name, serial number and model of list of machines

Viewing 5 reply threads
  • Author
    Posts
    • #59760
      Participant
      Topics: 1
      Replies: 2
      Points: 0
      Rank: Member

      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.

    • #59772
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      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. 😉

      If you just have a simple list of items, a text file with a single item on each line is just fine.

    • #59773
      Participant
      Topics: 1
      Replies: 2
      Points: 0
      Rank: Member

      That’s brilliant, thanks, is there any way to get primary user for the list of devices generated in this script?

    • #59791
      Participant
      Topics: 0
      Replies: 1
      Points: 1
      Rank: Member

      You could add on a line on 5 like:

      and then bring it in on 9/10 with:

      If not exactly what your looking for, Win32_NetworkLoginProfile seems to be close to what your seeking and should have an answer at least.

    • #59869
      Participant
      Topics: 1
      Replies: 2
      Points: 0
      Rank: Member

      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.

    • #59886
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      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. 😉

Viewing 5 reply threads
  • The topic ‘Getting Computer name, serial number and model of list of machines’ is closed to new replies.