Solved

need assistance with a quest AD cmdlets script

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

863 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

18 Experts available now in Live!

Get 1:1 Help Now