I am Dale Hayter, a Microsoft and VMware certified Technical Consultant.

My blog has been built up over the years from my experience of working on an IT helpdesk and also from being out on-site.

Reset / Rebuild WMI on a Citrix Server

If you have to reset or have issues with the WMI repository you might need to rebuild it.

If you do rebuild it then you will need to readd the Citrix MOF’s. This can be achieved by running the commands below


net stop wmiApSrv
net stop Winmgmt
winmgmt /resetrepository
cd "C:\Program Files (x86)\Citrix\system32\Citrix\WMI"
mofcomp citrix.XP10FR3.mof
mofcomp citrixProv.XP10FR3.mof
mofcomp metaframe.XP10FR3.mof
mofcomp metaframeProv.XP10FR3.mof
mofcomp mgmt.XP10FR4.mof
net start Winmgmt
net start wmiApSrv

EDIT : Noticed I wasn’t actually stopping WMI. Ooops. Added this now

EDIT : Also if running this in a VM it might start additional services. The script below will start all the other services it stops.


net stop wmiApSrv /y
net stop Winmgmt /y
winmgmt /resetrepository
c:
cd "C:\Program Files (x86)\Citrix\system32\Citrix\WMI"
mofcomp citrix.XP10FR3.mof
mofcomp citrixProv.XP10FR3.mof
mofcomp metaframe.XP10FR3.mof
mofcomp metaframeProv.XP10FR3.mof
mofcomp mgmt.XP10FR4.mof
net start wmiApSrv
net start Winmgmt
net start iphlpsvc
net start VMUpgradeHelper
net start WSRM
net start VMTools