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

ACTIVATING FROM POWERSHELL

Оглавление

After you’ve logged into Windows Server Core, you’re presented with the sconfig utility. From there, you can activate your copy of Windows. To set the license and do the activation from the command line, you’ll need to select menu option 15, “Exit to command line (PowerShell)”. To activate, you have to set the key. You do this with the Windows Server License Manager script, slmgr.vbs.

The slmgr.vbs script allows you to work with your Windows Server product keys in different ways depending on the parameter that you use along with it. In the example in this book, I use both -ipk and -ato. The -ipk parameter is used when installing product keys, and the -ato parameter is used to specify online activation.

To install the product key that will be needed for your version of Windows Server 2022, use the following command with the parameter -ipk. Just replace <productkey> with your 25-character license key, including the dashes.

slmgr.vbs -ipk <productkey>

You get a dialog box that tells you the product key installed successfully. Click OK.

After the license key is installed, you use the same script with the -ato parameter to do an online activation of your copy of Windows. You do that with the following command:

slmgr.vbs -ato

If the activation was successful, you get a dialog box that says the product was activated successfully (see Figure 4-3).


FIGURE 4-3: Using slmgr.vbs to activate Windows Server.

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

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