Exchange Management Console shortcut /runas

Posted on 2014-08-04
Last Modified: 2014-08-11
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"
Question by:stlhost
    LVL 77

    Expert Comment

    by:David Johnson, CD, MVP
    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....
    LVL 2

    Author Comment

    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
    LVL 77

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The Display applet of Windows 7 Control Panel has changed a great deal since Windows XP  (it was missing and more or less replaced in Windows Vista by the Personalization applet.)  Below is a screenshot of what the Display applet of Windows XP, whic…
    One of the features I've come to appreciate about Windows 7 and Windows Server 2008 R2 is the ability to pin applications to the task bar. As useful a feature as I've found this, it does have some quirks.  For example, have you ever tried pinning an…
    This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
    The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now