To avoid hardcoding the PDC in your scripts you could use this:

Code:

? GetPDC()
Get $RC

Function GetPDC()
Dim $oSysInfo,$PDC

$oSysInfo = CreateObject("ADSystemInfo")
$PDC = $oSysInfo.PDCRoleOwner
$PDC = SubStr($PDC,InStr($PDC,',CN=') + 4)
$GetPDC = Split($PDC,',CN=')[0]
EndFunction


I don't know if this is usefull to anyone, maybee it is common knowledge, but the PDC didn't die when native mode was introduced whith server 2003,

So if you want to know the name of the PDC (role owner) dynamicaly, this code will help you to avoid script failure because of change of PDC name

-Erik