
One of the annoyances of dealing with industrial software is the licensing. Even though software vendors should obtain payment for their work, it’s always been a essential evil in the IT sector. Windows is no dissimilar. Anyone who’s use Windows before knows about the invention key (Product Key). It’s that long string of lettering separated by dashes and hyphens that we often search emails, MSDN and other resources for when we do not remember which one to employ.
Usually, you input the product key a numeral of altered ways when installing Windows but can also modify it after the fact. As you can now install Windows without using a product key, a lot of peoples are figuring out how to get a applicable product key to input into Windows to avoid those imitation messages from pop up all the time. For customers, inserting a unique product key isn’t a big task or deal, but for IT professionals and experts, managing thousands of Windows machines simultaneously, it’s not quite that simple.
If an IT professional expert requires adding or changing a product key on all his Windows systems, there are so many tools like the VAMT (Volume Activation Tool) or he can do it via the command prompt line. One may prefer to use the command process when altering the product key as a section of a bigger orchestration script possibly or find it’s faster than bring up a graphics user interface tool.
Since I’m considering most IT professionals will not do much close by on a system, we are going to spotlight on how to accomplish this remotely across many systems at one time. To do that, a couple of ideas are there. One process is to make the use of slmgr.vbs script that comes on all Windows apparatus XP/2008 and advanced. Otherwise, WMI can complete this. Either moves towards should get the job finished.
Let us first cover up by using the slmgr.vbs script. Since this script does not have the intrinsic potential to install on a remote system, we will use Power Shell remoting here. Though, to make the use this technique, each objective system must have Power Shell already installed and Power Shell remoting enabled and easy to get to. Verify this by running a simple command on each computer system.
Invoke-Command -SyetemName SOMECOMPUTER -ScriptBlock {1}
If this proceeds to 1, then it’s working fine. Otherwise, if any mistake text prompts, further examination is in order.
Once you have established that Power Shell remoting is accessible on each computer system, you will then necessitate finding out how to recover each computer system’s name. You may have done this previously in the action above. If not, ordinary ways comprise grabbing computer system names from text records with Get-Content using the Path factor when one system exists on each line in a text folder.
$computers = Get-Content -Path C:\systems.txt
Another ordinary way to recover computer system names is through the Get-ADSystem cmdlet accessible in the Active Directory module (ADM).
$computers = Get-ADSystem -Filter * | Select-Object –Expand Property Name
Despite, you will simply require to creating a compilation of system names in one way or another. Here, We will just physically describe the list.
$Systems = 'System1','System2','System3','System4','System5'
After completing this, you have to find out the syntax to call upon slmgr.vbs. Fortunately, this is quite simple and easy.
slmgr -ipk <ProductKeyValueHere>
Next, we will use Invoke Command once more and forward this command to each system all in one line.
Invoke Command -SystemName $systems -ScriptBlock { slmgr -ipk <ProductKeyValueHere> }
This will run on each system and alter the product key for each one. If this successful, a warning or notification message on each computer system will display.
Change product key
If Power Shell remoting is not obtainable on your computer systems for safety reasons or simply is not enable yet, you can also make the use of Windows Management Instrumentation (WMI). To do this, you can employ the Get WMI Object command. Since this command also has the capability to intention multiple computer systems, you can do this by provide the system list as an squabble to the SystemName constraint and by invoking a couple of WMI processes.
$sls = Get-WMI Object -Query 'SELECT * FROM Software Licensing Service' -SystemName $systems
This command will reach out to each remote system in the $system collection via DCOM and queries the WMI ordnance of each system.
1 Finally, call a group of methods to complete the job.
2@($sls).foreach({
3 $_.InstallProductKey(<ProductKeyValueHere>)
4 $_.RefreshLicenseStatus()
5 })
The loop above reads each example of WMI returned from Get-WMI Object called before and primarily invokes the InstallProductKey() process. This alters the product key but does not pertain it. To pertain the product key value, it then calls to RefreshLicenseStatus(). This allows Windows to be familiar with the new product key value.
That’s all there is to transform a product key on one, or a hundred systems in a short time! By using Power Shell, after defining the procedure for a particular computer system, increasing it to many others is a inconsequential task.