The 2011 Scripting Games Beginner Event 5: Use PowerShell to Collect Basic Computer Information

The 2011 Scripting Games Beginner Event 5: Use PowerShell to Collect Basic Computer Information

  • Comments 5
  • Likes

2011 Scripting Games badge

Summary: Beginner Event 5 uses Windows PowerShell to collect basic computer information.

About this event

Division

Beginner

Date of Event

4/8/2011 12:01 AM

Due Date

4/15/2011 12:01 AM

Event scenario

You need to collect the user name, computer name, domain name, and the operating system information from a number of computers. To make matters easier, you have decided to write the information to a text file. The text file needs to be saved as an ASCII file, and not as Unicode. You should include the date in which the information was gathered to determine the reliability of the information. A sample file output is shown in the following image.

Image of file output

Design points

  • Extra points for a script that will work on a remote machine
  • Extra points for a script that will accept a Text file, CSV, or other type of input of remote computer names
  • Extra points for adding useful Help information and comments
  • Design points for clear, easy-to-read code and for the use of native Windows PowerShell cmdlets

2011 Scripting Games links

2011 Scripting Games: All Links on One Page

Submit your scripts on PoshCode

Support our Sponsors!

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. Good luck as you compete in this year’s Scripting Games. We wish you well.

Ed Wilson, Microsoft Scripting Guy

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • When you say "user name", do you mean the user to whom the Os is licensed to?

  • I'm guessing a powershell script that opens up my network inventory program doesn't count? :)

  • @Srikanth the user who is currently logged onto the machine ... not the user to whom the OS is licensed to.

    @Cseiter you are correct, a script that opens your network inventory program would not count for very much in this scenario.

  • If you are accessing the remote server through a pssession, are you wanting the user name of the person initiating this connection or active logged on users on the server at that point in time?

  • thank you