Link to home
Start Free TrialLog in
Avatar of brendanlefavre
brendanlefavreFlag for United States of America

asked on

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

Cheers,
Brendan


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 = "test1@test.com";
         myUser.EmployeeId = "Employee ID";
         myUser.SetPassword(sPwd);
         myUser.Save();
         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

ASKER CERTIFIED SOLUTION
Avatar of John Claes
John Claes
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nidheeshmca
nidheeshmca


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.
Avatar of brendanlefavre

ASKER

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