How to create object on extended schema
Hey hai, how r u.
We extended the Active Directory Schema as follow;
Functions (Structural class and it is a top class)
SubFunctionsOne (Structural class, derives from Functions)
ObjectOne (Structural class, derives from SubFunctionsOne)
ObjectTwo (--do--)
SubFunctionsTwo (Structural class, derives from Functions)
ObjectOne (Structural class, derives from SubFunctionsTwo)
ObjectTwo (--do--)
ObjectThree (--do--)
Basically we want to store application related data (which is not going to change in lifetime), in these classes. Here the problem is, how can I can i instantiate the class (creating object) of Functions and other classes.
I created these classes and reloaded that schema, but I can't able to see these classes programmatically (in C#). When I am displaying all the objects, down under my domain (DC=myDomain,DC=com). These classes are not visible. How can i see them programmatically and create objects based on these classes.
Please help, as it is very urgent.
Thanks in advance.
Prasad
[1118 byte] By [
prasad_agv] at [2007-11-19 7:45:49]

# 1 Re: How to create object on extended schema
Have you tried to populate any of the classes & attributes with sample data to make sure that the schema update happened correctly?
Once you have populated a sample of each object class to include all of its attributes, check to see if you still have issues querying for the classes.
# 2 Re: How to create object on extended schema
Hi f1shrman,
Thank you very much for your reply.
I can able to see the classes what I created using the path, LDAP://CN=Schema,CN=Configuration,DC=myDomain,DC=com. But how can i instantiate this class using C#, please help me.
Suppose if i want to create a new user, I will be using LDAP://CN=Users,DC=myDomain,DC=com path, and the code look like this,
DirectoryEntry dEntry = new DirectoryEntry(strPath);
DirectoryEntry dEntryChild = dEntry.Children.Add("CN=f1shrman", "user");
dEntryChild.Properties["givenname"].Add("testuser");
dEntryChild.Proper..............................
..................................................
dEntryChild.CommitChanges();
With above code a user is get created with name "f1shrman". Here we are using "CN=Users" and at "dEntry.Children.Add("CN=Tim", "user");", we are saying to user "user" class (which is already defined).
Now take the same example, here the problem is what to use at "CN=Users" place in my situation. Please help, I tried in different ways, but it is not working.
Waiting for your reply.
Prasad
# 3 Re: How to create object on extended schema
LDAP://CN=Users,DC=myDomain,DC=com path, and the code look like this,
DirectoryEntry dEntry = new DirectoryEntry(strPath);
DirectoryEntry dEntryChild = dEntry.Children.Add("CN=f1shrman", "user");
Now take the same example, here the problem is what to use at "CN=Users" place in my situation. Please help, I tried in different ways, but it is not working.
Try the following and let me know if it works.
Create a new organizationalUnit (OU) under dc=mydomain,dc=com
Change strpath to ou=<name of ou you created>,dc=mydomain,dc=com
Change dEntry.Children.Add("CN=f1shrman", "user"); to dEntry.Children.Add("CN=testClass", "ObjectOne");
Set all your manadatory attributes for ObjectOne class
HTH