Solved

powershell array to represent the OU.

Posted on 2013-11-07
3
178 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
[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
3 Comments
 
LVL 40

Expert Comment

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

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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

691 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