![]() ![]() Restart-Computer -ComputerName $Names -Credential $Creds -Forceĭomain01.txt. $Names = Get-Content -Path C:\Domain01.txt TheĬomputer names from the text file are stored in a variable. This example forces an immediate restart of the computers listed in the Domain01.txt file. Example 4: Force restart of computers listed in a text file The computer names are sent down the pipeline. Get-Content uses the Path parameter to get a list of computer names from a text file,ĭomain01.txt. ![]() Get-Content -Path C:\Domain01.txt | Restart-Computer But because it's the first position parameter, itĪccepts the computer names from the text file that are sent down the pipeline. TheĬomputerName parameter isn't specified. Restart-Computer gets a list of computer names from a text file and restarts the computers. Restart-Computer -ComputerName Server01, Server02, localhost Example 3: Get computer names from a text file The ComputerName parameter accepts anĪrray of computer names. Restart-Computer can restart remote and local computers. Restart-Computer Example 2: Restart multiple computers Restart-Computer restarts the local computer. Examples Example 1: Restart the local computer This feature makes it practical to use Restart-Computer in Specify a waiting time-out and query interval, and wait for particular services to beĪvailable on the restarted computer. FORCE RESTART DOMAIN COMPUTER WINDOWSStarting in Windows PowerShell 3.0, you can wait for the restart to complete before you run the nextĬommand. You can use the parameters of Restart-Computer to run the restart operations, to specify theĪuthentication levels and alternate credentials, to limit the operations that run at the same time, ![]() The Restart-Computer cmdlet restarts the operating system on the local and remote computers. This cmdlet is only available on the Windows platform. Restarts the operating system on local and remote computers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |