Quantcast
Channel: Setup Deployment forum
Viewing all articles
Browse latest Browse all 2818

How do I active multple workstations with key using powershell

$
0
0

Must activate multiple workstations from windows 10 pro to 10 Enterprise.

I have the key and trying to update all computers with the key instead of going to one machine at a time.

I want to be able to use PowerShell to complete this task. if there is another way Ill try that also. 

WHEN I RUN THIS SCRIPT:


PS > "Set-ExecutionPolicy unrestricted"
$service= get-wmiObject -query "select * from SoftwareLicensingService" -computername CN
$sls= Get-WmiObject -query 'SELECT * FROM SoftwareLicensingService' -computername CN
$service. InstallProductKey("KEY");
$service. RefreshLicenseStatus();
Set-ExecutionPolicy unrestricted

THIS IS MY ERROR BELOW:


get-wmiObject : The RPC server is unavailable.
At line:2 char:11
+ $service= get-wmiObject -query "select * from SoftwareLicensingServic ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], COMException
    + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
 
Get-WmiObject : The RPC server is unavailable.
At line:3 char:7
+ $sls= Get-WmiObject -query 'SELECT * FROM SoftwareLicensingService' - ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], COMException
    + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
 
You cannot call a method on a null-valued expression.
At line:4 char:1
+ $service. InstallProductKey("JX4J4-HVNBY-3XVCW-X44X4-JHV2F");
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
You cannot call a method on a null-valued expression.
At line:5 char:1
+ $service. RefreshLicenseStatus();
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

 

armstead wilkins


Viewing all articles
Browse latest Browse all 2818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>