How do I check for remaining days of Remote Desktop Services grace period if the server is also a Domain Controller (so I cannot logon as local admin)?


Correct answer:

Logon to your server as an administrator Start--All Programs--Accessories--Right-Click on Command Prompt and choose Run as Administrator

Enter the following command:

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !="") CALL GetGracePeriodDays

  • This copy of server 2008 R2 is already activated. I am not speaking about Server 2008 evaluation period, but Remote Desktop Service grace period. – Danilo Brambilla Apr 10 '12 at 13:52
  • Does not work. It returns: ERROR: Description = Invalid namespace – Danilo Brambilla Apr 10 '12 at 14:04
  • 2
    This does indeed work. The command was failing because there should have been a double backslash after "namespace:" – pk. Apr 10 '12 at 14:21
  • 2
    It is correct now. If you copy and paste the above command into a command prompt that is running with Administrator elevation on your Remote Desktop server, it will work. If not, let me know precisely what error you're receiving. – pk. Apr 10 '12 at 14:29

to do this in PowerShell v2.0 you can use the following single line command:

(Invoke-WmiMethod -PATH (gwmi -namespace root\cimv2\terminalservices -class win32_terminalservicesetting).__PATH -name GetGracePeriodDays).daysleft
  • Also works on Server 2012 R2. – oleschri Sep 2 '15 at 13:21

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.