Preferred License Server WMI Scripts




Download 0,83 Mb.
bet34/37
Sana30.03.2021
Hajmi0,83 Mb.
#13798
1   ...   29   30   31   32   33   34   35   36   37

Preferred License Server WMI Scripts


Use the following WMI script to set a preferred license server:

AddLicenseServer.vbs

'***************************************************************************

'

' WMI VBscript to add a specified License server to Terminal server's registry



'

'***************************************************************************

if Wscript.arguments.count<1 then
Wscript.echo "Script requires one argument, the LicenseServerName"

Wscript.echo "e.g. cscript AddLicenseServer LicenseServerName"

Wscript.quit

end if
Dim strServer

strServer=Wscript.arguments.Item(0)
for each terminal in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_TerminalServiceSetting")
result = terminal.AddDirectConnectLicenseServer (strServer)
WScript.Echo "Method returned result = " & result
if err <>0 then

WScript.Echo Err.Description, "0x" & Hex(Err.Number)

end if

next


Use the following WMI script to delete preferred license servers:


Download 0,83 Mb.
1   ...   29   30   31   32   33   34   35   36   37




Download 0,83 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa



Preferred License Server WMI Scripts

Download 0,83 Mb.