This is the built-in help made by Microsoft for the command 'Restart-Computer', in PowerShell version 2 - as retrieved from
Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.
For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.
Restarts ("reboots") the operating system on local and remote computers.
Restart-Computer [[-ComputerName] <string[]>] [[-Credential] <PSCredential>] [-AsJob] [-Authentication {Default | None | Connect | Call | Packet
| PacketIntegrity | PacketPrivacy | Unchanged}] [-Force] [-Impersonation {Default | Anonymous | Identify | Impersonate | Delegate}] [-ThrottleLim
it <int>] [-Confirm] [-WhatIf] [<CommonParameters>]
The Restart-Computer cmdlet restarts the operating system on the local and remote computers.
You can use the parameters of Restart-Computer to run the restart operations as a background job, to specify the authentication levels and altern
ate credentials, to limit the operations that run concurrently, and to force an immediate restart.
This cmdlet does not require Windows PowerShell remoting unless you use the AsJob parameter.
<
Online version: http://go.microsoft.com/fwlink/?LinkID=135253
Add-Computer
Checkpoint-Computer
Remove-Computer
Restore-Computer
Stop-Computer
Test-Connection
<
-------------------------- EXAMPLE 1 --------------------------
C:\PS>restart-computer
Description
-----------
This command restarts the local computer.
-------------------------- EXAMPLE 2 --------------------------
C:\PS>restart-computer -computername Server01, Server02, localhost
Description
-----------
This command restarts two remote computers, Server01 and Server02, and the local computer, identified as "localhost".
-------------------------- EXAMPLE 3 --------------------------
C:\PS>$j = restart-computer -computername Server01, Server02 -asjob
C:\PS> $results = $j | receive-job
C:\PS> $results
Description
-----------
These commands run a Restart-Computer command as a background job on two remote computers, and then get the results.
The first command uses the AsJob parameter to run the command as a background job. The command saves the resulting job object in the $j variable.
The second command uses a pipeline operator to send the job object in $j to the Receive-Job cmdlet, which gets the job results. The command saves
the results in the $results variable.
The third command displays the result saved in the $results variable.
Because the AsJob parameter creates the job on the local computer and automatically returns the results to the local computer, you can run the Re
ceive-Job command as a local command.
-------------------------- EXAMPLE 4 --------------------------
C:\PS>restart-computer -comp Server01 -impersonation anonymous -authentication PacketIntegrity
Description
-----------
This command restarts the Server01 remote computer. The command uses customized impersonation and authentication settings.
-------------------------- EXAMPLE 5 --------------------------
C:\PS>$s = get-content domain01.txt
C:\PS> $c = get-credential domain01\admin01
C:\PS> restart-computer -computername $s -force -throttlelimit 10 -credential $c
Description
-----------
These commands force an immediate restart of all of the computers in Domain01.
The first command gets a list of computers in the domain and saves it in the $s variable.
The second command gets the credentials of a domain administrator and saves them in the $c variable.
The third command restarts the computers. It uses the ComputerName parameter to submit the list of computers in the $s variable, the Force parame
ter to force an immediate restart, and the Credential parameter to submit the credentials saved in the $c variable. It also uses the ThrottleLimi
t parameter to limit the command to 10 concurrent connections.