• QueryLicenseServers.vbs
  • Published: May 2003 Updated: May 2005




    Download 0,83 Mb.
    bet35/37
    Sana30.03.2021
    Hajmi0,83 Mb.
    #13798
    1   ...   29   30   31   32   33   34   35   36   37
    DeleteLicenseServer.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 DeleteLicenseServer 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.DeleteDirectConnectLicenseServer (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 query preferred license server settings:

    QueryLicenseServers.vbs
    '***************************************************************************

    '

    ' WMI VBScript that queries the License servers configured for registry bypass.



    '

    ' on the Terminal server

    '

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



    for each Terminal in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_TerminalServiceSetting")

    WScript.Echo "The License Servers are = " & Terminal.DirectConnectLicenseServers



    next

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




    Download 0,83 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Published: May 2003 Updated: May 2005

    Download 0,83 Mb.