• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

active directory rootdse

I

IT Staff

#1
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 ?
 

My Computer

S

Shay Levi

#2
$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 ?
>
 

My Computer

O

/\/\o\/\/ [MVP]

#3
[adsi]''

will treturn the defaulnamingContext also.

Greetings /\/\o\/\/


"Shay Levi" wrote:

> $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 ?
> >

>
>
>
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)