26 lines
762 B
PowerShell
26 lines
762 B
PowerShell
##### Fix locally, run as admin (or system)
|
|
|
|
# get current status
|
|
cscript C:\windows\system32\slmgr.vbs -dli
|
|
|
|
# set KMS server and activate
|
|
cscript C:\windows\system32\slmgr.vbs -skms kms.nd.gov
|
|
cscript C:\windows\system32\slmgr.vbs -ato
|
|
|
|
|
|
|
|
##### Fix remotely, will prompt for PRV credentials
|
|
$Credential = Get-Credential -Message "Enter your PRV credentials"
|
|
|
|
# Get current status
|
|
Invoke-Command -Credential $Credential -ComputerName server01,server02,server03 -ScriptBlock {
|
|
cscript C:\windows\system32\slmgr.vbs -dli
|
|
}
|
|
|
|
|
|
# Set KMS server and activate
|
|
Invoke-Command -Credential $Credential -ComputerName server01,server02,server03 -ScriptBlock {
|
|
cscript C:\windows\system32\slmgr.vbs -skms kms.nd.gov
|
|
cscript C:\windows\system32\slmgr.vbs -ato
|
|
}
|