Hello,
We have a requirement to update the CN Attribute for all the users in specific OU's as they require a "."
I have tried teh following :
Get-QADUser -Identity "anne.dean" |
ForEach-Object {
$FirstName = $_.GivenName
$LastName = $_.sn
$Sam = $_.SamAccountName
$NewDisplaName = $FirstName.Trim() + "." + $LastName.Trim()
$NewDisplaName
Set-Item
Set-QADUser -Identity $Sam -ObjectAttributes @{cn = $NewDisplaName}
}
However when I run it I am getting the following error:
Set-QADUser : The directory service cannot perform the requested operation on t
he RDN attribute of an object. (Exception from HRESULT: 0x80072016)
At line:8 char:12
+ Set-QADUser <<<< -Identity $Sam -ObjectAttributes @{cn = $NewDisplaName}
+ CategoryInfo : NotSpecified: (:) [Set-QADUser], DirectoryServic
esCOMException
+ FullyQualifiedErrorId : System.DirectoryServices.DirectoryServicesCOMExc
eption,Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.SetUserCmd
let
I dont understand why...
Does anyone know what the issue is?
Many Thanks
James