Archive for November, 2009
PowerShell – Working with an Excel Range
Posted by Karl Mitschke in PowerShell on November 27, 2009
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 “:” […]
Use the –Filter, Luke
Posted by Karl Mitschke in Exchange, PowerShell on November 25, 2009
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 ` ‘karlmitschke@contoso.com’} 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 […]
Get-DistributionGroupMember Recursively
Posted by Karl Mitschke in Exchange, PowerShell on November 24, 2009
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
Posted by Karl Mitschke in DCOM, PowerShell, WMI on November 20, 2009
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 […]