create a new ActiveDirectorySchemaProperty

Z

zimmys

hello,

i want to create a new active directory schema property. for testing,
i use the following simpy function:

Code:
public void createProperty()
{

string cn = "leo8";

DirectoryContext dc = new
DirectoryContext(DirectoryContextType.DirectoryServer, serverIP,
userName, password);

ActiveDirectorySchemaProperty prop = new
ActiveDirectorySchemaProperty(dc, cn);


Guid g = new Guid();

prop.CommonName = cn;
prop.Description = "blabla";
prop.IsDefunct = false;
prop.IsIndexed = false;
prop.IsIndexedOverContainer = false;
prop.IsInGlobalCatalog = true;
prop.IsSingleValued = true;
prop.Oid = "1.3.6.1.4.1.28070.9.1.3.45";
prop.Syntax = ActiveDirectorySyntax.CaseIgnoreString;
prop.SchemaGuid = g = Guid.NewGuid();
prop.Save();
}

now my problem.
the function works fine, but i get some exceptions!

at first and second time, the
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException

(translated from german) the directoryServer
'illertec-6hvyin.testdomain.lan' is not avaible or can not contact,

and then a
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectExistsException
(translate from german) object allready exists.

i am looking in the schema, and i find that the new property was
created at the first call from the prop.save() function.
i understand why the .ActiveDirectoryObjectExistsException is called,
but i do not understand why the
ActiveDirectoryObjectNotFoundException is called, when the property is
created.

thanks for comments

zimmys

some informations:
the domaincontroler that is called, is runnig on a virtual machine(for
test purposes), and is not the domaincontroler for my real domain
where my devolopment environment runs.
the dc is an server2003 r2 and i my machine runs under vista with
visual studio 2005.
 
W

Willy Denoyette [MVP]

zimmys said:
hello,

i want to create a new active directory schema property. for testing,
i use the following simpy function:

Code:
public void createProperty()
{

string cn = "leo8";

DirectoryContext dc = new
DirectoryContext(DirectoryContextType.DirectoryServer, serverIP,
userName, password);

ActiveDirectorySchemaProperty prop = new
ActiveDirectorySchemaProperty(dc, cn);


Guid g = new Guid();

prop.CommonName = cn;
prop.Description = "blabla";
prop.IsDefunct = false;
prop.IsIndexed = false;
prop.IsIndexedOverContainer = false;
prop.IsInGlobalCatalog = true;
prop.IsSingleValued = true;
prop.Oid = "1.3.6.1.4.1.28070.9.1.3.45";
prop.Syntax = ActiveDirectorySyntax.CaseIgnoreString;
prop.SchemaGuid = g = Guid.NewGuid();
prop.Save();
}

now my problem.
the function works fine, but i get some exceptions!

at first and second time, the
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException

(translated from german) the directoryServer
'illertec-6hvyin.testdomain.lan' is not avaible or can not contact,

and then a
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectExistsException
(translate from german) object allready exists.

i am looking in the schema, and i find that the new property was
created at the first call from the prop.save() function.
i understand why the .ActiveDirectoryObjectExistsException is called,
but i do not understand why the
ActiveDirectoryObjectNotFoundException is called, when the property is
created.

thanks for comments

zimmys

some informations:
the domaincontroler that is called, is runnig on a virtual machine(for
test purposes), and is not the domaincontroler for my real domain
where my devolopment environment runs.
the dc is an server2003 r2 and i my machine runs under vista with
visual studio 2005.



Your question is not C# language related, you better post such questions to the
microsoft.public.windows.server.active_directory or
microsoft.public.de.german.windows.server.active_directory NG.

Willy.
 
Z

zimmys

i want to create anewactive directory schema property. for testing,
i use the following simpy function:
Code:
public void createProperty()
{[/QUOTE]
[QUOTE]
string cn = "leo8";[/QUOTE]
[QUOTE]
DirectoryContext dc =new
DirectoryContext(DirectoryContextType.DirectoryServer, serverIP,
userName, password);[/QUOTE]
[QUOTE]
ActiveDirectorySchemaPropertyprop =new
ActiveDirectorySchemaProperty(dc, cn);[/QUOTE]
[QUOTE]
Guid g =newGuid();[/QUOTE]
[QUOTE]
prop.CommonName = cn;
prop.Description = "blabla";
prop.IsDefunct = false;
prop.IsIndexed = false;
prop.IsIndexedOverContainer = false;
prop.IsInGlobalCatalog = true;
prop.IsSingleValued = true;
prop.Oid = "1.3.6.1.4.1.28070.9.1.3.45";
prop.Syntax = ActiveDirectorySyntax.CaseIgnoreString;
prop.SchemaGuid = g = Guid.NewGuid();
prop.Save();
}
now my problem.
the function works fine, but i get some exceptions!
at first and second time, the
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException
(translated from german) the directoryServer
'illertec-6hvyin.testdomain.lan' is not avaible or can not contact,
and then a
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectExistsException
(translate from german) object allready exists.
i am looking in the schema, and i find that thenewproperty was
created at the first call from the prop.save() function.
i understand why the .ActiveDirectoryObjectExistsException is called,
but i do not understand why the
ActiveDirectoryObjectNotFoundException is called, when the property is
created.
thanks for comments

some informations:
the domaincontroler that is called, is runnig on a virtual machine(for
test purposes), and is not the domaincontroler for my real domain
where my devolopment environment runs.
the dc is an server2003 r2 and i my machine runs under vista with
visual studio 2005.

Your question is not C# language related, you better post such questions to the
microsoft.public.windows.server.active_directory or
microsoft.public.de.german.windows.server.active_directory NG.

Willy.

i think,that the question is right here. the problem is not the
server(the server works fine), the problem is the framwork!

but thank you for posting

zimmys
 
Top