OK, this is not exactly what I recommend doing unless you are trying to lose your job. This is an actual question from one of my PowerShell classes. SO, here it is, but use at your own risk.
Again, this is not recommended.
Import-Module ActiveDirectory $HostName = hostname Get-ADComputer -filter 'Name -ne $HostName' | Select-Object @{Label="ComputerName";Expression={$_.Name}} | Restart-Computer –Force
Again, this is not recommended.
Comments