Ok, in our environment standard users are blocked from running PowerShell. What I want to do is deploy a windows upgrade via a task sequence in sccm. Then then run a scheduled task to trigger this task sequence every day at login until they have upgraded their system. If I run an admin PowerShell session and run the below code the task sequence runs. But as the users do not have the rights to run PowerShell I cant use this.
$UI = New-Object -ComObject “UIResource.UIResourceMgr”
$ProgramID = “*”
$PackageID = “PACKAGEID”
$UI.ExecuteProgram($ProgramID, $PackageID, $true)
If in the scheduled task I try and use ServiceUI.exe -process:explorer.exe “c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe” -Executionpolicy bypass -file “my powershell script” it does not work but ran as an admin account it does. It would appear that UIResource.UIResourceMgr does not like being run in the system context… Any ideas I can activate a task sequence running as system ?