Re: Adding OU

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 05/10/05


Date: Tue, 10 May 2005 09:32:58 -0500

Right, it is an RDN value, or relative distinguished name. Sounds like you
got it now.

Joe K.

<dl> wrote in message news:uUglUSTVFHA.3696@TK2MSFTNGP10.phx.gbl...
> Sorry, I got it. --> newOUName doesn't need to be a dn, just
> ou="something" -->
>
> <dl> wrote in message news:%233g13NTVFHA.3240@TK2MSFTNGP10.phx.gbl...
>> Hi
>> I get a bit progress on this, now I am getting naming violation with the
>> following code
>>
>> newOUName=DN="OU=anotherOU,DC=mydomain, DC=com";
>> DirectoryEntry myDir = new DirectoryEntry(str_path,
>> uName,
>> uPwd);
>> DirectoryEntry newOU = myDir.Children.Add(newOUName,
>> "organizationalUnit");
>> newOU.CommitChanges();
>>
>> Any idea, please?
>> TIA
>>
>> <dl> wrote in message news:OP4OK%23SVFHA.3540@TK2MSFTNGP15.phx.gbl...
>> > Hi
>> > How can we add OU to a directory? TIA details.....
>> >
>> > I have tried using the following code but getting exception error
>> >
>> > Exception: The specified directory service attribute or value does not
>> > exist.
>> >
>> > -------------
>> > str_path = "DC=mydomain,DC=com";
>> > newOUName = "OU=anotherOU";
>> > DirectoryEntry myDir = new DirectoryEntry(str_path,
> uName,
>> > uPwd);
>> > DirectoryEntry newOU = myDir.Children.Add(newOUName,
>> > "Organizational-Unit");
>> > newOU.CommitChanges();
>> >
>> > ----------
>> >
>> > --
>> >
>> >
>> >
>>
>>
>
>