#117348 - 2004-04-06 03:36 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
Whel, a value of return is: $user_dep...  I don't understending...
|
|
Top
|
|
|
|
#117349 - 2004-04-06 03:55 PM
Re: LDAP
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Run this and post your results...
Code:
$User = GetObject("LDAP://CN=USERNAME,OU=Users,DC=aaa,DC=com") @ERROR " | " @SERROR ? "Username: " $User.samAccountName ? "Department: " $User.Department ?
|
|
Top
|
|
|
|
#117350 - 2004-04-06 04:17 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
Ok Chris, tks... @error = -2147221014 | Moniker can not open file  Username: blanck Department: blanck
|
|
Top
|
|
|
|
#117351 - 2004-04-06 04:40 PM
Re: LDAP
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Please run this script and post the results...
Code:
Break On
$nul=SetOption("WrapAtEOL","On")
$FQDN = TranslateName (3,"",3,"@LDOMAIN\@USERID",1) If @ERROR @ERROR " | " @SERROR ? Else "Fully Qualified Domain Name: " + $FQDN ?
$User = GetObject("LDAP://" + $FQDN) If @ERROR @ERROR " | " @SERROR ? EndIf "Username: " $User.samAccountName ? "Department: " $User.Department ? EndIf
Function TranslateName ($InitType, $BindName, $LookupNameType, $LookupName, $ReturnNameType)
Dim $InitType, $BindName, $LookupNameType, $LookupName, $ReturnNameType Dim $NameTranslate, $ReturnName, $Error, $ErrorText
$Error = 0 $ErrorText = "" $ReturnName = "" $NameTranslate = CREATEOBJECT ("NameTranslate") if @Error = 0 $NameTranslate.Init ($InitType, $BindName) if @Error = 0 $NameTranslate.Set ($LookupNameType, $LookupName) if @Error = 0 $ReturnName = $NameTranslate.Get($ReturnNameType) endif endif endif $TranslateName = $ReturnName If @ERROR<0 Exit VAL("&"+Right(DecToHex(@ERROR),4)) EndIf Endfunction
|
|
Top
|
|
|
|
#117352 - 2004-04-06 04:48 PM
Re: LDAP
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I find that: GetObject("LDAP://CN=USERNAME,OU=Users,DC=aaa,DC=com")
will not work when executing this code on a client computer unless you also specify a domain or server name as part of the LDAP string.
GetObject("LDAP://NetBIOSDomain/CN=USERNAME,OU=Users,DC=aaa,DC=com") or GetObject("LDAP://server/CN=USERNAME,OU=Users,DC=aaa,DC=com")
This tells where the LDAP bind should take place.
|
|
Top
|
|
|
|
#117353 - 2004-04-06 06:28 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
Hey Chris, very tks to help me... Error in execute script is: 9 | the address of the blocks of storage control is invalid
And Howard, this option not valid, no map...
|
|
Top
|
|
|
|
#117356 - 2004-04-06 07:54 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
AD 2003
|
|
Top
|
|
|
|
#117358 - 2004-04-06 08:04 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
Windows 98, Windows 2000 and Windows XP (Brazilian version too)
|
|
Top
|
|
|
|
#117360 - 2004-04-06 08:22 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
Win 2K Pro
|
|
Top
|
|
|
|
#117361 - 2004-04-06 08:29 PM
Re: LDAP
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
|
|
Top
|
|
|
|
#117362 - 2004-04-06 09:08 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
Whel....!!!! I don't no... Error in line 29 and 43 and 44... I give up
|
|
Top
|
|
|
|
#117364 - 2004-04-06 09:23 PM
Re: LDAP
|
RodteX
Fresh Scripter
Registered: 2004-03-23
Posts: 22
|
Hey Sealeopard, I need CTRL+C/CTRL+V, but i don't understend, no work... Sorry...and tks for help
|
|
Top
|
|
|
|
#117365 - 2004-04-06 09:28 PM
Re: LDAP
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Try this....
Click on the the link below and download the script and run it. As long as you have the kixforms.dll registered it should work fine.
AD_Browser.kix
Once you run the AD_Browser.kix script you should be able to browse to a user and copt the correct LDAP path of that user.
|
|
Top
|
|
|
|
#117366 - 2004-04-06 09:39 PM
Re: LDAP
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Better yet...Try downloading this script. It is a stripped down version of the script that Chris posted above using the TranslateName UDF. That way it will work for any user no matter their AD directory.
ldap_dept.kix
The only thing you have to change in the script is the server to map the drive to...It is currently \\server\ and you will need to change this to your server name. Besides that there should be no needed changes. See if it works.
|
|
Top
|
|
|
|
#117367 - 2004-04-06 10:17 PM
Re: LDAP
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
A tip..
Copy the script to the clipboard.. Paste into Word/WordPad. Copy from Word/WordPad, and paste into NotePad. The code formatting should come out right.
Kent
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|