Activate windows from commandline as non admin RRS feed

  • Question

  • Hi all

    Im looking to script the activation of windows.   The command is set to run under the domain admin context

    in theroy below should work as all other commands ran with psexec in the same fashion do work!

    I need to activate windows under the admin context

    1st line does set the proxy server for the domain as the ouput is correct

    2nd line tries to automatically activate windows with the installed product key

    3rd line enters the product key and I try the 2nd line to automatically activate again

    Does not work reliably I cant see why,  Can anyone spot what I cant see?

    Psexec -u domain\admin -p admin-pass-w c:\scripts /accepteula cmd /c "netsh winhttp set proxy"

    Psexec -u domain\admin -p admin-pass -w c:\windows\system32 cmd /c "cscript Slmgr.vbs /ato

    Psexec -u domain\admin -p admin-pass -w c:\scripts cmd /c  "cscript //b "c:\windows\system32\slmgr.vbs /ipk the-correct-license-key"

    Thanks for reading



    • Moved by Bill_Stewart Tuesday, April 7, 2015 3:02 PM Poor quality question/shows no research effort
    Friday, February 20, 2015 9:54 PM

All replies

  • It doesn't make sense to do this remotely.  You can use a central license server in a domain and it will register and activate all systems in the domain. Using a remote script does not make sense and I suspect Microsoft does not allow this.  You can call the licensing center for free and see what they have to say.

    Another issue would be the need to connect to a third location which would be a security violation.  The other two commands do not require a third connection so they would work.

    Also your syntax is incorrect:

    Slmgr.vbs /ato <license ID>

    Also note this:

    Usage: slmgr.vbs [MachineName [User Password]] [<Option>]
               MachineName: Name of remote machine (default is local machine)
               User:        Account with required privilege on remote machine
               Password:    password for the previous account


    Friday, February 20, 2015 11:03 PM
  • Hi

    I se how you would interpret this upon seeing psexec

    Im not trying to do this remotely Im actually using psexec against the local machine -w  pointing to a local directory.

    The only reason Im using psexec is because it has the abilty to run a command line in an alternate context in this case as the domain admin and pass the admin password without prompting for the same.

    I have used another command line tool to try and acomplish this but no joy.

    In theroy the command sould work as it is running as a domain admin with the correct proxy settings but it dosent?


    Saturday, February 21, 2015 3:25 PM