Archive for November, 2009

PowerShell – Working with an Excel Range

I’m working on a server inventory project, and as part of that project, I need to add a field “Monitored” – this field will show either SCOM, Nimbus, No, or N/A. N/A will mean the server has an exception to monitoring. These servers are in a text file called NonmonitoredServers.txt: Server098 PRDServer198:PRDServer598 TestServer011:TestServer055 The “:” […]

Leave a comment

Use the –Filter, Luke

Quite often, I see questions like “Why is my Get-Recipient command so slow?”, with a syntax like: 001 002 003 $user1 = Get-Recipient -ResultSize unlimited ` |Where-Object {$_.emailaddresses -eq ` ‘’} You would think that would work lickity split, because there is only 1 result, me. Ah, not so fast, grasshopper.  We are doing client side filtering – all recipients are returned by […]

Leave a comment

Get-DistributionGroupMember Recursively

I had a need to get distribution group members for a specific group. Most people seem to install the free “ActiveRoles Management Shell for Active Directory” from Quest Software when they are facing a task such as this. With the Quest “ActiveRoles Management Shell”, you can do this like “Get-QadGroupMember <group name>–Indirect” I’m kind of […]


Script remote DCOM / WMI access for a non admin

Recently I was asked to create an inventory process that would query active directory for servers and gather data on their hardware. I said “No problem”, fired up my trusty domain admin account and ran a bunch of WMI calls against the servers. Of course, for a script that is to be run on a […]