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

Is it possible to change the cn from a User- or Group-Object?

$
0
0

Hello,

 

I want to change the cn of a Group or an User with a PowerShell Script. In The Screenshot is the Name(cn) visible.

Cn.png

 

So I tried the follwinng snippet (also connected as administrator to the QAD-Service)

 

$group = Get-QADObject 'U-XX-DIST-ThisIsTheGroup-OE-intern' # these is the samaccountname

$group.Name

 

So I can see the cn from the Group. If want to change the Name(cn) from these Group it doesn't work.

 

Snippet to change the cn 1

Set-QADObject -Identity $group.CanonicalName -ObjectAttributes @{cn='U-XX-DIST-ThisIsTheGroup-OE-intern'}

 

There are no errors, but it wont work. The Name(cn) is still the same.

 

Snippet to change the cn 2

Set-QADObject -Identity $group.CanonicalName -ObjectAttributes @{Name ='U-XX-DIST-ThisIsTheGroup-OE-intern'}

 

So I received an error, see below.

 

Set-QADObject : Exception has been thrown by the target of an invocation.

+ Set-QADObject -Identity $group.CanonicalName -ObjectAttributes @{Name ='U-XX ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Set-QADObject], TargetInvocationException

    + FullyQualifiedErrorId : System.Reflection.TargetInvocationException,Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.SetObjectCmdlet

 

 

My Question is:
Is there any way to change the Name(cn) with a PowerShell Script.

 

 

thank for help in advance

rewe


Viewing all articles
Browse latest Browse all 1277

Trending Articles