Solved

need assistance with a quest AD cmdlets script

Posted on 2013-10-29
2
303 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

Join & Write a Comment

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create a Contact 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 Recipients >> Contact ta…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now