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

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: asalvi
Message 1 in Discussion

hi guys,   I am developing some applicaion in which i am trying to access 
ADIS........(Active directory)   I am trying  to set password for users in 
windows.....previously code was running fine.but suddenly IIS gave error .unhadled 
exception occurd...   now the code is not working........   It gives following 
error... 
................................................................................................
 Description: An unhandled exception occurred during the execution of the current web 
request. Please review the stack trace for more information about the error and where 
it originated in the code. 

Exception Details: System.UnauthorizedAccessException: General access denied error 

The ASP.NET process is not authorized to access the requested resource. For security 
reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has 
limited privileges. Consider granting access rights to the resource to the ASP.NET 
process identity. 

To grant ASP.NET write access to a file, right-click the file in Explorer, choose 
"Properties" and select the Security tab. Click "Add" to add the 
"{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in 
the Allow column.
   ............................ my code is.............  
String strUName = Environment.UserName; 
strUName = txtUserName.Text; 
String strOldPassword = txtOldPassword.Text; 
String strNewPass = txtNewPassword.Text; 
using(DirectoryEntry de = new DirectoryEntry()) 
{ 
string strDomain = Environment.MachineName; 
de.Path = ("WinNT://"+ strDomain+ ",Computer"); 
DirectoryEntries entries = de.Children; 
DirectoryEntry obUser = entries.Find(strUName,"User"); 
object obRet=obUser.Invoke("SetPassword",strNewPass); 
obUser.CommitChanges();

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

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_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