I made the same comment to Ruud a year or two ago; saying that scripts could no longer identify a Domain Controller. He accepted that fact.

In light of this, I implemented the following script...

 Code:
Function IsDC()
	
	Dim $objWMIService, $colItems, $objItem
	Dim $Counter
	
	;Assume it is not a Domain Controller
	$IsDC = 0
	
	Select
	Case InStr(@PRODUCTTYPE, "Windows Server 2008") <> 0

		$objWMIService = GetObject( "winmgmts://./root/CIMV2" )
		$colItems      = $objWMIService.ExecQuery( "SELECT * FROM Win32_ServerFeature where ID='10'", "WQL", 48 )
		
		$Counter = 0
		For Each $objItem In $colItems
			$Counter = $Counter + 1
		Next
		
		If $Counter <> 0
			$IsDC = 1
		EndIf
		
	Case 1
		If InStr(@PRODUCTTYPE, "Domain Controller") <> 0
			$IsDC = 1
		EndIf
	EndSelect
	
EndFunction

In all honesty, I believe this script can be slimmed down a little, but it works!

It's also not too clever in that a new operating system may require this function to be updated...but you get my drift.

Lee