Update the group description with group name and member count.

bsharath
bsharath used Ask the Experts™
on
Hi,

Update the group description with group name and member count.
In AD i have a OU where i have Distribution groups.
When queried with a script i want each group be be queried and updated the description as this

Groupname (Member count : 55)

Can anone help with a script to do this.

Regards
sharath
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
PowerShell Developer
Top Expert 2010
Commented:

Quest CmdLets and I think this might do it :)


Get-QADGroup -SearchRoot "OU=groups,DC=domain,DC=com" | ForEach-Object {
  Set-QADGroup $_.DN -Description "$($_.Name) (Member count: $($_.Members.Count))"
}


As always, test it on a small set first to make sure.

Chris

Author

Commented:
Thanks a lot Chris
Posted a related post please have a look

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial