CmdID

CmdID / PowerShell / Cmdlets / Stop

Stop-Computer

Stops (shuts down) local and remote computers. PowerShell reference

From the PowerShell reference 11 parameters

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Stops (shuts down) local and remote computers. The Stop-Computer cmdlet shuts down the local computer and remote computers. You can use the parameters of Stop-Computer to run the shutdown operations as a background job, to specify the authentication levels and alternate credentials, to limit the concurrent connections that are created to run the command, and to force an immediate shut down. This cmdlet doesn't require PowerShell remoting unless you use the AsJob parameter.

Stop-Computer [-AsJob] [-DcomAuthentication <AuthenticationLevel>] [-WsmanAuthentication <String>] [-Protocol <String>] [[-ComputerName] <String[]>] [[-Credential] <PSCredential>] [-Impersonation <ImpersonationLevel>] [-ThrottleLimit <Int32>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

Shut down the local computer

Stop-Computer -ComputerName localhostIdentify

Shut down two remote computers and the local computer

Stop-Computer -ComputerName "Server01", "Server02", "localhost"Identify

Shut down remote computers as a background job

$j = Stop-Computer -ComputerName "Server01", "Server02" -AsJob $results = $j | Receive-Job $resultsIdentify

Shut down a remote computer

Stop-Computer -ComputerName "Server01" -Impersonation Anonymous -DcomAuthentication PacketIntegrityIdentify

Shut down computers in a domain

$s = Get-Content -Path ./Domain01.txt $c = Get-Credential -Credential Domain01\Admin01 Stop-Computer -ComputerName $s -Force -ThrottleLimit 10 -Credential $cIdentify

Its page in the reference: Stop-Computer.

Parameters

11 in the PowerShell reference
-AsJobIndicates that this cmdlet runs as a background job. To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of the Windows operating system, you must open PowerShell by using the Run as administrator option. For more information, see about_Remote_Requirements. When you specify the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. The job is created on the local computer and the results from remote computers are automatically returned to the local computer. To get the job results, use the Receive-Job cmdlet. For more information about PowerShell background jobs, see about_Jobs and about_Remote_Jobs.
-ComputerNameSpecifies the computers to stop. The default is the local computer. This parameter doesn't rely on PowerShell remoting. You can use the ComputerName parameter even if your computer isn't configured to run remote commands.
-CredentialSpecifies a user account that has permission to do this action. The default is the current user. Credentials are stored in a PSCredential object and the password is stored as a SecureString. NOTE: For more information about SecureString data protection, see How secure is SecureString?.
-DcomAuthenticationSpecifies the authentication level that this cmdlet uses with WMI. Stop-Computer uses WMI. The default value is Packet. The acceptable values for this parameter are: - Default: Windows Authentication. - None: No COM authentication. - Connect: Connect-level COM authentication. - Call: Call-level COM authentication. - Packet: Packet-level COM authentication. - PacketIntegrity: Packet Integrity-level COM authentication. - PacketPrivacy: Packet Privacy-level COM authentication. - Unchanged: Same as the previous command. For more information about the values of this parameter, see AuthenticationLevel.
-ForceForces an immediate shut down of the computer.
-ImpersonationSpecifies the impersonation level to use when this cmdlet calls WMI. The default value is Impersonate. Stop-Computer uses WMI. The acceptable values for this parameter are: - Default: Default impersonation. - Anonymous: Hides the identity of the caller. - Identify: Allows objects to query the credentials of the caller. - Impersonate: Allows objects to use the credentials of the caller.
-ProtocolSpecifies which protocol to use to restart the computers. The acceptable values for this parameter are: WSMan and DCOM. The default value is DCOM. This parameter was introduced in PowerShell 3.0.
-ThrottleLimitSpecifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used. The throttle limit applies only to the current command, not to the session or to the computer.
-WsmanAuthenticationSpecifies the mechanism that is used to authenticate the user credentials when this cmdlet uses the WSMan protocol. The default value is Default. The acceptable values for this parameter are: - Basic - CredSSP - Default - Digest - Kerberos - Negotiate. For more information about the values of this parameter, see AuthenticationMechanism. CAUTION: Credential Security Service Provider (CredSSP) authentication, in which the user credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session. This parameter was introduced in PowerShell 3.0.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet isn't run.