Читать книгу Windows Server 2022 & Powershell All-in-One For Dummies - Sara Perrott - Страница 82

SETTING THE COMPUTER NAME FROM POWERSHELL

Оглавление

Although sconfig is a nice utility, you may want to be able to script the changes that you want to make. Whenever this is the case, PowerShell can be very helpful. From running batch scripts in the Command Prompt, to running PowerShell scripts in PowerShell, both methods work regardless of whether you’re on Windows Server Core or Windows Server with Desktop Experience.

1 From the sconfig utility, type 15 to exit to command line (PowerShell).The PowerShell window opens on your Server Core box.

2 Use the Rename-Computer command to change the name of your server: Rename-Computer -NewName <new-name>

3 You get a message stating that the NetBIOS name will be truncated if your name is longer than 15 characters.

4 If you receive this message, type Y and then press Enter to accept.

Windows Server 2022 & Powershell All-in-One For Dummies

Подняться наверх