Powershell Scripts

thecoldone06

Member
Reaction score
1
Location
St. Louis, MO
General System Information Script

I've been messing around with MS's new scripting language, Powershell. It's a very cool language. For those that have Powershell installed, I'd like you to take a look at a script I made. I did it yesterday so I'm sure it can be broken. It basically gives you System, OS, CPU, Disk, Network, and event log information for the local box or a remote box. In the script body at the bottom, define $computer (ex. $computer = "localbox", "remote1", "remote2") Then go to powershell and run it. I know there is a way to make Powershell portable, which this would give a very easy to way of getting lots of information fairly quickly for machines that don't even have PS installed. Let me know what you think.

NOTE: In order to run the file you need to download it and rename it with a .ps1 extension.
 

Attachments

Last edited:
Made Another. This gives detailed information on the memory installed in the computer. Takes one argument, computer name. If its the local computer it won't ask for administrator privileges if it is a remote computer, it will. Let me know what you all think. As before, rename from .txt to .ps1 so it will run.

EDIT: Added general memory info. Max capacity, used capacity, total slots, free slots, type of error correction used, and use. Attached file has been updated.
 

Attachments

Last edited:
List Installed Software

I found this one on the internet and decided to post it because it is very cool. It lists all software (including Windows updates) and exports them to Excel. It lists Name, Version, Publisher, Installed on date, Help link, and uninstall string. It was created by Ying Li and if you want to check out the original page you can find it here.
 

Attachments

At my job I manage about 30 XP/Vista PC's and around 10 Windows '00,'03, and a couple '08 servers. So Powershell has really helped in managing them all. I understand that most everyone on here is managing one at a time when they are working on site. The idea of all these scripts is that you can create a portable version of Powershell, create a batch that runs them when you click it, and you can instantly have this information rather than searching for it. If nobody is at all interested in any of these by all means tell me and I'll stop posting them. I just thought that maybe they would help someone out.
 
I found this one on the internet and decided to post it because it is very cool. It lists all software (including Windows updates) and exports them to Excel. It lists Name, Version, Publisher, Installed on date, Help link, and uninstall string. It was created by Ying Li and if you want to check out the original page you can find it here.

That code bombs on my box

Exception setting "Visible": "Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATARE
AD))"
At C:\script.ps1:2 char:4
+ $a.v <<<< isible = $True
Exception calling "Add" with "0" argument(s): "Old format or invalid type library. (Exception from HRESULT: 0x80028018
(TYPE_E_INVDATAREAD))"
At C:\script.ps1:4 char:22
+ $b = $a.Workbooks.Add( <<<< )
You cannot call a method on a null-valued expression.
At C:\script.ps1:5 char:24
+ $c = $b.Worksheets.Item( <<<< 1)
You cannot call a method on a null-valued expression.
At C:\script.ps1:7 char:14
+ $c.Cells.Item( <<<< 1,1) = "Name"
You cannot call a method on a null-valued expression.
At C:\script.ps1:8 char:14
+ $c.Cells.Item( <<<< 1,2) = "Version"
You cannot call a method on a null-valued expression.
At C:\script.ps1:9 char:14
+ $c.Cells.Item( <<<< 1,3) = "Publisher"
You cannot call a method on a null-valued expression.
At C:\script.ps1:10 char:14
+ $c.Cells.Item( <<<< 1,4) = "InstalledOn"
You cannot call a method on a null-valued expression.
At C:\script.ps1:11 char:14
+ $c.Cells.Item( <<<< 1,5) = "HelpLink"
You cannot call a method on a null-valued expression.
At C:\script.ps1:12 char:14
+ $c.Cells.Item( <<<< 1,6) = "UninstallString"
Property 'ColorIndex' cannot be found on this object; make sure it exists and is settable.
At C:\script.ps1:15 char:13
+ $d.Interior.C <<<< olorIndex = 19
Property 'ColorIndex' cannot be found on this object; make sure it exists and is settable.
At C:\script.ps1:16 char:9
+ $d.Font.C <<<< olorIndex = 11
Property 'Bold' cannot be found on this object; make sure it exists and is settable.
 
Powershell is far from what I am using to administer my network and workstations. I want to know more its applications and compatibility, I am thinking of studying it to have new approach in my administration.
thanks.
 
There are tons of examples and explanations online for just about anything you want to do in Powershell. Just google anything you want to do with powershell behind it and your bound to find something. If you have any questions, let me know. :)
 
A powershell gui

Also (if it was mentioned, sorry) google powershell gui, it is a great piece of software from quest that lets you graphically build text commands
 
Back
Top