0
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)
}
}
Thank you nohwnd for your answer! I actually already tried the first part in the meanwhile but it didn't work. I will have a look at the second part of your answer and get back to it! – Langhard – 2013-12-05T12:47:25.610
What tool exactly are we talking about? – nohwnd – 2013-12-05T12:56:19.497
The tool is mmc.exe and the console i am trying to open is either the active directory or the gpo console. (dsa.msc / gpmc.msc). Also just to mention, i can run the program with shift-righclick and then enter my domain-admins credentials without problems but i would like to have a powershell script with a menu for other admin-users where they can choose the console they need and get prompted for credentials. – Langhard – 2013-12-05T13:01:32.553