VMware Guest OS: The trust relationship between this workstation and the primary domain failed

VMware Guest OS: The trust relationship between this workstation and the primary domain failed.

I received this errors two times on a row for two different computers.

I am not 100% sure, but from reading the web I came to conclusion that this error is encountered when:

  1. SID gets cloned when computer gets cloned using VMware. Not right after cloning, but at the random after some time.
  2. Guest OS gets reverted to some earlier snapshot.

In both cases leaving and joining Domain again fixes this issue.

P.S. Some time ago there was an utility called NewSID, but now it’s gone. NewSID has been retired and is no longer available for download. Please see Mark Russinovich’s blog post: NewSID Retirement and the Machine SID Duplication Myth.

How to delete all folders in current directory

How to delete all folders in current directory using command line (cmd.exe) or batch files?

How to delete all empty directories in current folder:
FOR /D %f IN (*.*) DO RD "%f"

How to delete all directories / folders in current directory / folder:
FOR /D %f IN (*.*) DO RD "%f" /S /Q

If you are using FOR in batch file, you must use double % signs.
FOR /D %%f IN (*.*) DO RD "%%f" /S /Q

Google AdWords (or any third party) tracking with onclick that really works

Disclaimer: this works for me and my clients today (Sep 2010). If Google or one on the web browsers change something, this may break all tracking, so use this on your own risk.

Below is working code fragments. In the process of making the code work, there was following problems / symptoms:

  • Chrome and Safari refused to follow / ping image src at all;
  • Firefox seemed to ignore / not follow googleadservices.com issued redirect 302 to googleads.g.doubleclick.net;
  • It all seemed like some sort of Same origin policy;
  • Firefox plug-in Firebug Net Panel showed strange question marks in Persist mode (seemed like request never completes). And on next click it showed – aborted.

This all was caused by fact, that after JavaScript function returned, original – “href” handler somehow canceled image download request. So by adding setTimeout it has nothing to cancel any more.

Your HTML code:
<a href="http://some-lead-page-where-you-cannot-add-or-change-code" onclick="googletrack()">Some lead / sale / page view / other action</a>

Simple example code:
function googletrack(){
setTimeout('(new Image()).src="http://www.googleadservices.com/pagead/conversion/0123456789/?label={yourlabelprovidedbygoogle}&guid=ON&script=0"',100);
}

Example code with custom label passed as parameter:
function googletrack(label){
setTimeout('(new Image()).src="http://www.googleadservices.com/pagead/conversion/0123456789/?label='+label+'&guid=ON&script=0"',100);
}

Other fields such as value, etc. can be added as needed.

In my setup I attach onclick handler dynamically using JavaScript that is called from HTML in JavaScript defer mode. Also links in question opens in new window (not sure if it will work if opening in the same window).

Tested on Internet Explorer 8.0.7600.16385, Mozilla Firefox 3.6.8, Google Chrome 6.0.472.53, Opera 10.61, Apple Safari 5.0.1.

Updated Sep 17, 2010.