Hi, Axel
You would need to 'runas' that user.
ie:
Start-Process -FilePath "powershell.exe" -Verb RunAs
Or https://superuser.com/questions/859242/running-runas-cmd-in-powershell
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am having a hard time to execute commands that need elevated privileges in an Azure runbook on a local Hybrid worker server.
My hybrid worker group is configured to use a custom hybrid worker credential, which is an account member of the local Administrator group of the server.
When I run a simple runbook using the following code :
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
It returns False.
When running the same code using the default hybrid worker credential, or the credentials from the built-in adminsitrator account, it will return True but this is not what I would like.
Is there any way to force a runbook to be launch as elevated on a hybrid worker ?
Thank you in advance for your help.
Axel
Hi, Axel
You would need to 'runas' that user.
ie:
Start-Process -FilePath "powershell.exe" -Verb RunAs
Or https://superuser.com/questions/859242/running-runas-cmd-in-powershell