Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

It works. but i do not understand why

$
0
0

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


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>