break on

$dse = GetObject("LDAP://rootDSE").Get("defaultNamingContext")
$dom = GetObject("LDAP://" + $dse).Name

? split($dom,'=')[1]
_________________________
How to ask questions the smart way <-----------> Before you ask