Guillermo
Showing posts with label WSH. Show all posts
Showing posts with label WSH. Show all posts

Tuesday, May 12, 2009

CTX: WSH/WMI Error on Citrix - Part 2

How to Fix WSH and WMI Error on Citrix Presentation / Citrix XenApp Servers Part 2

Steps to troubleshot WMI Errors:

1) Verify PATH Variable and check for %systemroot%, %systemroot%\system32, and %systemroot%\system32\wbem entries.

System Properties, Advanced, Environment Variables and edit PATH varible.

2) Recompile MOF files

To recompile all Citrix .MOF files enter the following commands in a command prompt:
C:
CD "C:\Program Files\Citrix\System32\Citrix\WMI"
for %i in (*.mof, *.mfl) do Mofcomp %i

3) The DCOM Default Impersonation is NOT set to 'Identify'.

From the command line, the DCOM configuration can be corrected with the following command:REG.EXE Add HKLM\SOFTWARE\Microsoft\Ole /v LegacyImpersonationLevel /t REG_DWORD /d 2 /f


4) Check permissions on the WMI Citrix namespace–Root\Citrix.

Run the Computer Management snap-in.
Right-click My Computer and select Manage.
Expand Services and Applications, right-click WMI Control and select Properties.
Go to the Security tab, expand Root and highlight the Citrix folder.
Click Security.
Add the Local Service and Network Service accounts.

Ensure that both accounts get Execute Methods, Provider Write, and Enable Account.
Restart the Citrix WMI Service


5) Reinstall Citrix WMI Service

Disable the Windows Management Instrumentation Service.
Stop the Windows Management Instrumentation Service.
Delete the C:\WINDOWS\system32\wbem\Repository directory.
Re-enable the Windows Management Instrumentation Service.
Start the Windows Management Instrumentation Service.
Re-install Citrix WMI Providers by going into Add or Remove Programs > Citrix Presentation Server > Change.
Restart the server after the installation completes.
Open C:\Program Files\Citrix\System32\Citrix\WMI and edit all *.mof files in this folder. Edit with notepad.exe and add the following tag at the end of the files:
#pragma autorecover
Recompile the mof files using procedure #2 (Recompile MOF files)


6) Re-register WMI DLL

regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dll

cd %systemroot%\system32\wbem
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s

7) Verify DCOM permissions

Click Start > Programs > Administrative Tools, and click Computer Management to open the Computer Management console.
In the left pane, expand Local Users and Groups, and click the Groups folder.
In the right pane, right-click the Users group and click Properties.
Click Add.
In the Select Users or Groups dialog box, locate Look in drop-down box and choose the local computer.
Select Authenticated Users and INTERACTIVE and click Add.
Click
OK, click Apply, and click Close to close the properties for the Users group.

8) Verify WMI Services Startup Type

Check following services are set to Startup Type: Automatic

Windows Management Instrumentation
WMI Performance Adapter
Windows Management Instrumentation Driver Extensions

Check this script to repair WMI errors

CTX: WSH/WMI Error on Citrix - Part 1

How to Fix WSH and WMI Error on Citrix Presentation / Citrix XenApp Servers Part 1

You found same of following errors on Event Viewer:

Event Type: ErrorEvent
Source: WSH
Event Category: None
Event ID: 1
User: N/A
Computer: USCTXSRV01
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]

Or/And

Citrix Monitoring Script Event 2
Citrix MetaFrame Session Idle Too Long:
WMI error retrieving session object:
Received error: 0x8004100e: Invalid namespace [WBEM_E_INVALID_NAMESPACE]

And/Or

Citrix Monitoring Script Event 2
Citrix MetaFrame Compute Event Rate:
WMI error connecting to Citrix WMI provider:
Received error: 0x8004100e: Invalid namespace [WBEM_E_INVALID_NAMESPACE]

To start troubleshooting process, we must run WBEMTEST:

Click Start, click Run, and then type wbemtest.exe.
In the Namespace box, type root\Citrix and click in Connect button.


This is an example of a server with WMI issues:

This server can load the root\citrix. Now click on Enum Classes button and then click OK, leaving Superclass Name blank to verify the server can load all Citrix Classes.

This is an example of a server with WMI errors:


This is an example of a server with WMI working fine: