Solved

powershell array to represent the OU.

Posted on 2013-11-07
3
162 Views
Last Modified: 2013-11-14
I was using quest to get this to run and I am having some problems. Can someone please tell me where the problem might be with this code. I posted this but the code did not work in what I received in the reply.


@(
"OU=USERS,OU=HR,DC=SOMECOMPANY,DC=COM"
"OU=USERS,OU=FINANCE,DC=SOMECOMPANY,DC=COM"
"OU=USERS,OU=SALES,DC=SOMECOMPANY,DC=COM"
"OU=USERS,OU=IT,DC=SOMECOMPANY,DC=COM"
) | % {

Get-QADUser -searchroot $_ | Set-QADUser -passwordneverexpire $true

}
0
Comment
Question by:techdrive
  • 2
3 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 39631509
What is the problem?
0
 
LVL 18

Expert Comment

by:Raheman M. Abdul
ID: 39633266
You did not enter comma at the end of each line.

@(
"OU=USERS,OU=HR,DC=SOMECOMPANY,DC=COM",
"OU=USERS,OU=FINANCE,DC=SOMECOMPANY,DC=COM",
"OU=USERS,OU=SALES,DC=SOMECOMPANY,DC=COM",
"OU=USERS,OU=IT,DC=SOMECOMPANY,DC=COM"
) | % {

Get-QADUser -searchroot $_ | Set-QADUser -passwordneverexpire $true

}
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39633445
It will work without comma...
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Set OWA language and time zone in Exchange for individuals, all users or per database.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 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

16 Experts available now in Live!

Get 1:1 Help Now