473,385 Members | 1,324 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,385 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 3174
"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";
    1
    by: CloudSolutions | last post by:
    Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
    0
    isladogs
    by: isladogs | last post by:
    The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
    0
    by: ryjfgjl | last post by:
    In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
    0
    by: Charles Arthur | last post by:
    How do i turn on java script on a villaon, callus and itel keypad mobile phone
    0
    by: aa123db | last post by:
    Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
    0
    by: ryjfgjl | last post by:
    If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
    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
    0
    BarryA
    by: BarryA | last post by:
    What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

    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.