Udostępnij za pośrednictwem


Using Run as

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Using Run as

Logging onto your computer using administrative credentials can pose a security risk to your computer and network. Therefore, as a security best practice, it is recommended that you do not log on to your computer with administrative credentials. Instead, you can use Run as to accomplish administrative tasks without having to log on to your computer with administrative credentials. For information about the security risks associated with being logged on as an administrator, see Why you should not run your computer as an administrator.

Using Run as, you can open and run a program using a different account and security context than the one you are logged on with. So, you can log on using a regular user account, then, using Run as, open an administrative program in the context of an administrative account. The administrative context is only used for that specific program and is only available until that program is closed.

It is especially important for domain administrators to use Run as to accomplish administrative tasks. Running your computer as a domain administrator in Active Directory makes your domain (and forest) vulnerable to Trojan horses and other security risks that target the logon sequence.

You can use Run as through the user interface or as a command-line tool.

  • User interface

    The Run as feature built into the user interface is a shortcut that is accessed on the right-click menu for some programs (.exe), some Control Panel (.cpl) items, and Microsoft Management Console (MMC) (.msc) consoles. Run as will prompt you for a user account and password before starting a program, Control Panel item, or MMC console. Some programs and administrative tasks, such as upgrading the operating system or configuring system parameters, do not support Run as. These tasks require an interactive logon. For more information about how to use the Run as feature, see Run a program with administrative credentials.

  • Command-line tool

    In addition to the built-in Run as feature, the runas command provides the same capabilities. For more information about the runas command, see Runas. You can also create a custom shortcut using the runas command. For more information about creating shortcuts, see Create a shortcut using the runas command.