473,396 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

create a new ActiveDirectorySchemaProperty

hello,

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

Expand|Select|Wrap|Line Numbers
  1. public void createProperty()
  2. {
  3.  
  4. string cn = "leo8";
  5.  
  6. DirectoryContext dc = new
  7. DirectoryContext(DirectoryContextType.DirectoryServer, serverIP,
  8. userName, password);
  9.  
  10. ActiveDirectorySchemaProperty prop = new
  11. ActiveDirectorySchemaProperty(dc, cn);
  12.  
  13.  
  14. Guid g = new Guid();
  15.  
  16. prop.CommonName = cn;
  17. prop.Description = "blabla";
  18. prop.IsDefunct = false;
  19. prop.IsIndexed = false;
  20. prop.IsIndexedOverContainer = false;
  21. prop.IsInGlobalCatalog = true;
  22. prop.IsSingleValued = true;
  23. prop.Oid = "1.3.6.1.4.1.28070.9.1.3.45";
  24. prop.Syntax = ActiveDirectorySyntax.CaseIgnoreString;
  25. prop.SchemaGuid = g = Guid.NewGuid();
  26. prop.Save();
  27. }
  28.  
now my problem.
the function works fine, but i get some exceptions!

at first and second time, the
System.DirectoryServices.ActiveDirectory.ActiveDir ectoryObjectNotFoundException

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

and then a
System.DirectoryServices.ActiveDirectory.ActiveDir ectoryObjectExistsException
(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.

Mar 24 '07 #1
2 3175
"zimmys" <da****@dessys.dewrote in message
news:11**********************@b75g2000hsg.googlegr oups.com...
hello,

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

Expand|Select|Wrap|Line Numbers
  1. public void createProperty()
  2.        {
  3.            string cn = "leo8";
  4.            DirectoryContext dc = new
  5. DirectoryContext(DirectoryContextType.DirectoryServer, serverIP,
  6. userName, password);
  7.            ActiveDirectorySchemaProperty prop = new
  8. ActiveDirectorySchemaProperty(dc, cn);
  9.            Guid g = new Guid();
  10.            prop.CommonName = cn;
  11.            prop.Description = "blabla";
  12.            prop.IsDefunct = false;
  13.            prop.IsIndexed = false;
  14.            prop.IsIndexedOverContainer = false;
  15.            prop.IsInGlobalCatalog = true;
  16.            prop.IsSingleValued = true;
  17.            prop.Oid = "1.3.6.1.4.1.28070.9.1.3.45";
  18.            prop.Syntax = ActiveDirectorySyntax.CaseIgnoreString;
  19.            prop.SchemaGuid = g = Guid.NewGuid();
  20.            prop.Save();
  21.        }
  22.  

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

at first and second time, the
System.DirectoryServices.ActiveDirectory.ActiveDir ectoryObjectNotFoundException

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

and then a
System.DirectoryServices.ActiveDirectory.ActiveDir ectoryObjectExistsException
(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_d irectory NG.

Willy.

Mar 25 '07 #2
On 25 Mrz., 10:43, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.bewrote:
"zimmys" <dan...@dessys.dewrote in message

news:11**********************@b75g2000hsg.googlegr oups.com...
hello,
i want to create anewactive directory schema property. for testing,
i use the following simpy function:
Expand|Select|Wrap|Line Numbers
  1.  public void createProperty()
  2.         {
Expand|Select|Wrap|Line Numbers
  1.         
  2.                             string cn = "leo8";
  •  
  •         
  •                             DirectoryContext dc =new
  •  DirectoryContext(DirectoryContextType.DirectoryServer, serverIP,
  •  userName, password);
  •  
  •         
  •                             ActiveDirectorySchemaPropertyprop =new
  • ActiveDirectorySchemaProperty(dc, cn);
  •  
  •         
  •                             Guid g =newGuid();
  •  
  •         
  •                             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.ActiveDir ectoryObjectNotFoundException
    (translated from german) the directoryServer
    'illertec-6hvyin.testdomain.lan' is not avaible or can not contact,
    and then a
    System.DirectoryServices.ActiveDirectory.ActiveDir ectoryObjectExistsException
    (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
    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_d irectory 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

    Mar 26 '07 #3

    This thread has been closed and replies have been disabled. Please start a new discussion.

    Similar topics

    7
    by: dog | last post by:
    I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
    4
    by: I_AM_DON_AND_YOU? | last post by:
    There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
    10
    by: Zack Sessions | last post by:
    Has anyone tried to create a SQL7 view using the CREATE VIEW command and ADO.NET? If so, is there a trick in trapping a SQL error when trying to create the view? I have a VB.NET app that, amoung...
    9
    by: Peter | last post by:
    Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
    37
    by: Steven Bethard | last post by:
    The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
    18
    by: Steven Bethard | last post by:
    I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
    5
    by: Michael | last post by:
    Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
    8
    by: barb | last post by:
    So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
    0
    by: =?Utf-8?B?emltbXlz?= | last post by:
    hello, i want to create a new active directory schema property. for testing, i use the following simpy function: public void createProperty() { string cn = "leo8";
    0
    by: ryjfgjl | last post by:
    In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
    0
    by: emmanuelkatto | last post by:
    Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
    1
    by: nemocccc | last post by:
    hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
    1
    by: Sonnysonu | last post by:
    This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
    0
    marktang
    by: marktang | last post by:
    ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
    0
    by: Hystou | last post by:
    Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
    0
    Oralloy
    by: Oralloy | last post by:
    Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
    0
    jinu1996
    by: jinu1996 | last post by:
    In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
    0
    agi2029
    by: agi2029 | last post by:
    Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

    By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

    To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.