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"
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.