Posted September 4, 20232 yr Deze script werkt als het gerunt is van een user account maar niet vanuit pulseway. $password = ConvertTo-SecureString "your_password" -AsPlainText -Force $credentials = New-Object System.Management.Automation.PSCredential("your_username", $password) $scriptBlock = { Start-Process powershell -Verb RunAs Write-Host "Running with elevated privileges!" } $encodedCommand = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptBlock)) Start-Process powershell.exe -ArgumentList "-NoProfile -EncodedCommand $encodedCommand" -Credential $credentials
September 4, 20232 yr Administrators Hi Cezar, Try running the above script in workflows as an execute shell command as there you get the access to run as a user or on a system level Thanks, Stefan
Deze script werkt als het gerunt is van een user account maar niet vanuit pulseway.
$password = ConvertTo-SecureString "your_password" -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential("your_username", $password)
$scriptBlock = {
Start-Process powershell -Verb RunAs
Write-Host "Running with elevated privileges!"
}
$encodedCommand = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptBlock))
Start-Process powershell.exe -ArgumentList "-NoProfile -EncodedCommand $encodedCommand" -Credential $credentials