Hi,
within a software component I need to run a setup.exe as a service account.
For some reason I get a "access denied" error whatever I try.
So I simplified it to avoid other factors and just try to run a "whoami | out-file c:\temp\who.log" as a different users. Still failing.
what I do:
$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential "$domain\$account", $securePassword
start-job -ScriptBlock {whoami | out-file c:\temp\who.log} -Credential $credential | wait-job
I also tried start-process ..... -credential ....
with same result.
UAC is disabled via registry.
Any help would be highly appreciated.
Thanks
Andre