473,545 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

create a new ActiveDirectory SchemaProperty

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.Director yServices.Activ eDirectory.Acti veDirectoryObje ctNotFoundExcep tion

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

and then a
System.Director yServices.Activ eDirectory.Acti veDirectoryObje ctExistsExcepti on
(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 .ActiveDirector yObjectExistsEx ception is called,
but i do not understand why the
ActiveDirectory ObjectNotFoundE xception 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 3183
"zimmys" <da****@dessys. dewrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.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.Director yServices.Activ eDirectory.Acti veDirectoryObje ctNotFoundExcep tion

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

and then a
System.Director yServices.Activ eDirectory.Acti veDirectoryObje ctExistsExcepti on
(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 .ActiveDirector yObjectExistsEx ception is called,
but i do not understand why the
ActiveDirectory ObjectNotFoundE xception 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.publi c.windows.serve r.active_direct ory or
microsoft.publi c.de.german.win dows.server.act ive_directory NG.

Willy.

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

news:11******** **************@ b75g2000hsg.goo glegroups.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.Director yServices.Activ eDirectory.Acti veDirectoryObje ctNotFoundExcep tion
    (translated from german) the directoryServer
    'illertec-6hvyin.testdoma in.lan' is not avaible or can not contact,
    and then a
    System.Director yServices.Activ eDirectory.Acti veDirectoryObje ctExistsExcepti on
    (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 .ActiveDirector yObjectExistsEx ception is called,
    but i do not understand why the
    ActiveDirectory ObjectNotFoundE xception 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.publi c.windows.serve r.active_direct ory or
    microsoft.publi c.de.german.win dows.server.act ive_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

    Mar 26 '07 #3

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

    Similar topics

    7
    8830
    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 want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and...
    4
    4392
    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 shortcut to my program/utility (2) Entry in Windows' Start --> Program Menu. Actually in my VB.Net solution I have two projects (1) MYPROGRAM (2)...
    10
    8778
    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 other things, can create views based on existing tables and a table of column name equivalents. If I accidently introduce a column name equivalent...
    9
    8266
    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 records in the database. Is it possible to create a SQL Server database using vb.net? I know I can use vb.net and ADOX to create a Access database....
    37
    3253
    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 http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html PEP: XXX Title: The create statement
    18
    2686
    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 http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html In this post, I'm especially soliciting review of Carl Banks's point (now discussed under Open Issues)...
    5
    4862
    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 Exchange System Manager is running on the web server and Exchange SP2 has been installed. The IIS site is configured with Basic Authentication and users...
    8
    20336
    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: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create...
    0
    293
    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
    7680
    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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
    0
    7934
    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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
    1
    7446
    by: Hystou | last post by:
    Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
    0
    7778
    tracyyun
    by: tracyyun | last post by:
    Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
    0
    4966
    by: conductexam | last post by:
    I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
    0
    3476
    by: TSSRALBI | last post by:
    Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
    1
    1908
    by: 6302768590 | last post by:
    Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
    1
    1033
    muto222
    by: muto222 | last post by:
    How can i add a mobile payment intergratation into php mysql website.
    0
    731
    bsmnconsultancy
    by: bsmnconsultancy | last post by:
    In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

    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.