Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Powershell script to update the security group descriptions with the count.

Avatar of bsharath
bsharathFlag for India asked on
Programming Languages-OtherScripting LanguagesPowershell
6 Comments1 Solution844 ViewsLast Modified:

Powershell script to update the security group descriptions with the count.
Below code from Chris
i want to query all security groups in an OU and update the below along with the Nested group count and should not clear whats there at present but add the details to the end. I dont want the group name in them

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

Descript should be as
(Member count : 33) ( Nested groups : 3) (Contacts : 2)

If already data is there do nothing but update the above to the end.

Avatar of Chris Dent
Chris DentFlag of United Kingdom of Great Britain and Northern Ireland imagePowerShell Developer
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers