Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Fri, 10 Jun 2005 10:01:02 -0300,    group: microsoft.public.platformsdk.active.directory        back       


Change User's FullName   
Hi i'm trying to change the user's fullname, so i wrote a function named
ChangeFullName(string obj, string FullName)
The first parameter is the user's object path (ex
CN=User,OU=WTF,DC=Foo,DC=Bar) and the second parameter is the user's new
name
(ex Mr User Dinosaur Head). I'm recieving the following error: "The
directory service cannot perform the requested operation on the RDN attribut
e of an object." What's the problem ? I can't find any reference to this
error..

Here is the function:
static void ChangeFullName(string obj, string FullName)

{

DirectoryEntry User = null;

try

{

User = new DirectoryEntry("LDAP://" + obj);

DirectorySearcher search = new DirectorySearcher(User);

search.PropertiesToLoad.Add("cn");

SearchResult result = search.FindOne();

if(result != null)

{

DirectoryEntry nEntry = result.GetDirectoryEntry();

nEntry.Properties["cn"].Value = FullName;

nEntry.CommitChanges();

}

}

catch(System.Runtime.InteropServices.COMException ez)

{

Console.WriteLine(ez.Message);

return;

}

catch(Exception e)

{

Console.WriteLine(e.Message);

return;

}

}



Thanks in advance,



Victor
date: Fri, 10 Jun 2005 10:01:02 -0300   author:   Victor Pereira

Re: Change User's FullName   
CN can only be changed using the Rename method because it is the RDN 
attribute for user class and is used for naming the object in the hierarchy.

However, are you sure you want to change the CN?  You might be wanting to 
change displayName instead.

Joe K.

"Victor Pereira"  wrote in message 
news:%23xCyZxbbFHA.2128@TK2MSFTNGP15.phx.gbl...
> Hi i'm trying to change the user's fullname, so i wrote a function named
> ChangeFullName(string obj, string FullName)
> The first parameter is the user's object path (ex
> CN=User,OU=WTF,DC=Foo,DC=Bar) and the second parameter is the user's new
> name
> (ex Mr User Dinosaur Head). I'm recieving the following error: "The
> directory service cannot perform the requested operation on the RDN 
> attribut
> e of an object." What's the problem ? I can't find any reference to this
> error..
>
> Here is the function:
> static void ChangeFullName(string obj, string FullName)
>
> {
>
> DirectoryEntry User = null;
>
> try
>
> {
>
> User = new DirectoryEntry("LDAP://" + obj);
>
> DirectorySearcher search = new DirectorySearcher(User);
>
> search.PropertiesToLoad.Add("cn");
>
> SearchResult result = search.FindOne();
>
> if(result != null)
>
> {
>
> DirectoryEntry nEntry = result.GetDirectoryEntry();
>
> nEntry.Properties["cn"].Value = FullName;
>
> nEntry.CommitChanges();
>
> }
>
> }
>
> catch(System.Runtime.InteropServices.COMException ez)
>
> {
>
> Console.WriteLine(ez.Message);
>
> return;
>
> }
>
> catch(Exception e)
>
> {
>
> Console.WriteLine(e.Message);
>
> return;
>
> }
>
> }
>
>
>
> Thanks in advance,
>
>
>
> Victor
>
>
>
date: Fri, 10 Jun 2005 09:59:47 -0400   author:   Joe Kaplan \(MVP - ADSI\)

Re: Change User's FullName   
Hi Joe,

I want to change the CN (The User FullName), why ? Because User FullName (In 
Active Directory) must be exactly the same with the Employee's full name in 
the PeopleSoft (Human Resource Database), but not the DisplayName.
For example:
Your name in my company's peoplesoft should be Joseph Esomething Kaplan, 
Under AD your Full Name must be equal, but your DisplayName could be Joe 
Kaplan, understood ?

Well, thanks for your help!

