denvervur.blogg.se

Check days left windows terminal server trial
Check days left windows terminal server trial




Write-Host -ForegroundColor Yellow '**You Chose not to reset Grace period of Terminal Server (RDS) Licensing' Write-host -ForegroundColor Red 'Resetting, Please Wait.' Remove-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod' # Finally Delete the key which resets the Grace Period counter to 120 Days. $rule = New-Object ("Administrators","FullControl","Allow") # Assign Full Controll permissions to Administrators on the key. $key = ::LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod", ::ReadWriteSubTree,::takeownership) $res = ::RtlAdjustPrivilege(9, $true, $false, $bEnabled) Public static extern int RtlAdjustPrivilege(ulong Privilege, bool Enable, bool CurrentThread, ref bool -TypeDefinition $definition -PassThru # Reset Terminal Services Grace period to 120 Days $Response = Read-Host "Do you want to reset Terminal Server (RDS) Grace period to Default 120 Days ? (Y/N)" Write-Host -fore Green 'Terminal Server (RDS) grace period Days remaining are' : $GracePeriod $GracePeriod = (Invoke-WmiMethod -PATH (gwmi -namespace root\cimv2\terminalservices -class win32_terminalservicesetting)._PATH -name GetGracePeriodDays).daysleft # Display current Status of remaining days from Grace period. $ErrorActionPreference = "Silentl圜ontinue" # Author will not be responsible for any misuse/damage caused by using it. # Disclaimer: Please test this script in your test environment before executing on any production server.

check days left windows terminal server trial

# Developed by Prakash Kumar ( ) May 28th 2016 # This Script is intended to be used for Querying remaining time and resetting Terminal Server (RDS) Grace Licensing Period to Default 120 Days. The script is interactive and will tell you how many days are left (very handy as you can look it up extremely quickly this way) and lets you choose if you want to reset the time or not. To use the script, simply save to your RDS server and run in an elevated PowerShell prompt. I have tested on Windows Server 2016 and it definitely still works. But they no longer test or maintain the script. In the Windows Server 2012 and Server 2012 R2 era, Microsoft provided the following PowerShell script for this scenario. For whatever reason, you may end up in a situation where you need to extend the grace period for Windows RDS server (remote desktop services, aka terminal server.) This can be a pain, especially if things time out and you lose RDP access to the server.






Check days left windows terminal server trial