$ad = [adsi]"LDAP://rootdse"
$ad.defaultNamingContext
PS C:\Scripts> $ad | gm | select name
Name
----
configurationNamingContext
currentTime
defaultNamingContext
dnsHostName
domainControllerFunctionality
domainFunctionality
dsServiceName
forestFunctionality
highestCommittedUSN
isGlobalCatalogReady
isSynchronized
ldapServiceName
namingContexts
rootDomainNamingContext
schemaNamingContext
serverName
subschemaSubentry
supportedCapabilities
supportedControl
supportedLDAPPolicies
supportedLDAPVersion
supportedSASLMechanisms
Shay
http://www.scriptolog.blogspot.com
> in vbscript, i did :
>
> set oroot = getobject("LDAP://rootdse")
> set odomain = getobject("LDAP://" & oroot.get("defaultnamingcontext"))
> In powershell, i hard-code $strBase = "<LDAP://dc=xxx,dc=com>"
>
> Does powershell have the equivalent of what i stated above for
> vbscript ?
>