IT Process Automation

 View Only
  • 1.  How to run powershell script in elevated mode i.e. "Run as administrator"

    Posted Jul 06, 2017 07:55 AM

    Hi Team,

    I have to perform a task using powershell script. But the requirement is that I have to run it in elevated mode "Run as administrator". While trying to run the powershell script using "Run Script" operator, I am getting the error "Access Denied". While running the script manually without elevated mode, I am getting the same error "Access Denied" but on running the script on elevated mode manually runs successfully.

    Kindly let me know how to run the script in elevated mode of Powershell.

     

    Thanks

    Ankur Gupta

    ankgupta4@gmail.com



  • 2.  Re: How to run powershell script in elevated mode i.e. "Run as administrator"
    Best Answer

    Broadcom Employee
    Posted Jul 06, 2017 08:28 AM

    Looks like you just add '-verb runas' to the script you are executing:

    https://stackoverflow.com/questions/7690994/powershell-running-a-command-as-administrator



  • 3.  RE: Re: How to run powershell script in elevated mode i.e. "Run as administrator"

    Posted Jul 03, 2020 11:09 AM

    Hi @Michael Niebuhr,

    I have an administration user and I'm running the follow script:

    Type: PS1
    Script: hostname -Verb runAs​
    Username: "PTPORTUGAL\\userpam"

    And I get the follow error message:
    cannot create process as user PTPORTUGAL\userpam - Access is denied.

    Do you have any tip about what is the problem?

    Regards,
    Sérgio Castro

    ​​


  • 4.  RE: Re: How to run powershell script in elevated mode i.e. "Run as administrator"

    Broadcom Employee
    Posted Jul 06, 2020 09:34 AM

    The error is a OS related permissions error, here is a knowledge document that hopefully will help you get past this:

    https://knowledge.broadcom.com/external/article/121511