Function Rename-Computer( $NewName,$AutoRestart=$false ) { $computer=Get-WMIObject Win32_ComputerSystem $computer.Rename( $NewName ) | out-null if($AutoRestart) { Restart-Computer -Force } }
from:http://www.pstips.net/powershell-rename-computer.html
时间: 2024-10-17 21:19:59