Page 1 of 1 1
Topic Options
#111306 - 2004-01-06 12:04 PM LDAP question
mima Offline
Hey THIS is FUN

Registered: 2002-01-25
Posts: 217
Loc: Jönköping, Sweden
Hi

This code give me the distinguised name
$root = GetObject("LDAP://RootDSE")
$root.GetInfo
? $root.defaultNamingContext

but how do I get the Domain name (pre-Windows 2000) name ?

/Mima

Top
#111307 - 2004-01-06 12:14 PM Re: LDAP question
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
$ldap="LDAP://"+@domain+"/"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#111308 - 2004-01-06 12:16 PM Re: LDAP question
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
look at the constatants section in: http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=81666&page=0&view=collapsed&sb=5&o=365&fpart=1
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#111309 - 2004-01-06 01:36 PM Re: LDAP question
mima Offline
Hey THIS is FUN

Registered: 2002-01-25
Posts: 217
Loc: Jönköping, Sweden
Thanks
@domain
To simple, I dident think of that ...!

/mima

Top
#111310 - 2004-01-06 03:13 PM Re: LDAP question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You did not say that a non-LDAP solution would be fine, too.
_________________________
There are two types of vessels, submarines and targets.

Top
#111311 - 2004-01-06 03:56 PM Re: LDAP question
mima Offline
Hey THIS is FUN

Registered: 2002-01-25
Posts: 217
Loc: Jönköping, Sweden
Is there a LDAP solution ?
/Mima

Top
#111312 - 2004-01-06 04:11 PM Re: LDAP question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
As posted in the very first reply:
Quote:

$ldap="LDAP://"+@domain+"/"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")


_________________________
There are two types of vessels, submarines and targets.

Top
#111313 - 2004-01-06 04:43 PM Re: LDAP question
mima Offline
Hey THIS is FUN

Registered: 2002-01-25
Posts: 217
Loc: Jönköping, Sweden
But ...
$ldap="LDAP://"+@domain+"/"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")
is a combination of LDAP and macros.
I wonderd if there was a LDAP question from ActiveDirectory that give me the same answer as @Domain.
Maybe for example GetObject("LDAP://rootDSE").Get("NetBiosDomainName").

/Mima


Top
#111314 - 2004-01-06 06:12 PM Re: LDAP question
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
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

Top
#111315 - 2004-01-06 06:14 PM Re: LDAP question
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/rootdse.asp
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#111316 - 2004-01-06 06:42 PM Re: LDAP question
mima Offline
Hey THIS is FUN

Registered: 2002-01-25
Posts: 217
Loc: Jönköping, Sweden
That was to easy, you just split the distinguised name and thought that the domain name was = the first in distinguised name.
But domain name can often be something else.(That is what the user sees in there logon prompt)
I looked at the microsoft link, but I dident find any that could fit.
Perhaps there is no other way than with the macro @domain.

/mima

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.36 seconds in which 0.27 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org