Wednesday, January 21, 2009

CTX: DCOM Error 10016

Error:

Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10016
User: CTXSERVER\Ctx_SmaUser
Computer: CTXSERVER
Description: The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {49BD2028-1523-11D1-AD79-00C04FD8FDFF} to the user CTXSERVER\Ctx_SmaUser SID (S-1-5-21-3439742382-3352395512-2697211326-1010). This security permission can be modified using the Component Services administrative tool.

Easy Solution:

Run the script (see below) and restart the affected machine (or Citrix Print Manager Service and Citrix SMA Service services).

--- fix_dcom.vbs ---

on error resume next
strComputer = "."
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://Ctx_ConfigMgr")
objGroup.Add(objUser.ADsPath)
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://Ctx_SmaUser")
objGroup.Add(objUser.ADsPath)

--- fix_dcom.vbs ---

The following script add required permissions and restart citrix services in a remote server (This script don't affect logged users)

--- fix_dcom_remote.vbs ---
on error resume next

Dim objWMIService, objItem, objService
Dim colListOfServices, strComputer, strService, intSleep

strComputer = "abctxps202"
intSleep = 15000

WScript.Echo "Fixing DCOM Error on server " & strComputer

Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://Ctx_ConfigMgr")
objGroup.Add(objUser.ADsPath)

Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://Ctx_SmaUser")
objGroup.Add(objUser.ADsPath)

strService = "Citrix SMA Service"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ="_
& strService & " ")
For Each objService in colListOfServices
objService.StopService()
WSCript.Sleep intSleep
objService.StartService()
Next
WScript.Echo "Service " & strService & " has Restarted"

strService = "cpsvc"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ="_
& strService & " ")
For Each objService in colListOfServices
objService.StopService()
WSCript.Sleep intSleep
objService.StartService()
Next
WScript.Echo "Service "& strService & " has Restarted"
--- fix_dcom_remote.vbs ---

No comments: