-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hello,
You can accept -ComputerName in Invoke-GMSACommand and then do this so it works locally and remotely:
if("$ComputerName" -eq "$env:computername")
{
[SimpleImpersonation.Impersonation]::RunAsUser(
$SCred,
$LogonType,
[System.Action]{ $Script:CommandOutput = Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $ArgumentList }
)
}
else
{
[SimpleImpersonation.Impersonation]::RunAsUser(
$SCred,
$LogonType,
[System.Action]{ $Script:CommandOutput = Invoke-Command -ComputerName $ComputerName -ScriptBlock $ScriptBlock -ArgumentList $ArgumentList }
)
}
Metadata
Metadata
Assignees
Labels
No labels