• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 955
  • Last Modified:

Exchange Management Console shortcut /runas

So I installed the management console to my local desktop and I want to create a shortcut to my desktop that will run it as the domain administrator. As many ways as I try it, it doesn't save the log in or it gives me an error saying C:\program not found. The actual location is "C:\Program Files\Microsoft\Exchange Server\V14\Bin\Exchange Management Console.msc"
  • 2
1 Solution
David Johnson, CD, MVPOwnerCommented:
runas /user:dimainadmin "C:\Program Files\Microsoft\Exchange Server\V14\Bin\Exchange Management Console.msc"

Open in new window

you forgot to encapsulate it all in quotes otherwise the space between program and files makes the system believe that you want to run c:\program with the values of "files\microsoft....
stlhostAuthor Commented:
How do I get it to save the credentials though? Placing the /savecred after the username I get an -2147467259: Unspecified error. If I place it before /user I get the runas usage help
David Johnson, CD, MVPOwnerCommented:
you can't save the credentials this way

here is a powershell way
# source unknown
$AdminName = Read-Host "Enter your Admin AD username"
$CredsFile = "C:\$AdminName-PowershellCreds.txt"
$FileExists = Test-Path $CredsFile
if  ($FileExists -eq $false) {
    Write-Host 'Credential file not found. Enter your password:' -ForegroundColor Red
    Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File $CredsFile
    $password = get-content $CredsFile | convertto-securestring
    $Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist domain\$AdminName,$password
    Write-Output 'Using your stored credential file' -ForegroundColor Green
    $password = get-content $CredsFile | convertto-securestring
    $Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist domain\$AdminName,$password}
    sleep 2
    Write-Output 'Connecting to Exchange MMC'
    start-process "C:\Program Files\Microsoft\Exchange Server\V14\Bin\Exchange Management Console.msc" -Credential $Cred -ErrorAction Stop | out-Null

Open in new window


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now