Search This Blog

Monday, September 27, 2010

Code to give member count of a Group

Scenario: Member count is required for approval for granting mass mailing rights to user.
So far vb script has been used to do this job when SysAdmin needs to manually add the dn of the group and run the script however they can now use a small PS code to do the same task more effectively

(Get-Group -Identity medstaff_sender).members | measure-object name or

(Get-Group -Identity medstaff_sender).members |  foreach($count++) | $count

Then $count for the no. of members.

Cheers !!!

No comments:

Post a Comment