Classic Collection: Use and Example of Network Command Line (7)

xiaoxiao2021-03-06  21

Source: www.net130.com Date: 2005-03-03

Runas

Allow users to run the specified tools and programs with other permissions, not the privileges provided by the user.

grammar

Runas [{/ profile | / noprofile}] [/ env] [/ Netonly] [/ smartcard] [/ showtrustlevels] [/ trustlevel] / user: useeraccountname program

parameter

/ Profile

Load the user's profile. / profile is the default value.

/ no profile

/ noProfile Specifies the configuration file that does not load the user. This makes the application more quickly, but it will also cause errors in some applications.

/ ENV

Specifies the currently used network environment instead of the user's local environment.

/ Netonly

Indicates that the specified user information is only used for remote access.

/ smartcard

/ smartcard indicates whether the credentials are provided by the smart card.

/ showtrustlevels

List / TRUSTLEVEL switch.

/ Trustlevel

Specifies the authorization level where the application is running. Use / Showtrustlevels to view available trust levels.

/ User: useeraccountname

Specifies the name of the user account that runs the program. The format of the user account should be User @ domain or domain / user.

program

Specifies programs or commands to run in the account specified in / user.

/?

Display help at the command prompt.

Comment

Administrators can use a permission-restricted account to perform daily, non-administrative tasks, using a more permissions larger account only when performing a specific management task. To complete such tasks without logging in, you can log in with a general account, then use the runas command to run tools that require greater permissions.

See "Related Topics" for use using the RunAs command.

Although Runs is usually used by Administrator accounts, it is not limited to the Administrator account. Any user with multiple accounts can use the backup credentials, use the RunAs running program, MMC console or "Control Panel" item.

If you want to use the Administrator account on your computer, for / users :, in one of the following parameters:

/ user: administratoralaccountname @ computername

/ user: computername / administratraccountname

If you want to use this command as a domain administrator, type one of the following parameters:

/ user: administratoralaccountname @ domainname

/ useromainname / administratraccountname

The runas command allows you to run programs (* .exe), saved MMC console (* .msc), programs and "Save MMC Console shortcuts and" Control Panel "items. As a member of another group (eg, "Users" or "Power Users" group logs in to the computer, you can run as an administrator.

You can use the runaS command to launch any programs, MMC controllers, or "Control Panel" items. As long as the appropriate user account and password information are provided, the user account has the ability to log in to the computer, and the program, the MMC console, the "Control Panel" item is available in the system and the user account.

The runas command allows you to manage the server of other domains (the computer running the tool and the server to manage in different domains).

If you try to use RunAs from the Network Location Launch Program, the MMC Console, or the Control Panel item, it may fail because the credentials used to connect to the network share are different from the credentials used to start programs. The latter's credentials may not be able to access the same network share.

Some items, such as the "printer" folder and desktop items, open by Windows 2000, and cannot start using the runas command. If the runaS command fails, it may be invalid if the user account that is not running the RunAs service or use. To check the status of the RunAs service, click Services and Applications in Computer Management, and then click Services. To test the user account, try using this account to log in to the appropriate domain.

example

To start the Windows 2000 command prompt line instance as an administrator on the local computer, type:

RunaS / User: localmachinename / administrator cmd

When prompted, type the administrator password.

To launch a Computer Management management unit instance using a domain administrator account called CompanyDomain / DomainAdmin, type:

Runas / User: CompanyDomain / Domainadmin "MMC% WINDIR% / System32 / Compmgmt.msc"

Type your account password when prompted.

To start the Domain Administrator Account User in domain named domain.microsoft.com, type:

RunaS /user: user@domain.microsoft.com "notepad my_file.txt"

Type your account password when prompted.

To launch a command prompt, save the MMC console, control panel item, or an instance of the program to manage other locations, type:

RunaS / Netonly / User: domain / username "command"

Domain / username must be a user with a sufficient authority management server. Type your account password when prompted.

转载请注明原文地址:https://www.9cbs.com/read-42647.html

New Post(0)