Make all users within the domain a member of a security group
Using either Powershell or VBS, how can开发者_StackOverflow中文版 I make all of the users within my domain who have an email address a member of a specific security group?
import ActiveDirectory
$Group = Get-ADGroup -filter {Name -eq "GroupName"}
Get-ADUser -filter {EmailAddress -like "*"} | % {Add-ADGroupMember $Group $_}
精彩评论