Hello
This one is (in my head at least) quite simple and straight forward, how come we can't have a powershell component run with administrator permissions on a node with an agent installed?
My request should in theory be quite simple to add, just a checkbox in the powershell component saying "Run as administrator", and then it will do just that.
You should already have code that does just that only requiring minor adjustments, while remote deploying an agent you require the installer to run with administrator elevation to install.
My specific use-case is monitoring a scheduled task that is in a custom folder that requires local admin permissions, but there are many other scenarios where administrator permissions could be required to monitor something.
This request could also be extended to the "Windows Script monitor" and "Linux/Unix Script Monitor" (SUDO instead of administrator obviously)
Edit:
Specifically I mean a powershell session elevated to full administrator permissions, a way to test this is with the script below:
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
write-host "Message:This powershell session does have administrator permissions"
write-host "Statistic:0"
} else {
write-host "Message:This powershell session does NOT have administrator permissions"
write-host "Statistic:100"
}
This will only return with statistic 0 if the powershell session is elevated to administrator permissions.
Top Comments