Solved

need assistance with a quest AD cmdlets script

Posted on 2013-10-29
2
308 Views
Last Modified: 2013-10-29
can someone provide a script that will accomplish the following:

1. search a top level OU [and OU's under it]
2. look for a value in CustomAttribute1 - not equal to contractors
3. add the user to a group [VAusers] if customattribute1 not equal to "contractors"

many thanks.

S.
0
Comment
Question by:siber1
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39610515
Try..
script will search for users under OU "OU=Users,OU=HQ,DC=Domain,DC=com"
Get-QADuser -sizelimit 0 -searchroot "OU=Users,OU=HQ,DC=Domain,DC=com" -ip "extensionattribute1" |
?{$_.extensionattribute1 -ne "contractors"} | Add-QADGroupMember VAusers

Open in new window

0
 

Author Closing Comment

by:siber1
ID: 39610537
perfect. thanks Subsun
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
how to add IIS SMTP to handle application/Scanner relays into office 365.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question