Archive for October 19th, 2007

PowerShell Scripts and Functions

Scripting October 19th, 2007

I’ve included a few scripts and functions that I’ve found useful in playing around with PowerShell.  There are probably better/easier ways of doing these things, and many of my scripting ideas were gleaned from the blogs/podcasts/websites of those who are better with PowerShell than I.

That said, download the scripts, improve them, delete them…

Scripts: (can be run from the PowerShell command prompt)

    – This script will get a listing of all the computer accounts in the current Active Directory Domain.

    -This script is based off of the previous one and checks all the computers that have Active Directory accounts and are live on the network (respond to pings) for their serial number via WMI.

Functions: (create a function that can be used from the command prompt)


    – This function will take as input a RSS Feed link and return a listing of the names of the posts and their links.  The default feed is for “A Couple Of Admins Podcasting”.

    – This function takes either a string as an argument or (with the -file) switch, you can supply the name of a saved SQL query (either a .txt file or .sql file).  This function needs to be updated with your database connection information.

**In order to make the functions available from the command line, you have to “dot source” them.**


Powered by ScribeFire.