Friday, July 14, 2006

I installed WSUS at work and have been learning how to administrate/manage the service.  Here's a few tips:

* You've got to configure Group Policy after installation in order to get clients of the domain to start using WSUS instead of Microsoft Update.  There's ample info on the 'net about how to configure GP.

* Once you've got Group Policy updated and replicated, you can force a client to update by typing GPUPDATE at the command line.

* To force a client computer to contact WSUS to update itself, type:

      wuauclt.exe /detectnow

* To keep WSUS fit and trim so that it runs well, copy/paste the following to a batch file on the WSUS Server and set it up as a Scheduled Task.  This is a script that someone else wrote that I found doing some Internet searches in trying to improve WSUS performance.  If you don't run this batch file on your WSUS instance, Approving Updates through the WSUSAdmin interface can become painfully slow.

Please note, you will need to download WSUSDEBUGTOOL.EXE -- which is called "Server Diagnostic Tool" and available here: http://www.microsoft.com/windowsserversystem/updateservices/downloads/default.mspx.  After download, run and extract the wsusdebugtool.exe file to the X:\Program Files\Update Services\Tools directory on the WSUS Server.  Make sure to configure the first TWO lines of the batch file so that the paths are correct.

SET ScriptPath=F:\WSUS-Scripts

SET BackupPath=F:\WSUS-BAK

SET WSUS_DB=%ComputerName%\WSUS

SET ProgPath=%ProgramFiles%\Update Services\Tools

if not exist "%ScriptPath%\wsus_clean.log" echo Log Created > "%ScriptPath%\wsus_clean.log"

echo :---------------Begin WSUS Cleanup-------------------: >> %ScriptPath%\wsus_clean.log

if not exist "%ProgPath%\wsusdebugtool.exe" echo Please Download the Debug tool from http://download.microsoft.com/download/7/7...ebug%20Tool.EXE

if not exist "%ProgPath%\wsusdebugtool.exe" echo ERROR Please Download the Debug tool from http://download.microsoft.com/download/7/7...ebug%20Tool.EXE >> "%ScriptPath%\wsus_clean.log"

if exist "%ProgPath%\wsusdebugtool.exe" echo %ProgPath%\wsusdebugtool.exe Found. >> "%ScriptPath%\wsus_clean.log"

echo Starting WSUS Cleanup.... >> "%ScriptPath%\wsus_clean.log"

date /t >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Stopping Web Service >> "%ScriptPath%\wsus_clean.log"

NET STOP w3svc >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Begin Deletion of Unneededrevisions >> %ScriptPath%\wsus_clean.log

echo :: >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

"%ProgPath%\wsusutil.exe" deleteunneededrevisions >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Begin Purge of Unneeded Files >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

"%ProgPath%\wsusdebugtool.exe" /tool:purgeunneededfiles >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Begin OSQL Commands to backup the DB >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

del "%BackupPath%\backup_wsus.bak.old"

ren "%BackupPath%\backup_wsus.bak" backup_wsus.bak.old

Osql -S %WSUS_DB% -E /Q "Backup Database SUSDB to disk = '%BackupPath%\backup_wsus.bak'" >> "%ScriptPath%\wsus_clean.log"

Osql -S %WSUS_DB% -E /Q "backup log SUSDB with TRUNCATE_ONLY" >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Begin OSQL Commands to Add Indexes if missing >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

Osql -S %WSUS_DB% -E /Q "USE SUSDB BEGIN TRAN IF NOT EXISTS (SELECT * FROM sysindexes where name='nc7DeploymentRevision') BEGIN CREATE NONCLUSTERED INDEX nc7DeploymentRevision ON dbo.tbDeployment(RevisionID, TargetGroupID, ActionID) END COMMIT TRAN" >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Begin OSQL Commands to Truncate tbEventInstance >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

Osql -S %WSUS_DB% -E /Q "USE SUSDB declare @RS as int select @RS=(select count(*) from tbEventInstance) select @RS as tbEventInstanceRowCount if @RS > '3000' truncate table tbEventInstance" >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Begin OSQL Commands to compress the DB >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

