2008/11/26

Delete the WSUS Client ID's from registry by Logon script

CURRENT CONFIGURATION: Windows XP, 2003; WSUS 3; OS distribution method is cloning (imaging) of computers.
OBJECTIVE: Update all workstation and server trough WSUS
ISSUE: Computers override each other or not appear in WSUS console.
SOLUTION: When you clone (reimage) new computer from different either disk or clone image WSUS Client ID would be the same for either both or all recloned (reimaged) computers.
I've chosen VBS Login script approach to delete WSUS client ID's in registry.
The new WSUS ID's would be generated at "Automatic Updates" service start.
The computer would connect to WSUS server.
Please change MyCompanyName and MyDivisionName.
--- Start of code ---
'******************************************************************************
'   Author:  Vadims Zenins http://vadimszenins.blogspot.com
'   Version: 1.01
'   Date:    26/11/2009 18:18:44
'   Subroutine DeleteWSUSid
'   delete the WSUS Client ID's from the registry
'   and Restart service "Automatic Updates
'   Inputs - none
'   Call DeleteWSUSid()
'   WshShell.run "wuauclt.exe /resetauthorization /detectnow", 0, True
'******************************************************************************
Sub DeleteWSUSid()
  On Error resume next
' Stop service "Automatic Updates"
WshShell.run "net.exe stop wuauserv", 0, True

'Set the registry keypath that we are going to work with
strKeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate"
'Set the value name that we will use to create the registry marker
' (to determine if we've run the script before on this computer)
strKeyReportPath = "HKLM\SOFTWARE\MyCompanyName\MyDivisionName"
intValue = 1

If WSHShell.RegRead(strKeyReportPath & "\WSUSIDDeleted") <> "1" Then
strMessage = "Deleting WSUS IDs in registry: " & strKeyPath
'Show me a box for 3 sec.
WshShell.Popup strMessage,3
'Delete registry values
'strMessage =  "Deleting " & strKeyPath & "\AccountDomainSid"
'WshShell.Popup strMessage,2
WSHShell.RegDelete strKeyPath & "\AccountDomainSid"
'strMessage =  "Deleting " & strKeyPath & "\PingID"
'WshShell.Popup strMessage,2
WSHShell.RegDelete strKeyPath & "\PingID"
'strMessage =  "Deleting " & strKeyPath & "\SusClientId"
'WshShell.Popup strMessage,2
WSHShell.RegDelete strKeyPath & "\SusClientId"
'strMessage =  "Deleting " & strKeyPath & "\SusClientId"
'WshShell.Popup strMessage,2
WSHShell.RegDelete strKeyPath & "\SusClientIdValidation"

'Create Key in registry for report
WSHShell.RegWrite strKeyReportPath & "\WSUSIDDeleted", intValue, "REG_DWORD"
WSHShell.RegWrite strKeyReportPath & "\WSUSIDDeletedDate",Now

Wscript.Sleep 2000
' Start service "Automatic Updates"
WshShell.run "net.exe start wuauserv", 0, True

Else
End If

End Sub
'******************************************************************************

--- End of code ---

Download md5: 12d50a1db2af39c1a68884a107fccc43
LINKS: Delete the WSUS Client ID's from registry by Powershell script

VMware ESX server 3i: Unable to find a supported device

CURRENT CONFIGURATION: Supermicro server 5015M-NTV with SATA disk

OBJECTIVE: Install VMware ESX server 3i

ISSUE: Error message appears during the installation
VMware ESX Server 3i 3.5.0 Installer.
Installation operation Failed!
The installation operation has encountered a fatal error: Unable to find a supported device to write the VMware ESX Server 3i 3.5.0 image to.
System Information:
Manufacturer: Supermicro
Model: PDSMU

SOLUTION:
Set in BIOS next settings:
Serial ATA - enabled
SATA Controller Mode: Enhanced
SATA AHCI: Enabled.

2008/11/19

Primary Certificate automatic enrollment in Active Directory

CURRENT CONFIGURATION: Windows Domain on Windows Server 2003 SP2

OBJECTIVE: Primary Certificate automatic enrolment (distribution) and keeping in Active Directory

ISSUE: DIMS User's Group Policy does not work on non domain controller server.

SOLUTION:
Follow the instruction
Request files KRdeploy.cmd and KRdeploy.js from Microsoft Support.
Use DIMS.adm from Microsoft page instead of file DIMS.adm, sent by support.

2008/10/01

WSUS 3 SP1 and remote MS SQL Database with nonstandard IP port

CURRENT CONFIGURATION: Windows 2003 R2 x64 SP2, WSUS 3.0 SP1 and remote MS SQL 2005 server with non standard IP port.

OBJECTIVE: Connect to WSUS administration console.

ISSUE: WSUS administration console responds: Cannot connect to 'yourWSUSserverName'. SQL server may not be running on the server. Please verify that SQL Server is running and configured correctly on the server.
Application Event ID: 7032
The WSUS administration console was unable to connect to the WSUS Server via the remote API.
Verify that the Update Services service, IIS and SQL are running on the server. If the problem persists, try restarting IIS, SQL, and the Update Services Service.
The WSUS administration console has encountered an unexpected error. This may be a transient error; try restarting the administration console. If this error persists,
Try removing the persisted preferences for the console by deleting the wsus file under %appdata%\Microsoft\MMC\.


SOLUTION:
Just in case delete the files under %appdata%\Microsoft\MMC\
Check YourSqlServerName in registry "HKLM\SOFTWARE\Microsoft\Update Services\Server\Setup\SqlServerName"
Try connect to SQL server with command:
sqlcmd -S YourSqlServerName,IPport -E -d SUSDB
If you connected successful change value of registry "HKLM\SOFTWARE\Microsoft\Update Services\Server\Setup\SqlServerName" to YourSqlServerName,IPport
Restart WsusService
Try open the
WSUS administration console.

Links: Troubleshooting database issues
TAGS: wsus, MSSQL, SQL server, WSUS remote database

2008/09/29

Check on Nagios the latest files in folder with NSClient++

CURRENT CONFIGURATION: Linux OpenSuSe, Nagios 3.0.1, NRPE; Windows 2003 x64 server, NSClient++ 0.3.5.1

OBJECTIVE: Monitor SQL backup with Nagios. Check FOLDER with SQL backup files. Send WARNING if ALL files *.bak are older than 24 hours.

SOLUTION:
NRPE has to work on Nagios server and on Windows client computer with NSClient++.
Nagios server command.cfg file:

define command{
command_name check_nrpe_file_new
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckFile2 -a file="$ARG1$" filter=in filter+creation=\<"$ARG2$" syntax="%filename% was created %creation%" MinWarn=0 #MinCrit=0 }

define command{
command_name check_nrpe_file_mod
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckFile2 -a file="$ARG1$" filter=in filter+written=\<"$ARG2$" syntax="%filename% was modified %write%" MinWarn=0 }


Nagios server somename.cfg file:

define service{
...
check_command check_nrpe_file_new!X:\\FOLDER\\TX\\*.trn!35m
normal_check_interval 60
}

define service{
...
check_command check_nrpe_file_mod!X:\\FOLDER\\*.bak!30h
normal_check_interval 60
}


NSClient++ NSC.ini file:

[modules]
NRPEListener.dll
[NRPE]
allow_arguments=1
allow_nasty_meta_chars=1


Big thanks to NSClient++ author for program and excellent support.
P.S. I use
NSClient++ 0.3.6.316 (10/09/2009). For NSClient++ 0.3.9.330 2011-09-02 please read article Check on Nagios the latest files in folder with NSClient++ 0.3.9

TAGS: Nagios, Windows server, file age