Wednesday, January 21, 2009

CTX: The Citrix Management Console failed to remove the server. Error Code: 80000007

When you try to remove a dead citrix server from CMC, you receive this error:

"The Citrix Management Console failed to remove the server. Error Code: 80000007"

Solution:

dscheck /full servers /deletemf CTXSRV01


where CTXSRV01 is name of the Citrix server.

DSCHECK is a very powerfull (and dangerous) tool, backup your datastore before use it.

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 ---

Sunday, January 18, 2009

MS: Rebuild WMI

To rebuild WMI in a Windows Server 2003 run this script:

--- Rebuild_WMI.cmd ---

net stop winmgmt
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

--- Rebuild_WMI.cmd ---

To rebuild WMI in Citrix Servers:

Optional step: remove Citrix WMI

Remove Citrix WMI component using Add/Remove Program
Reboot server
Install Citrix WMI component using Add/Remove Program

Rebuild WMI:

cd %programfiles%\citrix\system32\citrix\wmi
for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

Thursday, January 15, 2009

CtxAdmTools: Visual Core Configurator 2008 on Windows 2008 Core R2 (Beta)

How to setup Windows Server 2008 Core R2 (BETA) to run Visual Core Configurator 2008?

Run Start /w ocsetup ServerCore-WOW64
Restart server

VMware: Install VMware Tools on Windows 2008 Core R2

To install VMware Tools on Windows 2008 Core R2 you need to follow this procedure:

Run Start /w ocsetup ServerCore-WOW64

Restart server

Install VMware Tools from VM menu.

Change to the CD/DVD drive

Run msiexec /i "VMware Tools64.msi" /passive

Wednesday, January 07, 2009

Tuesday, January 06, 2009

MS: Windows Update on Windows 2008 Core

Windows 2008 Core don't provide too many options to install Windows Updates. Server Core removes pretty much all of the user interface components. You can enable or disable Windows Update, set Automatic Updates or Turn Off Automatic Updates using scripting, but you can't choose to install specific updates or show availables updates.
Until I released Visual Core Configurator 2008 Beta 2 Refresh.
List all Windows Update available.


Select Windows Updates.

Install Windows Updates.

Download and Install all Windows Updates available.

Enable/Disable Windows Update, Set Automatic Updates


You can download Visual Core Configurator 2008 at http://ctxadmtools.musumeci.com.ar

CtxAdmTools: Visual Core Configurator v1.1 (Beta 2 REFRESH) Released!

Visual Core Configurator 2008 is a FREE tool to Setup and Configure Windows 2008 Core servers.

Today, January 6, 2009, I released the Beta 2 Refresh of Visual Core Configurator 2008.

Build 275 (Beta 2 Refresh) is available for download at http://ctxadmtools.musumeci.com.ar/

You can download the .EXE file package (include extra files) or .ISO file (Best Option for Virtual Machines).This Beta was tested on both versions of Microsoft Windows 2008 Core (x86 and x64) and physical servers, and VMware, Microsoft and XenServer virtual machines.

New Features of this Version: Windows Update


List of Features included in this Build:

Network menu
Network: Show Network Information: Show IP, DNS and NIC configuration
Network: Network Manager: View or change IP, DNS and WINS configuration
Network: Change Computer Name / Domain / Workgroup: Change Computer Name or Join Machine to a Domain or Workgroup

System menu
System: Control Panel: Customize the Operating System (Time and Keyboard)
System: Event Viewer: Display monitoring and troubleshooting messages from Windows
System: Services: Manage Windows Services
System: Screen Saver: Change Screen Saver Configuration
System: Remote Desktop: Configure Remote Desktop (formerly Terminal Server Administration Mode)
System: Video: Configure Screen Resolution
System: Windows Update: Install Windows Updates and HotFixes

Tools menu
Tools: Windows Explorer: Show Files and Folders
Tools: Notepad: Tool to Edit Files
Tools: Registry Editor: Tool to Edit the Registry
Tools: OS Information: Show Operating System Information

Help menu
Help: About: Show the Application Information

Exit menu
Exit: Close Visual Core: Close the Application
Exit: Shutdown: Log Off, Restart or Shutdown the Computer

Friday, January 02, 2009

CtxAdmTools: Visual Core Configurator v1.1 (Beta 2) Released!

Visual Core Configurator 2008 is a FREE tool to Setup and Configure Windows 2008 Core servers.

Today, January 2, 2009, I released the Beta 2 of Visual Core Configurator 2008.

Build 240 (Beta 2) is available for download at http://ctxadmtools.musumeci.com.ar/
You can download the .EXE file package (include extra files) or .ISO file (Best Option for Virtual Machines).

This Beta was tested on both versions of Microsoft Windows 2008 Core (x86 and x64) and physical servers, and VMware, Microsoft and XenServer virtual machines.



New Features of this Version: Event Viewer.



List of Features included in this Build:

Network menu
Network:
Show Network Information: Show IP, DNS and NIC configuration
Network:
Network Manager: View or change IP, DNS and WINS configuration
Network:
Change Computer Name / Domain / Workgroup: Change Computer Name or Join Machine to a Domain or Workgroup

System menu
System:
Event Viewer: Display monitoring and troubleshooting messages from Windows
System:
Video: Configure Screen Resolution
System:
Remote Desktop: Configure Remote Desktop (formerly Terminal Server Administration Mode)
System:
Screen Saver: Change Screen Saver Configuration
System:
Services: Manage Windows Services
System:
Control Panel: Customize the Operating System (Time and Keyboard)
System:
Shutdown: Log Off, Restart or Shutdown the Computer

Tools menu
Tools:
Windows Explorer: Show Files and Folders
Tools: Notepad: Tool to Edit Files
Tools: Registry Editor: Tool to Edit the Registry
Tools:
OS Information: Show Operating System Information


Notes about this build: I wrote the entire Event Viewer module (from scratch) in only 1 day (almost 700 lines of codes), but when I start testing the Save Log option on Windows 2008 core I discovered the Common Dialog never show up on Core, so I developed an entire Common Dialog interface.