Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8001975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:14:18+00:00 2026-06-04T16:14:18+00:00

I have a password reset website for my 0ffice 365 users. It runs powershell

  • 0

I have a password reset website for my 0ffice 365 users. It runs powershell commands in the background to reset user passwords. For some reason when I am using VS and I run the browser with the page it works fine. However when I run it from the live site I get this error

Processing data from remote server failed with the following error message: Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. 

The page is aspx.net with C# code behind.

I have tried using the impersonator class but that does not work either.

Here is some of my code.

 using (new Impersonator("user", "domain", "pass"))
    {

        PSCredential creds = new PSCredential("office365email", "password");

        WSManConnectionInfo connectionInfo = new WSManConnectionInfo(
            new Uri("https://server.outlook.com/PowerShell-LiveID?PSVersion=2.0"),
            "http://schemas.microsoft.com/powershell/Microsoft.Exchange", creds);
        connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic;



        Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo);

        runspace.ApartmentState = System.Threading.ApartmentState.STA;
        runspace.ThreadOptions = PSThreadOptions.UseCurrentThread;

        try
        {


            runspace.Open();


            pipeline = runspace.CreatePipeline();

            Command forwardcommand = new Command("Set-Mailbox");
            forwardcommand.Parameters.Add("Identity", user);
            forwardcommand.Parameters.Add("Password", pass);




            pipeline.Commands.Add(forwardcommand);

            try
            {
                pipeline.Invoke();



                runspace.Close();
                pipeline.Stop();
                return "Password Successfully Changed";



            }
            catch (Exception er)
            {
                runspace.Close();
                pipeline.Stop();

                return er.Message;


            }
        }
        catch (PSRemotingTransportException eer)
        {

            runspace.Close();


            return eer.Message;// "Server busy please try again later";
        }
    }

Any ideas why I can’t do it from the actual website but I can on my local host?

<authentication mode="Windows"/>
    <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">
        <providers>
            <clear/>
            <add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider"/>
            <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/>
        </providers>
    </roleManager>
    <identity impersonate="true"/>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:14:19+00:00Added an answer on June 4, 2026 at 4:14 pm

    This could be a “double-hop” identity / security problem.

    When running on localhost, the Windows identity is known on the same machine.
    When running on the web server, there is at least one more machine involved.

    Relevant questions include: What identity is IIS using to run the web page? Does that ID have permissions to use networking? Does that ID have permissions to execute password-reset on the remote server?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple reset password structure for users to update their existing passwords if
I have a powershell script that will generate an email for users whose password
I have a Password Reset Functionality ,I have to check whether Old and New
I have a simple password reset form that has a username field, and below
I have a Reset Password form being validated by the jQuery Validation plugin. Everything
I have a question regarding my password reset link. So far I have managed
I am implementing a password reset function and would have the key I want
I'm looking to add password-reset functionality to my site and have been browsing the
I have a website where users are going to submit files (pdf, doc, xls).
I have a small community website and I need to implement some sort of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.