Page 1 of 1 1
Topic Options
#166729 - 2006-09-01 07:29 PM Howqards InContainer problem
pfarrelli Offline
Fresh Scripter

Registered: 2005-11-16
Posts: 46
Code below keeps returning -1 :-( HELP!

I have also used @wksta and "@wksta" as second parameter and they fail as well ...

? @wksta returns correct workkstation name

-------------------
;connect to Soc Grad Lab Printer if computer is on Soc Grad OU
IF INGROUP ("CASCOMP")
? @wksta
$rc = InContainer("OU=ou_Labs, OU=SocGradLab_OU, DC=cas, DC=univ, DC=albany, CD=edu", "PFARRELLOFF")

select
case $rc[0]=1
IF AddPrinterConnection ("\\p2\soc_gr_ric4510") = 0
? "Connecting to the Ricoh 4510 in the Sociology Grad Lab"
ENDIF
case $rc[0]=2 ? "RC is 2"
case $rc[0]=0 ? "RC is 0"
case $rc[0]=-1 ? "RC is -1"
case $rc[0]=-2 ? "RC is -2"
case 1 ? "RC is Unknown"
endselect
ENDIF

------------------

Top
#166730 - 2006-09-01 07:42 PM Re: Howqards InContainer problem
pfarrelli Offline
Fresh Scripter

Registered: 2005-11-16
Posts: 46
FYI ..... -1 also means Invalid input for $NameType

I don't get why .. seems like fantastic input to me!!

Top
#166731 - 2006-09-01 07:50 PM Re: Howqards InContainer problem
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
AFAIK Howards UDF infers @UserID or @WkSta and does not support a second parm that way. That said, I modified it for my own use to support a third parm.

Borrowing from his liner notes:
$NameType (Required)
- String value
"Computer" or "User" are currently the only valid values


Edited by Les (2006-09-01 07:55 PM)

Top
#166732 - 2006-09-01 08:02 PM Re: Howqards InContainer problem
pfarrelli Offline
Fresh Scripter

Registered: 2005-11-16
Posts: 46
As my post says, I even tried a computer name directly "pfarrelloff" and it still doesn't work. :-( Any other thoughts?
Top
#166733 - 2006-09-01 08:06 PM Re: Howqards InContainer problem
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Perhaps you missed that I edited my post and added to it.
"Computer" or "User" are currently the only valid values.

Top
#166734 - 2006-09-01 08:06 PM Re: Howqards InContainer problem
pfarrelli Offline
Fresh Scripter

Registered: 2005-11-16
Posts: 46
On further thought (and inspection) I see what you are saying ..

I put just "comptuer" as second parameter as I now see it is not the name of the comptuter that is needed, but an indication of what you are looking for (computer or user).

Sad thing is that now it returns "0", Object not found in container. It si there however.

Thoughts?

Top
#166735 - 2006-09-01 08:07 PM Re: Howqards InContainer problem
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
In other words, it should be:
$rc = InContainer("OU=ou_Labs, OU=SocGradLab_OU, DC=cas, DC=univ, DC=albany, DC=edu", "Computer")


Edited by Les (2006-09-01 08:10 PM)

Top
#166736 - 2006-09-01 08:09 PM Re: Howqards InContainer problem
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
CD=edu
perhaps:
DC=edu

Top
#166737 - 2006-09-01 08:12 PM Re: Howqards InContainer problem
pfarrelli Offline
Fresh Scripter

Registered: 2005-11-16
Posts: 46
BAM!! DC? ... CD? .. what's the difference anyway?

I would say that was a dummazz mistake. Thanks SO much!

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 1183 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.065 seconds in which 0.031 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