Restart a computer from a domain controller using PowerShell

Configurare noua (How To)

Situatie

To restart a computer from a domain controller using PowerShell, you can utilize the “Restart-Computer” cmdlet with the “-ComputerName” parameter.

Solutie

First, ensure you have the necessary permissions on the domain controller to restart computers remotely.

  • Open PowerShell as an administrator on the domain controller.
  • Use the following command to restart a specific computer from the domain controller:

Restart-Computer -ComputerName “ComputerName” -Force

  • Replace “ComputerName” with the name of the computer you want to restart. For example:

Restart-Computer -ComputerName “PC01” -Force

  • If you want to restart multiple computers, you can provide a list of computer names:

Restart-Computer -ComputerName “PC01”, “PC02”, “PC03” -Force

  • The -Force parameter will force the restart without prompting for confirmation. Make sure to replace “PC01”, “PC02”, etc., with the actual names of the computers you want to restart.
  • If you need to restart all computers in an Active Directory organizational unit (OU), you can use the following:

Get-ADComputer -Filter * -SearchBase “OU=Computers,DC=YourDomain,DC=com” | Restart-Computer -Force

  • This command gets all computers in the specified OU and then restarts each of them forcefully.

Please exercise caution when using the -Force parameter, as it will force a restart without any warning or user interaction. Make sure you have the appropriate permissions and that restarting the computers will not disrupt any critical operations.

Tip solutie

Permanent

Voteaza

(3 din 5 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?