Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Error in Script - Please Help

$
0
0

I have a list of users in a text file that have been disabled.  The script below is supposed to re-enable the accounts and move them back to there origonal OU.  However upon running it I'm getting an error message:

 

Script:

 

Connect-QADservice -Proxy

$users = Get-Content C:\users.txt

$moveops = Get-QARSOperation -OperationType Move -InitiatedByMe -CompletedRecently 3

$moveops | foreach `

{

$dn = $_.targetobjectinfo.dn

$usercn = $dn.replace("CN=","").split(",")[0]

if($users -contains $usercn)

{

$userdn = $dn.split(",")

$userdn = [string]::Join(",",$userdn[((($userdn.count)*(-1))+1)..-1])

Move-QADObject -Identity $usercn -NewParentContainer $userdn

}

}

Disconnect-QADService

 

 

Error Message:

 

image_png.png

 

Please help!!


Viewing all articles
Browse latest Browse all 1277

Trending Articles