knowledge base


repair win & citrix wmi repository

Solve the issue "Benutzerprofile wird geladen..." and not be able to logon to a virtual Machine.
These tutorial is working well with MS Hyper-V and VMWare VMs!
  • stop/shutdown the vm
  • disable the network card in HyperV Management Console or vCenter
  • start the vm
  • login to vm with local admin rights
  • enable network card in HyperV Management Console or vCenter
  • START->CMD->winmgmt /resetrepository
  • wait 30 seconds until to reboot the vm
  • that`s all. :-)

    The orphaned Way to analysis and repair wmi issues
    http://lkhill.com/wmi-corruption-on-citrix-xenapp-servers/ https://social.technet.microsoft.com/Forums/windowsserver/en-US/41328895-179c-4c79-ae95-9333bfbc4906/ problems-with-wmi-repository-becomming-corrupt?forum=winserverManagement https://support.citrix.com/article/CTX108911

    If RSOP logging has been enabled in the RDS(Terminal) Servers policy, then this can cause the WMI repository to grow to over 1GB in size (on 'normal' servers where RSOP logging has not been enabled, it is less than 100MB).

    The folder is C:\Windows\System32\wbem\repository. To check the GPO setting:

    Expand Computer Configuration, Policies, Administrative Templates, System, Group Policy and check if the 'Turn off Resultant Set of Policy Logging' setting is set to Not configured. If the 'Turn off Resultant Set of Policy Logging' setting is Not Configured or Disabled, Then make it Enable

    If you have a WMI repository that has grown, then you can use the following commands to rebuild WMI repository on each of your Terminal(RDS) servers Open command prompt as admin sc config winmgmt start= disabled net stop winmgmt (if you are prompted that other services will be stopped, type Y and press the Enter key) winmgmt/salvagerepository %windir%\System32\wbem winmgmt /resetrepository %windir%\System32\wbem sc config winmgmt start= auto Reboot and re-check the size of the repository.
    Check WMI if it is consistent:
    winmgmt /verifyrepository
    If it is inconsistent use:
    winmgmt /salvagerepository

    You could try re-creating performance counters and then restarting the WMI service, to see if that helped. cd c:\windows\sysWOW64 lodctr /R
    c: cd %windir%\system32\wbem\ for %i in (*.dll) do RegSvr32 /s %i for %i in (*.mof, *.mfl) do Mofcomp %i c: cd "C:\Program Files (x86)\Citrix\System32\Citrix\WMI" for %i in (*.mof, *.mfl) do Mofcomp %i net stop winmgmt c: cd %systemroot%\system32\wbem rd /S /Q repository regsvr32 /s %systemroot%\system32\scecli.dll regsvr32 /s %systemroot%\system32\userenv.dll mofcomp cimwin32.mof mofcomp cimwin32.mfl mofcomp rsop.mof mofcomp rsop.mfl for /f %s in ('dir /b /s *.dll') do regsvr32 /s %s for /f %s in ('dir /b *.mof') do mofcomp %s for /f %s in ('dir /b *.mfl') do mofcomp %s Recompile Citrix .MOF files: cd %programfiles%\citrix\system32\citrix\wmi for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s net start winmgmt
    c: cd %windir%\system32\wbem\ net stop "ip helper" net stop winmgmt winmgmt /resetrepository net start winmgmt net start "ip helper" c: cd %windir%\system32\wbem\ for %i in (*.dll) do RegSvr32 /s %i for %i in (*.mof, *.mfl) do Mofcomp %i c: cd "C:\Program Files (x86)\Citrix\System32\Citrix\WMI" for %i in (*.mof, *.mfl) do Mofcomp %i
    Symptoms or Error

    When viewing the Event Viewer of a Citrix XenApp Server, one of the following errors might appear in the application log of the server. A similar error message might also appear in the Access Management Console when viewing the server with the Windows Management Instrumentation (WMI):

    Event Type: Error Event Source: WSH Event Category: None Event ID: 1 Description: Citrix Monitoring Script Event 2 Citrix MetaFrame Compute Event Rate: WMI error retrieving object MetaFrame_DisconnectedSession_Happening: Received error: 0x80041002: Not found Event Type: Error Event Source: WSH Event Category: None Event ID: 1 Description: Citrix Monitoring Script Event 2 Citrix MetaFrame Session Idle Too Long: WMI error retrieving session object: Received error: 0x80041002: Not found Event Type: Error Event Source: WSH Event Category: None Event ID: 1 Description: Citrix Monitoring Script Event 2 Citrix MetaFrame Session In Down State: WMI error retrieving session object: Received error: 0x80041002: Not found Event Type: Error Event Source: WSH Event Category: None Event ID: 1 Description: Citrix Monitoring Script Event 2 Citrix MetaFrame Session In Down State: WMI error retrieving session object: Received error: 0x8004100e: Invalid namespace [WBEM_E_INVALID_NAMESPACE] Event Type: Error Event Source: WSH Event Category: None Event ID: 1 Description: Citrix Monitoring Script Event 2 Citrix MetaFrame Session In Down State: WMI error checking sessions: Received error: 0x80041013: Provider load failure Event Type: Error Event Source: WSH Event Category: None Event ID: 1 Description: Citrix Monitoring Script Event 2 Citrix MetaFrame Session Idle Too Long: WMI error checking session: Received error: 0x80041013: Provider load failure

    Invalidated Hotfix #LA3213 #LC0615 #LC1402 Invalidated Hotfix XA650R01W2K8R2X64105 XA650R01W2K8R2X64103 XA650R01W2K8R2X64090 XA650R01W2K8R2X64077 XA650R04W2K8R2X64028 XA650R04W2K8R2X64026

    Was talking to a Microsoft engineer during training, he suggest that if something writes to the repository in incorrect format this can cause the wmi repository to have issues. It seems to be only effecting my 2003x64 xenapp\metaframe farm, but the other servers in my find that winmgmt /salvagerepository didnt work for us: we have a few different levels wmi repair, this is the full script -----------fixwmi.cmd--------------
    Rem Stopping Stuff Net Stop "ADF Installer Server" Net Stop "Citrix Client Network" Net Stop "Citrix Encryption Service" Net Stop "Citrix SMA Service" Net stop "Citrix XML Service" Net Stop "Citrix Client Network" Net Stop "Citrix Independent Management Architecture" Net Stop "Citrix MFCOM Service" Net Stop "SMS Agent Host" Net Stop "Citrix SMA Service" Net Stop "Citrix wmi Service" Net Stop "Windows Management Instrumentation" Net Stop "Windows Management Instrumentation Driver Extensions" Rem Clearing wmi cd %windir%\system32\wbem\ net stop winmgmt rmdir /s /q repository rmdir /s /q Logs mkdir Logs net start winmgmt Rem recreate wmi c: cd %windir%\system32\wbem\ for %%i in (*.dll) do RegSvr32 /s %%i for %%i in (*.mof, *.mfl) do Mofcomp %%i Rem recreate citrix wmi c: cd "C:\Program Files (x86)\Citrix\System32\Citrix\WMI" for %%i in (*.dll) do RegSvr32 /s %%i for %%i in (*.mof, *.mfl) do Mofcomp %%i Rem recreate restart wmi Net start "Windows Management Instrumentation" Net start "Windows Management Instrumentation Driver Extensions" Net start "Citrix SMA Service" Net start "SMS Agent Host" Net start "Citrix Independent Management Architecture" Net start "Citrix MFCOM Service" Net start "ADF Installer Server" Net start "Citrix Client Network" Net start "Citrix Encryption Service" Net Start "Citrix wmi Service" Net start "Citrix SMA Service" Net start "Citrix XML Service"