Invoke-WebRequest RRS feed

  • Question

  • A PowerShell script uses a command like:

    PS C:\> $R = Invoke-WebRequest-URI http://www....

    Il the script is executed by a user member of Administrators $R comtains the reply from the web site.

    If the same script is executed by a user who is not member of Administrators the script does not return $R.

    Is it a normal behavior?

    How can I make non Administrators get the content of R$?



    Friday, February 16, 2018 4:51 PM

All replies

  • Not true.  There is no requirement for a user to be an admin to use that command.  Perhaps the web site is off-limits to that user.


    Friday, February 16, 2018 5:06 PM
  • What errors are being returned when attempting to run as a user?
    Saturday, February 17, 2018 3:56 PM
  • I solved the problem by adding the -UseBasicParsing qualifier.

    Many thanks


    Monday, February 19, 2018 2:42 PM
  • Hi,

    Good to hear that you have solved this issue by yourself. In addition, thanks for sharing your solution in the forum as it would be helpful to anyone who encounters similar issues.

    If there is anything else we can do for you, please feel free to post in the forum.

    Best Regards,

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, February 20, 2018 2:11 AM