Osql -S %WSUS_DB% -E /Q "use SUSDB dbcc shrinkdatabase ('SUSDB')" >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

echo Starting Web Services >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

net start w3svc >> "%ScriptPath%\wsus_clean.log"

echo :: >> "%ScriptPath%\wsus_clean.log"

date /t >> "%ScriptPath%\wsus_clean.log"

time /t >> "%ScriptPath%\wsus_clean.log"

echo :---------------Cleanup Finished -------------------: >> "%ScriptPath%\wsus_clean.log"

SET ScriptPath=

SET BackupPath=

SET WSUS_DB=

:END

 

 

posted on 7/14/2006 1:33:31 PM (Eastern Standard Time, UTC-05:00)  #    Comments [4] Trackback
 Sunday, June 25, 2006
Microsoft Exchange 2003 Admin Tips
posted on 6/25/2006 12:12:13 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] Trackback
 Thursday, June 01, 2006

At work I've built 7 new workstations for some of the employees.  To install the OS, I have been using Symantec Ghost 2003.  I've jotted down the process of how to clone systems in a one-off manner for my own reference, but thought it might benefit others if I posted the How-To here.

How to Clone a Computer Using Ghost 2003: 

  1. Install Ghost 2003 on the master computer.  This is the computer that you want to make a clone of.
  2. Create a Ghost Boot Disk if you don’t already have one.  This disk is used to boot the slave PC.
    1. This is done by starting Ghost, going to Ghost Utilities, and selecting the Create Ghost Boot Disk item.  When creating a boot disk, make sure to select the correct network driver.  If you need to add a driver, select the NDIS2 option and then browse to the media that contains the NDIS driver.  This will be the directory where the OEMSETUP file is located.
  3. Select the Peer-To-Peer option under Ghost Advanced.  Make sure to choose correct options.  The computer will restart in Ghost DOS mode.  Set the system in Master mode.
  4. Take the boot disk and boot the slave PC to the Ghost Boot disk.  Set the system in Slave mode.  Once slave mode starts, it will display the IP address of the box.  Note that IP, then go over to the Master PC and type in the Slave’s IP address there.
  5. Now the two machines are connected, go to Disk and select the option to start the clone operation on the Master computer.

I've noted some interesting behaviors with getting the new clone to login to the active directory domain properly once the above process is complete.  This has to do with the system time of the clone being different from the system time of the domain.  The way around this I have found is to:

1. Login to the cloned box using a local computer account.

2. Open a command window and type: net use \\ADcontroller\ipc$ /username:domain\administrator password

3. Then type: net time \\servername /set 

This gets the time of the clone in synch with the domain.

If the machine still won't login to the domain, the solution is to remove the workstation from the domain, setting it back to WORKGROUP mode.  Reboot.  After Reboot, join it to the domain.

posted on 6/1/2006 3:28:59 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1] Trackback
 Sunday, May 28, 2006

Over the past year+, I've noted an incredible increase in form spam through the various web sites that I've authored and continue to manage.  As a result, I've had to go back and add CAPTCHA controls to the forms in some cases.

I'm working on a new .NET project called ArtOverture and needed to dig into a .NET based CAPTCHA control.  Looking around at the source code for dasBlog, I learned about Jeff Atkins CaptchaControl.  It's written in VB.NET for Visual Studio 2003 and ASP.NET 1.1.  However, I found that you can include the compiled DLL just fine as a toolbox control in Visual Studio 2005.  The control works perfectly without any need for recompiling.

Here's the link to Jeff's Code Project writeup on CaptchaControl.  Full source code is available.

 http://www.codeproject.com/aspnet/CaptchaControl.asp

posted on 5/28/2006 12:25:58 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] Trackback
 Friday, May 26, 2006

I've been toying around with the idea of setting up my own blog for sometime.

After doing a brief Google search on ASP.NET based blog tools, I found David Hayden's note where he recommended DasBlog.  Took me all of 15 minutes to get up and running on my box.  So far so good.

posted on 5/26/2006 10:33:07 PM (Eastern Standard Time, UTC-05:00)  #    Comments [10] Trackback