Quest PowerShell extensions rock too
When my co-worker (who is interested in learning PowerShell too) asked me how to get a list of all the members of a given Security group, I didn't have a ready answer for him. I hadn't had occasion to learn how to do that yet and a quick search didn't show anything obvious or simple.
I had read in various blog posting and on the Microsoft newsgroups about Quests PowerShell extensions. As they were supposed to make some Active Directory related tasks easier, I thought this was the perfect time to try them out.
One download and install later I was looking through the 109 page Active Roles Management Shell for Active Directory guide and there in the table of contents was the Get-QADGroupMember commandlet on page 59.
Get-QADGroupMember domainName\GroupNameThis gets us name type and DN. To much information and not quite what we need. So off to our favorite discovery tool
Get-QADGroupMember domainName\GroupName | Get-Member -MemberType propertyThis lets us discover the properties that allow us to use PowerShell's filtering capabilities. As my co-worker needs the logonname and the displayname, we came up with this final code.
Get-QADGroupMember domainName\GroupName | select logonname, dislaynameThe total time it took to get here was about 10 minutes. My co-worker is now even more excited about learning PowerShell. So much to learn, so little spare time.

Theme by
Post new comment