Archive for

October 2008

Windows Server 2008 Domain Controller Backup

All the information you need can be pulled from TechNet, but I have condensed it here.

You need to run the following command to get the system state backup, which is what you can use to restore a DC it fails and you need to restore to a different machine, or to a new install on the same machine.

wbadmin start systemstatebackup -backupTarget:<driveletter>:

Be sure to run it in cmd and not in powershell because powershell does not like the -backupTarget: part of the command. If you normally work in PSH, then a cmd /c "wbadmin ..." will allow you to run this command.

A few other notes that are valuable:

When you are saving system state you must backup to a drive, it can't be a network share.

And can't be one of the source drives of the backup, but you can get around that. To get around the drive limitation create a DWORD in the registry at:

HKLM\SYSTEM\CurrentControlSet\Services\wbengine\SystemStateBackup\AllowSSBToAnyVolume

and set the value to 1. This allows you to backup to a source drive of the backup. The TechNet article says there can be issues with this, but allows you to do it anyway and from what I can tell does not have issues. This is a bit frightening, but seems to be the best we can do with the tools provided.

If you have the space, you can also backup the entire machine with a job defined through the GUI (or wbadmin). This will allow you to restore to the machine the backup was pulled from. It is good idea to have both this kind of backup and the system state backup.

Microsoft would ultimately like to sell you their System Center Data Protection Manager (DPM) product and that is why there are not as many options for wbadmin as there were for ntbackup. We don't need (or have the hardware to support) DPM here, so we are currently making do with some wbadmin and some scripts cobbled together.

Posted

Good Software

One of the guys on a private mailing list asked about what software people couldn't live without. Here's my list.


  1. Notepad2 - I rename it to n2 and put it in my PATH. Then it is just a WindowsKey + R, n2 away.

  2. Firebug - Couldn't style a webpage without it.

  3. DiffMerge - Comparing versions of code is pretty and easy.

  4. Pidgin - Allows me to be on MSN and Google Talk.

  5. GridMove - I have a 1920x1200 screen which is too much real estate to only use one window at a time, but Windows doesn't have a good way to manage my application windows.

  6. Depending on what I am working on, either VS 2008, or Vim + ctags.

Posted

Powershell Tricks

Here are two things that I haven't found written about other places, but that are hinted at in the help for New-Object.

Open an explorer window in the current directory:

> $shell = New-Object -comObject shell.application> $shell.Explore("$(resolve-path .)")

You can present a folder selection dialog to a user:

> $shell.BrowseForFolder(0, "Title", 0, "c:\") | get-member   TypeName: System.__ComObject#{a7ae5f64-c4d7-4d7f-9307-4d24ee54b841}Name                       MemberType Definition----                       ---------- ----------CopyHere                   Method     void CopyHere (Variant, Variant)DismissedWebViewBarricade  Method     void DismissedWebViewBarricade ()GetDetailsOf               Method     string GetDetailsOf (Variant, int)Items                      Method     FolderItems Items ()MoveHere                   Method     void MoveHere (Variant, Variant)NewFolder                  Method     void NewFolder (string, Variant)ParseName                  Method     FolderItem ParseName (string)Synchronize                Method     void Synchronize ()Application                Property   IDispatch Application () {get}HaveToShowWebViewBarricade Property   bool HaveToShowWebViewBarricade () {get}OfflineStatus              Property   int OfflineStatus () {get}Parent                     Property   IDispatch Parent () {get}ParentFolder               Property   Folder ParentFolder () {get}Self                       Property   FolderItem Self () {get}ShowWebViewBarricade       Property   bool ShowWebViewBarricade () {get} {set}Title                      Property   string Title () {get}

Use above to select something:
> $shell.BrowseForFolder(0, "Title", 0, "c:\").Self.Path


MSDN gives the information you need for the third argument. It is a 'flags' field that can be any combo of ulFlags on that page.

See $shell | Get-Member for more.

Posted