What I try to accomplish is running some RSAT Tools out of a Powershell-Script as another user (Domain-Admin).
Here is my run code:
Start-Process -FilePath "C:\Windows\system32\mmc.exe" -ArgumentList "C:\Windows\system32\gpmc.msc" -Credential (Get-Credential -Credential MYDOMAIN\myadminuser)
And what I get is an error which says: this command can only be initiated with elevated privileges. Now that tells me that I had to run the script using an admin-user becaus of UAC limitations, which is exactly not what I try to accomplish.
Has anybody a helping input for me?
Thanks!
EDIT
To make it more clear I attached the whole script.
$title = "Windows 8.1 RSAT Tools"
$message = "Verwaltungskonsole"
$ad = New-Object System.Management.Automation.Host.ChoiceDescription "&AD Verwaltung", `
"Active Directory-Benutzer und -Computer"
$gpo = New-Object System.Management.Automation.Host.ChoiceDescription "&GPO Verwaltung", `
"Gruppenrichtlinienverwaltung"
$options = [System.Management.Automation.Host.ChoiceDescription[]]($ad, $gpo)
$result = $host.ui.PromptForChoice($title, $message, $options, 0)
switch ($result)
{
0
{
Start-Process -Verb RunAs -FilePath "C:\windows\system32\mmc.exe" -ArgumentList "C:\windows\system32\dsa.msc" -Credential (Get-Credential -Credential MYDOMAIN\myadminuser)
}
1
{
Start-Process -Verb RunAs -FilePath "C:\windows\system32\mmc.exe" -ArgumentList "C:\windows\system32\gpmc.msc" -Credential (Get-Credential -Credential MYDOMAIN\myadminuser)
}
}