Page 1 of 1 1
Topic Options
#16011 - 2002-01-10 11:11 PM FQDN of User
JFailla Offline
Lurker

Registered: 2002-01-10
Posts: 4
As a newbie to scripting I'm easily stumped with a seemingly easy task. I'm trying to get the FQDN from AD for the currently logged in user. I can get the default naming context but our users are in different OUs and I can't figure out how to get their FQDN in their logon script.
Top
#16012 - 2002-01-10 11:51 PM Re: FQDN of User
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Run this on a Windows 2000 workstation, does it provide pieces of what your looking for ?

[I can't try it - hope it works for you]


?"UserInfo=" createobject("adsysteminfo").username

?"MachineInfo=" createobject("adsysteminfo").computername

-Shawn

[ 10 January 2002: Message edited by: Shawn ]

Top
#16013 - 2002-01-11 12:03 AM Re: FQDN of User
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
Working with AD seems easy but in fact, it can lead to headhaches
Can you explain what you mean by FQDN

Shawn,
always sticky to "dunno if it works ?"
Trust me, this one really works, unless no session is opened on the AD domain

_________________________
? getobject(Kixtart.org.Signature)

Top
#16014 - 2002-01-11 12:07 AM Re: FQDN of User
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
This time I really mean it ... I'm at home right now and I'm not connected to a network and don't have AD running (lol)

-Shawn

Oh yeah, and I tried to get clever with nested object references, like this:

?"MachineInfo=" createobject("adsysteminfo").computername

One statement does all (lol)

[ 11 January 2002: Message edited by: Shawn ]

Top
#16015 - 2002-01-11 01:02 AM Re: FQDN of User
JFailla Offline
Lurker

Registered: 2002-01-10
Posts: 4
Here's what I'm after. I'm using a combination of .bat, .kix and .vbs scripts for the base logon scripts. Periodically, I would like the user to verify certain AD information for themselves, like phone and FAX#s. I can use an LDAP query to get the user info IF I know their location within AD.

For example if all users are in ou=users,dc=mydomain,dc=com I've got no problem but I've got one domain that encompases the entire state court system so its broken out into several OUs like ou=users,ou=county1,dc=courts... To call a simple script to have the user update their phone number monthly I'd have to maintain at a minimum 15-20 different scripts, the only difference being the LDAP query. I could check group membership or use a filter but neither seems like the best way. It just seems like their should be a simple way to get the information but as I mentioned in my original post I'm new to this stuff so...

Top
#16016 - 2002-01-11 01:08 AM Re: FQDN of User
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
This ...

?"UserInfo=" createobject("adsysteminfo").username


will give you the user's fully qualified DN within AD - but it only works on 2K and XP ... using this addy, you can lookup just about anything you want ...

-Shawn

Top
#16017 - 2002-01-11 01:29 AM Re: FQDN of User
JFailla Offline
Lurker

Registered: 2002-01-10
Posts: 4
Can't wait to try it tomorrow. Thanks.
Top
#16018 - 2002-01-11 06:29 PM Re: FQDN of User
JFailla Offline
Lurker

Registered: 2002-01-10
Posts: 4
It worked. Thanks.
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 735 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.136 seconds in which 0.07 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