Impersonate Windows built-in SYSTEM account.
Impersonate Windows built-in SYSTEM account and execute commands on its behalf by invoking a scriptblock.
Note: Requires to be run as Administrator
.
Install from PowerShell Gallery
Install-Module -Name ImpersonateSystem
or
git clone https://github.com/tobiohlala/ImpersonateSystem
Import-Module ImpersonateSystem
Invoke-AsSystem { [System.Environment]::UserName }
Get-Help Invoke-AsSystem -Examples