Page 1 of 1 1
Topic Options
#169749 - 2006-10-23 11:37 AM Can't figure out an LDAP-connection
Viggen Offline
Starting to like KiXtart

Registered: 2002-03-22
Posts: 110
Hi guys!

I have roamed around the board for several days now, but I can't find the answer to this...
(or more likely... It's me not being able to figure it out)

I can get this line to work:
$srvr = GetObject("LDAP://rootDSE").Get("dnsHostName")


but this returns "-2147352567 "COM exception error - catalog properties can't be found in cach memory"
$srvr = GetObject("LDAP://CN=Lastname Firstname,OU=ou2,OU=ou1,DC=our,DC=domain").Get("dnsHostName")


And if I try this, it prints "dnsHostName" to the screen and then returns "6 - The handle is incorrect"
$srvr = GetObject("LDAP://CN=Lastname Firstname,OU=ou1,OU=ou2,DC=our,DC=domain").Get("dnsHostName")


The first line returns wich server I'm logged on to...
What I'm looking for is a way to find out wich server authenticated a specific user... can it be done this way?

/Viggen

Top
#169750 - 2006-10-23 02:13 PM Re: Can't figure out an LDAP-connection
Viggen Offline
Starting to like KiXtart

Registered: 2002-03-22
Posts: 110
The strange thing is that I have used fnADODBQuery() to get the AdsPath from my account, copied that and then pasted it into the line above, and still I get error 6 ?
Top
#169751 - 2006-10-23 06:42 PM Re: Can't figure out an LDAP-connection
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
That example looks like a user. There is no dnsHostName property for User class objects.
Top
#169752 - 2006-10-23 06:50 PM Re: Can't figure out an LDAP-connection
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
See http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB13&Number=146018 for available attributes for each class.
Top
#169753 - 2006-10-23 07:53 PM Re: Can't figure out an LDAP-connection
Viggen Offline
Starting to like KiXtart

Registered: 2002-03-22
Posts: 110
I'm using the Attribs Browser alot
It's a very valuable help. Very nice tool!

I was afraid that I was trying to take one shortcut to many...

So how do I go about this then?
How can I get AD to tell me which server authenticated the specific users login?

/Viggen

Top
#169754 - 2006-10-23 08:27 PM Re: Can't figure out an LDAP-connection
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
During LOGON you can use a macro @LServer
Top
#169755 - 2006-10-23 09:43 PM Re: Can't figure out an LDAP-connection
Viggen Offline
Starting to like KiXtart

Registered: 2002-03-22
Posts: 110
Thats one way, but I wonder if there's a way of finding out from a central location (the helpdesk is at it again...)

They asked if there was a way for them to search for a username in AD and get som info, including which server authenticated the user.
(I have all the info they want, except the server-part)

I have not done to much AD-scripting, so basically it comes down to if you guys say it's not possible, then I'll just pass that answer to the helpdesk

/Viggen

Top
#169756 - 2006-10-23 10:13 PM Re: Can't figure out an LDAP-connection
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
I don't think WMI/ADSI provide that information remotely.

You could script some stuff together to get that information
if you really had to, but not sure it's really worth the
time to do or not. Guess you'd have to decide that.

First check if someone is logged on
If they are then you could use their SID and check here

$sComputer = 'system name'
$LogonServer = ReadValue($sComputer+'HKEY_USERS\their SID\Volatile Environment','LOGONSERVER')

You could also use the RemoteExec UDF and have it launch
on the remote system, read the environment, write to a file
then you read that file, etc...

Top
#169757 - 2006-10-23 11:48 PM Re: Can't figure out an LDAP-connection
Viggen Offline
Starting to like KiXtart

Registered: 2002-03-22
Posts: 110
Thanks Doc, you just gave me the answer I needed.
It can't be done
(hopefully the helpdesk-crew don't get "creative" and come upp with something else they want, so I get some time to finish a couple of other projects)

Thanks again!

/Viggen

Top
Page 1 of 1 1


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

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

Generated in 0.057 seconds in which 0.024 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