Solved

powershell array to represent the OU.

Posted on 2013-11-07
3
158 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
Comment Utility
What is the problem?
0
 
LVL 18

Expert Comment

by:Raheman M. Abdul
Comment Utility
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
Comment Utility
It will work without comma...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Set OWA language and time zone in Exchange for individuals, all users or per database.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

17 Experts available now in Live!

Get 1:1 Help Now