Activating Windows Server 2003

Using a graphical user interface

  1. From the Start menu, select All Programs > Activate Windows.
  2. Select whether you want to activate by phone or over the Internet.


Using a command-line interface

The following command opens the Activation wizard described in the previous section:

> %systemroot%\system32\oobe\msoobe /a

There are no options that can activate the computer silently from the command line.

Using VBScript

' This code activates a Windows Server 2003 system.

' ------ SCRIPT CONFIGURATION ------

strComputer = "."boolActivateOnline = True  ' If this is true, boolActivateOffline should

                           ' be false

boolActivateOffline = False ' If this is true, boolActivateOnline should

                            ' be false

strOfflineConfirmationCode = "1234-5678" ' if Activating offline, you need

                                         ' specify a confirmation code

' ------ END CONFIGURATION ---------

set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

set colWPA = objWMI.InstancesOf("Win32_WindowsProductActivation")

for each objWPA in colWPA

   WScript.Echo "Activation Settings:"

   Wscript.Echo "  Activation Required: " & objWPA.ActivationRequired

   Wscript.Echo "  Caption: " & objWPA.Caption

   Wscript.Echo "  Description: " & objWPA.Description

   Wscript.Echo "  Notification On: " & objWPA.IsNotificationOn

   Wscript.Echo "  Product ID: " & objWPA.ProductID

   Wscript.Echo "  Remaining Eval Period: " & objWPA.RemainingEvaluationPeriod

   Wscript.Echo "  Remaining Grace Period: " & objWPA.RemainingGracePeriod

   Wscript.Echo "  Server Name: " & objWPA.ServerName

   Wscript.Echo "  Setting ID: " & objWPA.SettingID

   WScript.Echo

if objWPA.ActivationRequired = True then

      if boolActivateOnline = True then

         intRC = objWPA.ActivateOnline

         if intRC <> 0 then

            WScript.Echo "Error activating online: " & intRC

         else

            WScript.Echo "Successfully activated online"

         end if

      end if

if boolActivateOffline = True then

         intRC = objWPA.ActivateOffline(strOfflineConfirmationCode)

         if intRC <> 0 then

            WScript.Echo "Error activating offline: " & intRC

         else

            WScript.Echo "Successfully activated offline"

         end if

      end if

   end if

next

You can run an unactivated copy of Windows for up to 30 days before you must activate it to use the system further. Over those 30 days, you are periodically reminded to activate Windows via a pop-up window from the system tray. The longer you wait the more frequent these notifications become. And they can be down right aggravating if you don’t plan to activate the system for a number of days. Fortunately, you can disable these notifications. Here is a small script that does it:

strComputer = "."

set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

set colWPA = objWMI.InstancesOf("Win32_WindowsProductActivation")

for each objWPA in colWPA

   objWPA.SetNotification(0)

next

Just don’t forget that you still need to activate the system!