Solved

need assistance with a quest AD cmdlets script

Posted on 2013-10-29
2
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

739 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