Page 2 of 2 <12
Topic Options
#33319 - 2002-11-25 05:53 PM Re: Script not running....
Nick O'Connor Offline
Fresh Scripter

Registered: 2002-11-22
Posts: 12
What does the 0 or 1 do?

And does the IN GROUP work for AD?

It doesn't seem to....

Top
#33320 - 2002-11-25 05:56 PM Re: Script not running....
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Exit is explained in the manual. 0 or 1 is passed as ERRORLEVEL.

It's InGroup not INGROUP and it does work with AD.

What version of KiX?

What type of AD group?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#33321 - 2002-11-25 07:14 PM Re: Script not running....
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Looks like a Wintendo issue...
Search the BB on 'deep mapping' for a kixillion hits on mapping on Win9x
_________________________
We all live in a Yellow Subroutine...

Top
#33322 - 2002-11-25 07:30 PM Re: Script not running....
Nick O'Connor Offline
Fresh Scripter

Registered: 2002-11-22
Posts: 12
Here is the latest.

? "Creating local user environment....."
use h: /delete /persistent
use h: '\\server\'+@USERID+'$$'
IF InGroup("UserGroup")
USE P: '\\server\'share'
USE S: '\\server\'share2'
Endif
EXIT

The P and S drive mappings are not working.

It is the lateset version of Kix, and the AD group is a simple Global Security Group, which lives a few OU's down from the root.

Top
#33323 - 2002-11-25 07:35 PM Re: Script not running....
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You have too many quotes in the share name.

'\\server\'share'

should be: '\\server\share'
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#33324 - 2002-11-25 07:38 PM Re: Script not running....
Nick O'Connor Offline
Fresh Scripter

Registered: 2002-11-22
Posts: 12
oh man.....

Sometimes your just to close to a problem.

Thanks, I'll try that now.

Top
#33325 - 2002-11-25 08:00 PM Re: Script not running....
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Now that you have a working Kix script...

You can add the MapDrive UDF to your code if you like and then use:
code:
MapDrive($Drive, $Server, $Share)
MapDrive("P:", "Venus", "Data")

The function takes care of making sure any exisiting mapping using the drive letter is deleted, mapping the drive, checking the success or failure, reporting the status, and logging the mapping/status if you include the Writlog UDF.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#33326 - 2002-11-25 08:26 PM Re: Script not running....
Nick O'Connor Offline
Fresh Scripter

Registered: 2002-11-22
Posts: 12
code:
If @Homeshr<>""
Dim $x
$x=Substr($Homeshr,3,len($Homeshr)-2)
$Hserver=Substr($x,1,instr($x,"\")-1)
$UserShare=Substr($x,instr($x,"\")+1,len($x)-instr($x,"\"))
Endif
If $HomeDrive<>"" and $Hserver<>"" and $UserShare<>""
MapDrive($HomeDrive, $Hserver, $UserShare)else
Writelog("Home drive is either not defined or improperly defined for this user: Drive='" +
$HomeDrive + "', Server='" + $Hserver + "', Share='" + $UserShare + "'")
endif
Function MapDrive($Drive, $Server, $Share)
Dim $Drive, $Server, $Share
Color c+/n
If $Drive<>"" and $Server<>"" and $Share<>""
$LogText="Connecting $Drive to \\$Server\$Share"
? $LogText
USE $Drive /Delete /Persistent
USE $Drive "\\$Server\$Share"
If @error=0
color g+/n
$x=" - Success"
"$x"
Else
color r+/n
$x=" - Failed: Error @error"
"$x"
$ErrorState=1
Endif
WriteLog ($LogText + $x)
Color w+/n
Else
WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'") Endif
Endfunction
;
;And THEN put in
;

IF InGroup("UserGroup")
MapDrive("P:", "Venus", "Data")
Endif

????

{edit} Added code tags. - Bullock

[ 25. November 2002, 21:16: Message edited by: Howard Bullock ]

Top
#33327 - 2002-11-25 08:40 PM Re: Script not running....
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please read How to use UDFs and include ALL UDFs that your are using, e.g. MapDrive and WriteLog.

And read HOWTO: Submit code to / copy code from the board
_________________________
There are two types of vessels, submarines and targets.

Top
#33328 - 2002-11-25 08:49 PM Re: Script not running....
Nick O'Connor Offline
Fresh Scripter

Registered: 2002-11-22
Posts: 12
Nice, thanks. You guys have been great.

The only issue I have left is the 8 chaecter limit.

It all works great if the group name I am querying, and the share name I am connecting to are 8 charecters or less.

Otherwise, doens't seem to like it.....

Top
#33329 - 2002-11-25 08:59 PM Re: Script not running....
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
There is no 8-character limit. However, there are WINS limits at 15 characters and group name limits at 20 characters under certain circumstances that depend on your network architecture. These limits are discussed in a post on this BBS, use the BBS Search to find it.
_________________________
There are two types of vessels, submarines and targets.

Top
#33330 - 2002-11-25 09:11 PM Re: Script not running....
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Nick...
quote:
The only issue I have left...
Given that you're almost out of immediate issues, you now have time to expand your KiX horizons with KiXstrip utility. I've always wished that I'd gotten onto this sooner rather than later --> How do we check and format code for scripts?
Hope this helps... [Wink]
_________________________
We all live in a Yellow Subroutine...

Top
Page 2 of 2 <12


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

Who's Online
1 registered (Allen) and 675 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.157 seconds in which 0.08 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