header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Updating the CN
Last Post 30 Jun 2010 04:14 AM by James. 2 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
JamesUser is Offline
Basic Member
Basic Member
Posts:374
Avatar

--
30 Jun 2010 02:12 AM

    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

    Shay LevyUser is Offline
    PowerShell MVP, Admin
    Veteran Member
    Veteran Member
    Posts:1362
    Avatar

    --
    30 Jun 2010 03:15 AM
    Use the Rename-QADObject cmdlet to update the CN attribute.

    Shay Levy
    Windows PowerShell MVP
    http://PowerShay.com
    PowerShell Community Toolbar
    Twitter: @ShayLevy
    JamesUser is Offline
    Basic Member
    Basic Member
    Posts:374
    Avatar

    --
    30 Jun 2010 04:14 AM
    Superb!

    You are a star as per usual! :)

    Many Thanks

    James
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer