Page 1 of 3 123>
Topic Options
#117328 - 2004-04-06 12:33 AM LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
Please, i need help!
See this code and help me:

$user_dep=GetObject("LDAP://cn=user.department,cn=user.samAccountname,ou=users,dc=aaa,dc=com")
use g: "\\server" +$user_dep + "$"

And not map...Why? Please

Top
#117329 - 2004-04-06 01:05 AM Re: LDAP
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Well...Im not an LDAP expert but I couldnt get the query line you posted to return anything. There was also a missing "\" in the drive mapping statement. I was able to get the below code to work in my env....Give it a shot.

Code:
$user_dep=GetObject("LDAP://CN="+@FullName+",OU=users,DC=aaa,DC=com")
use g: "\\server\"+$user_dep.department+"$"


Top
#117330 - 2004-04-06 01:23 AM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
No Citrix, error in use..????...

Top
#117331 - 2004-04-06 01:25 AM Re: LDAP
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Rod

Probably the easiest thing to do is copy and save this script from Chris.

KiXforms - Active Directory Browser
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=91082


You will need to download and install KiXforms DLL from here
http://www.kixforms.com

Then when you run it you can browse to the object you want and copy/paste the LDAP location into your script.

Top
#117332 - 2004-04-06 01:56 AM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
Please NTDOC!
I did not understand.
What I must after make to catch the code? And the archive kixforms.dll? What I must make with it?

Forgive me, I am new in kix

Top
#117333 - 2004-04-06 02:08 AM Re: LDAP
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
copy the script that Chris posted on the board at the link I provided.

Then save that script in a text file and give it a name.

Then download the KIXFORMS from the KiXforms link I provided.

Open the file and extract it to your local system. Copy the DLL to your %windir%\system32 folder then run

REGSVR32.EXE KIXFORMS.DLL to register it.

Then in a DOS window where you saved the file from Chris.

run something like

C:\SCRIPTS\KIX32.EXE ADBROWSER.KIX

Which should then open a GUI window you can use to browse your AD and copy paths with it.

Top
#117334 - 2004-04-06 02:23 AM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
Whel....!!!!
I don't no...
Error in line 29 and 43 and 44...i'm desesperaid
Sorry friend...

Top
#117335 - 2004-04-06 02:43 AM Re: LDAP
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Please post what your code is. I don't know what you have on those lines.

Please use the CODE TAGS of Instant UBB Code to keep the code formatting when posting.

Top
#117336 - 2004-04-06 02:46 AM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
Whel, i'm copy code to this site.
CTRL+C / CTRL+V...accurately equal

Top
#117337 - 2004-04-06 02:56 AM Re: LDAP
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Rod,

Please post the contents of your script here on the board so that we can see what is on those lines you said give errors.

We can't see the code, so we have no idea what is going on.

Top
#117338 - 2004-04-06 03:05 AM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
no friend, sees well, forgives me:
this error is giving in script of chris s., that you indicated me above.

Top
#117339 - 2004-04-06 03:24 AM Re: LDAP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Please read ABC's of KiXtart board etiquette and message to new forum users , especially Section F.

It doesn't help us if you say there's an error and then don't even adequately describe the error. did youfollow the instructions given to you and did each step succeed? Did the DLL register correctly? Do you even see a form? Did you copy the code correctly, see the FAQ forum for info on this.
_________________________
There are two types of vessels, submarines and targets.

Top
#117340 - 2004-04-06 03:30 AM Re: LDAP
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Rod...

The code snippet I posted does work. I tested it in my domain at work. My guess is you dont know what the correct path of the user object is and thats probably why Doc is trying to get you to use the kixforms script to get the path. Is the user object in the users OU or is it in a different OU? That will effect where you query the dept from.

Top
#117341 - 2004-04-06 03:35 AM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
Sorry Sealeopard...
Citrix and NTDOC, this error is in line 29 =
$imglarge.imagesize = 32,32


Top
#117342 - 2004-04-06 03:50 AM Re: LDAP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Yo still did not answer any of the other questions. Did the DLL get registered correctly? What Kixtart and KiXforms version?
_________________________
There are two types of vessels, submarines and targets.

Top
#117343 - 2004-04-06 02:19 PM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
Ok Sealeopard, thanks...
DLL registered ok and versions of kix is:
Kixtart - 4.22
Kixforms - 2.2.0

Top
#117344 - 2004-04-06 02:50 PM Re: LDAP
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I think that this is what you're ultimately after...

Code:

$user_dep = GetObject("LDAP://CN=USERNAME,OU=users,DC=aaa,DC=com").Department
use g: "\\server\" + $user_dep + "$"



Top
#117345 - 2004-04-06 03:09 PM Re: LDAP
RodteX Offline
Fresh Scripter

Registered: 2004-03-23
Posts: 22
No map Chris...

Top
#117346 - 2004-04-06 03:16 PM Re: LDAP
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Is the value for $user_dep correct?
Top
#117347 - 2004-04-06 03:19 PM Re: LDAP
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Rodtex,
You are not very helpful with the level of info you give. Why don't you break up the task into sections and test each one, repiorting the results of each.

What does the var $user_dep return?
Does it work if you hard code the USE statement?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 3 123>


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

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.074 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

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