Skip to Content
Personal website of Steven Peck. Focusing on Microsoft technologies (most notably PowerShell), and other random bits I think to write.

PowerShell - Find iLO on a subnet

Recently we had a need to find the versions of HP iLO on all our servers. Finding out through SIM can be challenging so we could log onto each server which was unappealing. I did some searches and could only find a script for scanning based on BASH so I thought I would give it a go in PowerShell. I am sure there are ways to tighten it up but it was fun to do.

I've only run it in PowerShell v2 and it requires the BSonPosh module.

PowerShell - Why you should learn PowerShell

James O'Neill has an awesome post on why you should learn PowerShell now or get left behind. I have been advocating at work for a while now and his is a great post on the importance of getting on the band wagon now.

When v2 was released last week I tossed this email notification and quick links together for my co-workers.

-----

PowerShell v2 is the native scripting and management shell for Windows 7 and Windows 2008r2. Last week, Microsoft released versions for Windows XP, Vista, Server 2003sp2 and Server 2008sp2. They have released it under the title of Windows Management Framework which is made up of;
• Windows Remote Management (WinRM) 2.0
• Windows PowerShell 2.0
• Background Intelligent Transfer Service (BITS) 4.0

Microsoft added PowerShell as part of their Common Engineering Criteria for all server based products as of 2009 so it’s something to be aware of going forward for all their products.

The announcement on the PowerShell team blog is here;
http://blogs.msdn.com/powershell/archive/2009/10/27/windows-management-f...

The software, and links to documentation, can be found here;
http://support.microsoft.com/kb/968929

Some articles on the differences can be found on the Hey Scripting Guys website;
http://blogs.technet.com/heyscriptingguy/archive/2009/10/26/hey-scriptin...
http://blogs.technet.com/heyscriptingguy/archive/2009/10/27/hey-scriptin...
http://blogs.technet.com/heyscriptingguy/archive/2009/10/28/hey-scriptin...

A very good, and free, ebook can be found online and as a pdf here;
http://powershell.com/cs/blogs/ebook/

While PowerShell v2 comes with a nice editor, there are a lot of things I still use Notepad++ for and there is a great syntax highlighting lexer that can be found here;
http://poshcode.org/notepad++lexer/

Have fun playing with this great tool.

PowerShell - Comparing group membership

Recently a question came up about not being able to create new objects in certain AD containers. As this was essentially an account access issue I thought I would see if I could get this to work in PowerShell using compare-object.

VMware get-lunpathsetting.ps1

Recently had a need to validate the configured LUN path settings in some of our VMware environments. The prospect of checking them through the VIClient GUI was less then appealing as was checking via command line on each VMhost. So I used VMware's new PowerCLI PowerShell plugin to automate the information gathering. After I did this, my co-worker found a script to set preferences by odd/even Set HBA Preference

We have multiple environments so I tried to make the settings as generic as possible. I added date/time and VIServer to the file name so that it wouldn't get over written if you were running it before and after a configuration change or against different environments.

PowerShell - Quickly getting user logon name

To resolve an issue, a co-worker requested a list of user IDs of the affected employees. The customer just sent a list of people (first name, last name) with no user logon IDs. Using ADUC to look them all up (it was a long list) would have taken a bit of time and rather then try and have the customer revisit everyone I grabbed the lists and ran it through the command line. I had PowerShell launched and didn't want to bother with launching explorer and navigating to the directory (also, as much PowerShell as possible and practical is the game we are playing)

You will need Microsoft's PowerShell and Quests Active Directory tools installed.

Here are the steps...

PowerShell - Enumerating groups to Excel

A friend had a semi-regular request for the members of a long list of distribution groups (70-80). I hacked together something that dumped everthing to a big text file which he then had to convert to an Excel spreadsheet. Not an optimal solution for automation. I thought this was an excellent time to learn how to put data in Excel.

The script as written takes input from a text file of the group (Distribution lists, but any group would work) but you could change that to a query easily enough.

Syndicate content