-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Mrinal
Message 2 in Discussion

Hi Vishawanath ,   I can probably solve your problem , as i have done some work in 
.Net and active directory . just for this there's a small code snippet , i am trying 
to post a whole article on active directory in .net written by me that has lot of 
functionalities including this one , but due some problem it's not happening . 
probably u can see in " Software Artifacts " after some time :    
following code adds user 
DirectoryEntry dsuser=null; 
DirectoryEntry cnentry=new 
DirectoryEntry("LDAP://msserver/CN=Users,DC=SEDG,DC=com","administrator","pass",AuthenticationTypes.ServerBind);
 
dsuser=cnentry.Children.Add("CN=" + Username ,"user"); 
dsuser.Properties["sAMAccountName"].Value=Username; 
dsuser.Properties["sn"].Value=Lname; 
dsuser.Properties["givenName"].Value=Fname; 
dsuser.Properties["mail"].Value=Email; 
dsuser.CommitChanges();  
ActiveDs.IADsUser thisnewuser=(ActiveDs.IADsUser)dsuser.NativeObject; 
thisnewuser.AccountDisabled=false; 
thisnewuser.SetPassword(Passwd); 
thisnewuser.SetInfo(); 
dsuser.CommitChanges(); 
dsuser.Properties["userAccountControl"].Value=512; 
dsuser.CommitChanges(); 
dsuser.Close(); 
cnentry.Close(); 
  
Regards , 
Mrinal

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to