----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: Vichu Message 3 in Discussion Thanks a lot mrinal.. i will try to work on it and if i find any problems, i will contact u with lot of thanks viswanath -----Original Message----- From: Mrinal [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 5:19 PM To: BDOTNET Subject: Re: Creating active directory user in winnt using asp.net code problem New Message on BDOTNET Creating active directory user in winnt using asp.net code problem Reply Reply to Sender Recommend Message 2 in Discussion From: Mrinal 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 View other groups in this category. ----------------------------------------------------------- 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]
