One or more input parameters are invalid

I have a small app that I created to allow me to reset active directory passwords. I functions perfectly under IIS7, but when I deploy the app to IIS6 I'm having issues.

When I try to reset a password, I get an error "One or more input parameters are invalid"

I have hard coded the username and password in hopes this would help solve the problem, but I'm still getting the error. Any help would be greatly appreciated.

This is the example that I have been following to create the app

Active Directory Account Management


ADMethodsAccountManagement ADMethods = new ADMethodsAccountManagement();

        public string SetSecurePassword()
            RandomPassword rp = new RandomPassword();
            return RandomPassword.Generate(8, 10);

        protected void Button1_Click(object sender, EventArgs e)
         //string sPwd = SetSecurePassword();
            string sPwd = "Password123!";
         UserPrincipal myUser = ADMethods.GetUser("Test1");
         myUser.GivenName = "Given Name";
         myUser.Surname = "Surname";
         myUser.MiddleName = "Middle Name";
         myUser.EmailAddress = "";
         myUser.EmployeeId = "Employee ID";
         lblStatus.Text = "Success";
         lblPassword.Text = sPwd.ToString();

Open in new window

[COMException (0x80005008): One or more input parameters are invalid

[PrincipalOperationException: One or more input parameters are invalid
   System.DirectoryServices.AccountManagement.SDSUtils.SetPassword(DirectoryEntry de, String newPassword) +284
   System.DirectoryServices.AccountManagement.ADStoreCtx.SetPassword(AuthenticablePrincipal p, String newPassword) +76
   System.DirectoryServices.AccountManagement.PasswordInfo.SetPassword(String newPassword) +56
   System.DirectoryServices.AccountManagement.AuthenticablePrincipal.SetPassword(String newPassword) +21
   Email_User.WebForm2.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\testpasswordreset\testpasswordreset\WebForm2.aspx.cs:35
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Open in new window

Who is Participating?
John ClaesSenior .Net Consultant & Technical AnalistCommented:
I'm afraid it has nothing to do with the IE version you're working on.
Everything is Server-Side code so the server is processig the handles.

When you deploy upon a IIS6 machine can you give me the .Net versions installed upon that machine?
And if possible also those the IIS7:
While retreiving those check if .Net 3.5 is installed upon the IIS6 machine (You're coding under 3.5)

poor beggar

If your using store procedure for saving data or any other way.
then check each parameter type is same to value which you are passing.
or number of parameters are same.
brendanlefavreAuthor Commented:
The issue was related to how I was interacting with Active Directory, and the version of IIS. One of my methods needed to be adjusted to working correctly with IIS 6, but when using IIS 7, it functioned correctly
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.