Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Add user to Security group base on Division Attribute with multiple values

$
0
0

Need a script that would add users to a Security Group if the Division attribute value is either "001 Inside Sales West" or "002 Inside Sales East".

here is a script so that you know what I am trying to do:

get-aduser -SearchBase ‘OU=Users,OU=City,DC=company1,DC=com’ -LDAPFilter "(&(division=001 Inside Sales West) -or (division=002 Inside Sales East))" | foreach {Add-ADGroupMember "sg-Sales-USUsers" -Member $_}

any help would be greatly appreciated, thanks

Noe


Viewing all articles
Browse latest Browse all 15028

Trending Articles