MilesLogan
asked on
Power Shell - Quest - How to pull sAMAccountNames from multiple groups
Hi EE
I have the script below that pulls the info below from the groups I enter in the groups.txt file .. any idea what I need to modify so it also outputs the sAMAccountNames for the group members ?
GC C:\Powershell\Groups.txt | % {
Get-qadgroup $_ | Select GroupName,GrpMembers,Accou ntIsDisabl ed,UserDN
Get-Qadgroup $_ | Get-QADGroupMember -Indirect -SizeLimit 0 |
? {$_.Type -eq "User"} | Select GroupName,@{N="GrpMembers" ;E={$_.Nam e}},Accoun tIsDisable d,@{N="Use rDN";E={$_ .DN}}
} | Select-Object GroupName,GrpMembers,Accou ntIsDisabl ed,UserDN | ConvertTo-HTML | Out-File C:\Powershell\Test.htm
I have the script below that pulls the info below from the groups I enter in the groups.txt file .. any idea what I need to modify so it also outputs the sAMAccountNames for the group members ?
GC C:\Powershell\Groups.txt | % {
Get-qadgroup $_ | Select GroupName,GrpMembers,Accou
Get-Qadgroup $_ | Get-QADGroupMember -Indirect -SizeLimit 0 |
? {$_.Type -eq "User"} | Select GroupName,@{N="GrpMembers"
} | Select-Object GroupName,GrpMembers,Accou
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
It is so kind of you to say that.. :-).. I am happy to help!.. Definitely I am planning to start my own blog, but as of now I am flooded with projects and I am just popping in as and when I get time to keep myself updated..
ASKER
when will we see the Subsun blog ? if I can help by giving you the url and some space for it let me know .. the least I can do to help
thanks much !