Windows 7 ESU Activation

Win7 Extended Security Update


Installs/Activates Windows 7 Extended Security Update (ESU) key.
Managed variable should contain 5x5 MAK.
Updates custom field "Win7ESU":
- Year1: successfully activated
- ERROR: tried to activate but failed, likely due to prerequisite KB's not being installed.

Only runs on Win7 SP1 Pro or Ent.
Does not check for prereq KB's to be installed, if script fails, that is likely the cause.
Script should be easy to modify for Year2 and Year3 ESU's.


  • Name: Michael Bell
  • Company: Ontara Corp
  • Website:
  • Contact Developer
  • Summary
  • Windows 7 ESU Activation
  • Version: 1.0
  • Initially Released January 15th, 2020
  • Reviews

    Windows 7 ESU Activation has no reviews.

    Gravatar for Patrick Hefner
    Patrick Hefner about 1 year ago

    I do not understand what to do here. Do I need to enter a new getVariable at the top of the procedure for the MAK? Any help would be appreciated. Thanks!

    Gravatar for Chronis
    Chronis about 1 year ago

    Hi Patrick , 
    I have been using recently this agent procedure and it did take me a little to get it . but it works great. 

    a)make sure you have the product key that you want to deploy

    b)make sure you create a custom field(collumn) and name it Win7ESU

    c)ideally make sure you have the prerequisite win patches pre-installed

    what you need to do is this:

    1. import the agent procedure

    2. then right click on the agent procedure you imported and click on manage variables

    3. on the pop-up window make sure new variable is selected

    4. oposite of it type in WIN7ESU2020key

    5. under set variable paste your win 7 ESU product key

    6. then below it will let you tick which machine/org groups you want to apply this variable to.

    7. once you ticked the boxes you want , click apply . then wait a minute so you can see the product key populated next to the org/machine groups you selected

    8. close the pop-up window

    9.  then select the procedure and run it on a target machine it should populate on the Win7ESU custom field collumn you created Year1 if its successful or Error. Error mainly means one of the win patches arent installed

    let me know if the above was clear enough.

    Gravatar for Patrick Hefner
    Patrick Hefner about 1 year ago

    Yes, that was extremely helpful. I figured out how to add the custom field under AUDIT, and was able to set the Variable per your instruction. However now when I go to run the procedure, it just sits there showing the time it's supposed to run, and it never completes. I wait 15-30 minutes and it never changes. I get no failures or errors on the Last Exec Status column in the Agent procedure window.

    Gravatar for Michael Bell
    Michael Bell about 1 year ago

    Sorry if the installation instructions were not clear. It looks like when posting this, the greater-than/less-than symbols were removed.

    For the procedure to work, two things need to be done in VSA:
    1. Create a new managed variable (Agent Procedures, Schedule / Create, click on any procedure, Manage Variables):
        Select variable: New Variable
        Rename/Create Variable: Win7ESU2020Key
        Variable scope: Public
        Set Variable Value: input product keys and apply to specific org / machine groups
    2. Create a new custom field (Audit, System Information, New Custom Field):
        Name: Win7ESU
        Type: String

    If you edit the procedure before these two settings exist, the variables/fields might not get mapped properly, so you can try removing and re-importing the procedure, or looking at the procedure and making sure it is looking at those variables. 

    The procedure should complete within a few seconds, maybe a few minutes at most. If it's hanging, it is getting past the if/then statements to only run on Win7 Pro/Ent, but might not be executing the vbscript properly. I would try on a few different Win7 machines, and if that doesn't work manually run the vbscript in a live connect command prompt to see what the output is; it might be complaining about the product key format or something?