Wednesday, April 14, 2010

Using wbadmin to exclude C:\ from 2008 Server Backups

So, the 2008 Server backup utility is pretty spartan. TROG MAKE BACKUP, without a lot of flexibility. We back up IIS configs and content only, don't care about the system drive....but TROG will not permit this. When things go bad on an IIS box, we're just going to restore the configs and content....on a new IIS box that's not busted.

In the meantime, we don't want to waste drive life backing up a whole system partion every night, and bandwidth shuttling it to our backup server for the Iron Mountain guy to come pick up on Mondays. Waste-of-time.

So, here's how to backup just what you want, and nothing more, on your 2K8 Server R2 box:

1. Make sure the Windows 2008 Server Backup Command Line Tools are installed. Server Manager>Features Summary>Add Features


2. Test your backup syntax using wbadmin start backup. Open a command prompt and do a test backup using text similar to my example below. Say I want to backup the IIS content on the D:\ drive only, and I want it to go to my NAS so we can ship it to our backup server later. (commands are all one line, not two as shown) . Once you've gotten the syntax correct, and your backup runs...go on to step 3.

For my example, I would use:

wbadmin start backup -include:d:
-backupTarget:\\wdsharespace\PRDBKPIIS


You would use:

wbadmin start backup -include:
-backupTarget:


3. After you've fiddled with wbadmin syntax and get it where you want for your situation, make a scheduled task for it. Note that it keeps a little one-time logfile in C:\IIScontentbkp.txt

Program/Script: C:\Windows\System32\cmd.exe

Add arguments: /k "wbadmin start backup -include: -backupTarget: -quiet > C:\IIScontentbkp.txt"

Start in: C:\Windows\System32\



4. Enjoy! It's helpful to note that wbadmin creates backups as Virtual Hard Drive (VHD) files. So, it gives you some flexibility for recovery in that (with W7 or 2K8R2) you can mount a VHD file and drag and drop to put your files back if you don't want to do (or don't trust wbadmin recovery)

Tuesday, April 13, 2010

Active Directory Health Check Tool

So here's a little gem that will tell you just about everything you never wanted to know about your AD infrastructure. It pipes the results to a .txt file for easy and thorough review, and also gives a very general sense of health by comparing the number of PASSES and FAILS. I strongly recommend reviewing the resultant c:\ad_diag .txt file in detail to get a more accurate perspective of your AD health. Many of the utils don't report in a pass/fail format, so reviewing the output file is a must for the real picture.

Make sure you have the Server Resource tools for your server platform installed:

Windows Server 2003 Resource Kit Tools
Windows 2000 Resource Kit Tools for administrative tasks

You can download the Active Directory Health Check Tool, ready to run as a .bat, here.

Or, for the more cautious, copy and paste the text below into a .txt file, save as .bat.

In either case run it on your FSMO domain controller to get a real good picture of the status with your AD. None of this stuff is intrusive, mostly verbose versions of the command line diags for AD. Enjoy!

@echo off
echo Active Directory Health Diagnostic, v1.1
echo ........................................
echo Running dcdiag /v.....
dcdiag /v >> c:\ad_diag.txt
echo Running dcdiag /test:DNS /DNSALL (may take a few moments, be patient).....
dcdiag /test:DNS /DNSALL /e /v >> c:\ad_diag.txt
echo Running dcdiag /test:DcPromo /e /v.....
dcdiag /test:DcPromo /e /v >> c:\ad_diag.txt
echo Running dcdiag /test:RegisterInDNS.....
dcdiag /test:RegisterInDNS >> c:\ad_diag.txt
echo Running netdiag.exe /v.....
netdiag.exe /v >> c:\ad_diag.txt
echo Running netsh dhcp show server.....
netsh dhcp show server >> c:\ad_diag.txt
echo Running repadmin /showreps.....
repadmin /showreps >> c:\ad_diag.txt
echo Running repadmin /replsum /errorsonly.....
repadmin /replsum /errorsonly >> c:\ad_diag.txt
echo ........................................
echo Diagnostic Completed Successfully...
echo view results in C:\ad_diag.txt
pause
echo ........................................
echo ........................................
echo ........................................
echo General Health Ratio (FAILS/PASSES)
echo THis is very general, be sure to check C:\ad_diag.txt!
echo ........................................
echo NUMBER OF FAILS
find /c /i "fail" c:\ad_diag.txt
echo ........................................
echo NUMBER OF PASSES
find /c /i "pass" c:\ad_diag.txt
pause