RD Session Host Configuration - The settings for this Remote Desktop Session Host server cannot be retrieved

Aug 19

Written by:
Tuesday, August 19, 2014 8:30 AM  RssIcon

After a  sign in to the server I opened the RD Session Host Configuration snap-in

image

Instead of the following screen where you can change the “user logon mode” for example  to set “prevent new logins” (for maintenance of a RDS Server )

image

the following message appeared:

image

So I realized, that the WMI repository seems to be corrupt! You can run “gpupdate” (when you have WMI filters set for your GPO’s) or WBEMTEST  to check if WMI works. In my case I run gpupdate and received a lot of errors and messages about not working WMI – filters!

So I realized that the WMI repository of this RDSH Server is corrupt!

Question: Where are the WBEM related files located and which service is involved?

image

The files are in the following folder: %windir%\system32\wbem The repository itself is located in the “repository” subfolder

image

The Service (Display name) is  “Windows management Instrumentation”  Service name: “winmgmt

 

Question: How do I repair a corrupted repository?

Version 1: –> this time this didn’t solve my problem!

stop / disable the WMI service
rename the “repository” folder
start / automatic the service again

run the following commands from command prompt with admin right


sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
rename repository repository.old
sc config winmgmt start= auto
net start winmgmt

 

Version 2: –> solved my problem!

Re-register all of the dlls
recompile the .mofs in the wbem folder
re-registering WMI Service and Provider

run the following commands from command prompt with admin right

sc config winmgmt start= disabled 
net stop winmgmt /y 
%systemdrive%
cd %windir%\system32\wbem

rename repository repository.old

for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s 
wmiprvse /regserver 
winmgmt /regserver 

:: recompile all default WMI- .mof and .mfl files
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s

sc config winmgmt start= auto
net start winmgmt

:: should not be necesarry
regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dll 

after I final reboot I opened the RD Session Host Configuration snap-in and in the “Edit settings – General” part

image

I could check / change the “User logon mode”

image

 

The following Technet link gives you additional info about “WMI: Rebuilding the WMI Repository” http://blogs.technet.com/b/askperf/archive/2009/04/13/wmi-rebuilding-the-wmi-repository.aspx