0

Trying to automate Windows Server 2012 R2 installation of services and configuration.

I was able to install the RDS License Server Windows Feature via Powershell Add-WindowsFeature RDS-Licensing, Add-WindowsFeature RDS-Licensing-UI however the Server then needs to be Activated with Microsoft but the only way I've been able to Activate the Server is using the Active Server Wizard: enter image description here

Is anyone aware of a way to Activate the Server by Powershell or registry settings and also then Install the Licenses I have without using the Wizard?

2

This code should handle the activate the license server by PowerShell part of your question and may give you ideas for the rest.

# ----------------------------------------------------------------------------------------------------------------
function log-info($data)
{
    #$data = "$([DateTime]::Now):$($data)"
    write-host ($data | out-string)

}

function main()
{

    $licenseServer='localhost'
    $companyInformation = @{}
    $companyInformation.FirstName="Suzy"
    $companyInformation.LastName="Sample"
    $companyInformation.Company="Independent Consolidators"
    $companyInformation.CountryRegion="United States"

    activate-licenseServer $licenseServer $companyInformation
}

# ----------------------------------------------------------------------------------------------------------------
function activate-licenseServer($licServer, $companyInfo)
{

    $licServerResult = @{}
    $licServerResult.LicenseServerActivated = $Null

    $wmiClass = ([wmiclass]"\\$($licServer)\root\cimv2:Win32_TSLicenseServer")

    $wmiTSLicenseObject = Get-WMIObject Win32_TSLicenseServer -computername $licServer
    $wmiTSLicenseObject.FirstName=$companyInfo.FirstName
    $wmiTSLicenseObject.LastName=$companyInfo.LastName
    $wmiTSLicenseObject.Company=$companyInfo.Company
    $wmiTSLicenseObject.CountryRegion=$companyInfo.CountryRegion
    $wmiTSLicenseObject.Put()

    $wmiClass.ActivateServerAutomatic()

    $licServerResult.LicenseServerActivated = $wmiClass.GetActivationStatus().ActivationStatus
    log-info "activation status: $($licServerResult.LicenseServerActivated) (0 = activated, 1 = not activated)"
}


# ----------------------------------------------------------------------------------------------------------------
function deactivate-licenseServer($licServer)
{

     $wmiClass = ([wmiclass]"\\$($licServer)\root\cimv2:Win32_TSLicenseServer")
     $wmiClass.DeactivateServerAutomatic()

}


# ----------------------------------------------------------------------------------------------------------------
main
0

As can be seen in the link below the only role related to RDP supported by a Server Core installation is the Remote Desktop Services Connection Broker, usually not supported doesn't mean it won't work, but it might be harder to do, and in the end if you have any problem you might not be able to get help from Microsoft.

https://technet.microsoft.com/en-us/library/jj574158.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.