Monthly Archives: May 2012

Programmatically rejoin active directory domain after virtual machines snapshot is reverted

There is a problem with active directory computer accounts in combination with virtual machine snapshots. After virtual machine is added into domain computer account’s password gets updated in AD once in a while. In case you are coppying, moving, snapshoting or cloning machine which is joined to a domain you must have domain membership problems on those machines very often. It happens if password which is storred on your virtual machine and password on the account object in AD are out of sync. There are some administrative ways to fix that.

For example:

a) changing computer account password configuration policies in AD,

b) rejoining the domain by hand everytime domain membership is broken,

c) snapshoting not only virtual machine but Domain controller and restoring both snapshots in one atomic action

After I become tired of fixing those issues manually I decided to search for programmatic way to join the domain.

I wrote console application which is able to identify if the machine has broken domain membership and if it has it is able to fix it.

You can download the msi file here. download: FixDomainMembership.msi (450.5KB)
added: 22/05/2012
clicks: 436
description: Command Line Utility to fix domain membership

After the executable is installed on the machine with broken domain membership execute the command with command line parameter –help and follow the manual …