Powershell script to install and activate ESU for WIndows server 2008

Vikas Jagtap (BSL) 86 Reputation points
2021-05-17T13:30:54.85+00:00

Hello
Need powershell script to install ESU product key and activation ID for windows server 2008. Currently we following below manual process

1) cscript slmgr.vbs /dlv - To check the ESU status
2) slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx - Installtion of product key
3) cscript slmgr.vbs /ato - For activating activation ID.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,271 Reputation points Microsoft Vendor
    2021-05-18T07:16:32.387+00:00

    Hi,

    You can try something like below

    Get-Content -Path C:\ESUScript\computers.txt | ForEach-Object{  
        cscript slmgr.vbs $_ /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx   
        cscript slmgr.vbs $_ /ato   
    }  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,271 Reputation points Microsoft Vendor
    2021-05-18T02:16:50.02+00:00

    Hi,

    You can simply add these lines to your PowerShell script file.

    cscript slmgr.vbs /dlv   
    slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx   
    cscript slmgr.vbs /ato  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.