1

I need to execute some PowerShell stuff and this only works if I execute this when the Powershell is open with administrator privilege

But, I need to run this through WinRM

And I'm not finding a way to handle this

Additional information:

Powershell 5.1

The python application is not running on this Windows Server

And I have tried this but didn't work for me / in this case

I'm using https://github.com/diyan/pywinrm

Guilherme
  • 1,705
  • 1
  • 25
  • 45
  • 1
    I have no idea if this will work with `PyWinRM` (I've never used that), but one thing to consider is the use of [Constrained Endpoints](https://devblogs.microsoft.com/scripting/introduction-to-powershell-endpoints/). These are typically used to limit the available commands for remote users, but, more pertinent for you, also allow the commands to automatically run with alternative credentials - so, a normal domain user could connect and execute commands as a domain admin without needing to know the credentials of the elevated account. – boxdog Jul 30 '20 at 09:26

0 Answers0