Regards,
Victor
"Joe Kaplan (MVP - ADSI)"  wrote 
in message news:eP%23MhScbFHA.3712@TK2MSFTNGP12.phx.gbl...
> CN can only be changed using the Rename method because it is the RDN 
> attribute for user class and is used for naming the object in the 
> hierarchy.
>
> However, are you sure you want to change the CN?  You might be wanting to 
> change displayName instead.
>
> Joe K.
>
> "Victor Pereira"  wrote in message 
> news:%23xCyZxbbFHA.2128@TK2MSFTNGP15.phx.gbl...
>> Hi i'm trying to change the user's fullname, so i wrote a function named
>> ChangeFullName(string obj, string FullName)
>> The first parameter is the user's object path (ex
>> CN=User,OU=WTF,DC=Foo,DC=Bar) and the second parameter is the user's new
>> name
>> (ex Mr User Dinosaur Head). I'm recieving the following error: "The
>> directory service cannot perform the requested operation on the RDN 
>> attribut
>> e of an object." What's the problem ? I can't find any reference to this
>> error..
>>
>> Here is the function:
>> static void ChangeFullName(string obj, string FullName)
>>
>> {
>>
>> DirectoryEntry User = null;
>>
>> try
>>
>> {
>>
>> User = new DirectoryEntry("LDAP://" + obj);
>>
>> DirectorySearcher search = new DirectorySearcher(User);
>>
>> search.PropertiesToLoad.Add("cn");
>>
>> SearchResult result = search.FindOne();
>>
>> if(result != null)
>>
>> {
>>
>> DirectoryEntry nEntry = result.GetDirectoryEntry();
>>
>> nEntry.Properties["cn"].Value = FullName;
>>
>> nEntry.CommitChanges();
>>
>> }
>>
>> }
>>
>> catch(System.Runtime.InteropServices.COMException ez)
>>
>> {
>>
>> Console.WriteLine(ez.Message);
>>
>> return;
>>
>> }
>>
>> catch(Exception e)
>>
>> {
>>
>> Console.WriteLine(e.Message);
>>
>> return;
>>
>> }
>>
>> }
>>
>>
>>
>> Thanks in advance,
>>
>>
>>
>> Victor
>>
>>
>>
>
>
date: Fri, 10 Jun 2005 14:55:53 -0300   author:   Victor Pereira

Re: Change User's FullName   
I think I understand.  You were just using confusing terminology from my 
perspective since CN is just "CN" to me, not FullName.  FullName doesn't 
necessarily have any special meaning in AD attributes.

Note that CN allows duplicates (in different OUs or containers), so if your 
PeopleSoft system is relying on that to be unique, you may need to make an 
extra effort to enforce that in AD.  The domain will enforce sAMAccountName 
to be unique across the domain though.

Joe K.

"Victor Pereira"  wrote in message 
news:OMtvKWebFHA.1044@TK2MSFTNGP10.phx.gbl...
> Hi Joe,
>
> I want to change the CN (The User FullName), why ? Because User FullName 
> (In Active Directory) must be exactly the same with the Employee's full 
> name in the PeopleSoft (Human Resource Database), but not the DisplayName.
> For example:
> Your name in my company's peoplesoft should be Joseph Esomething Kaplan, 
> Under AD your Full Name must be equal, but your DisplayName could be Joe 
> Kaplan, understood ?
>
> Well, thanks for your help!
>
> Regards,
> Victor
> "Joe Kaplan (MVP - ADSI)"  wrote 
> in message news:eP%23MhScbFHA.3712@TK2MSFTNGP12.phx.gbl...
>> CN can only be changed using the Rename method because it is the RDN 
>> attribute for user class and is used for naming the object in the 
>> hierarchy.
>>
>> However, are you sure you want to change the CN?  You might be wanting to 
>> change displayName instead.
>>
>> Joe K.
>>
>> "Victor Pereira"  wrote in message 
>> news:%23xCyZxbbFHA.2128@TK2MSFTNGP15.phx.gbl...
>>> Hi i'm trying to change the user's fullname, so i wrote a function named
>>> ChangeFullName(string obj, string FullName)
>>> The first parameter is the user's object path (ex
>>> CN=User,OU=WTF,DC=Foo,DC=Bar) and the second parameter is the user's new
>>> name
>>> (ex Mr User Dinosaur Head). I'm recieving the following error: "The
>>> directory service cannot perform the requested operation on the RDN 
>>> attribut
>>> e of an object." What's the problem ? I can't find any reference to this
>>> error..
>>>
>>> Here is the function:
>>> static void ChangeFullName(string obj, string FullName)
>>>
>>> {
>>>
>>> DirectoryEntry User = null;
>>>
>>> try
>>>
>>> {
>>>
>>> User = new DirectoryEntry("LDAP://" + obj);
>>>
>>> DirectorySearcher search = new DirectorySearcher(User);
>>>
>>> search.PropertiesToLoad.Add("cn");
>>>
>>> SearchResult result = search.FindOne();
>>>
>>> if(result != null)
>>>
>>> {
>>>
>>> DirectoryEntry nEntry = result.GetDirectoryEntry();
>>>
>>> nEntry.Properties["cn"].Value = FullName;
>>>
>>> nEntry.CommitChanges();
>>>
>>> }
>>>
>>> }
>>>
>>> catch(System.Runtime.InteropServices.COMException ez)
>>>
>>> {
>>>
>>> Console.WriteLine(ez.Message);
>>>
>>> return;
>>>
>>> }
>>>
>>> catch(Exception e)
>>>
>>> {
>>>
>>> Console.WriteLine(e.Message);
>>>
>>> return;
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> Thanks in advance,
>>>
>>>
>>>
>>> Victor
>>>
>>>
>>>
>>
>>
>
>
date: Fri, 10 Jun 2005 21:56:30 -0500   author:   Joe Kaplan \(MVP - ADSI\)

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us