hi,
I need to update on a daily basis ~ 900 security groups.
As part of the script I was looking for a way to efficiently delete the members of a group and then add the correct ones.
I ended up writing this line (where $strCourseIDis the group name):
Remove-ADGroupMember $strCourseID -member (get-adgroupmember $strCourseID) -confirm:$false
It is very fast BUT i dont recall seeing similar syntax used, i mean the part with -member (some code).
So I have 2 questions:
1) can anyone enlighten me as to this style of writing? any more examples?
2) what alternative ways are there to empty a security group efficiently
much obliged
Roy
roys99