Page 1 of 1 1
Topic Options
#119111 - 2004-05-06 01:09 PM Enumerating groups
kix_newbie Offline
Lurker

Registered: 2004-05-06
Posts: 4
Hi,

I'm trying to create a login script to enumerate a whole bunch of global groups and map drives according to group membership in a loop.

I've got an example of what we've tried so far but with no success.


$scriptroot = @LDRIVE+"scripts"
$Index = 0

DO
$Group = ENUMGROUP( $Index )
If len( $Group ) > 0
$Scriptprefix = Substr( $Group, 1, 3)
If $Scriptprefix = "Glo"
$Scriptname= Substr ($Group, 9, 4)
If $scriptname = "elec"
USE T: \\UKDUMF06\ELECTRA
USE L: \\UKPAVF03\ELECTRA
USE J: \\ESMADA10\ELECTRA
endif
Endif
Endif
$Index = $index + 1
UNTIL Len( $Group ) = 0

$Index = 0

Any help would be greatly appreciated.


Edited by kix_newbie (2004-05-06 01:11 PM)

Top
#119112 - 2004-05-06 01:31 PM Re: Enumerating groups
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh.
having some information about what is not happening would be great.
seeing that the syntax is fine does not help.

I bet your script runs but the result is unexpected.
_________________________
!

download KiXnet

Top
#119113 - 2004-05-06 01:40 PM Re: Enumerating groups
kix_newbie Offline
Lurker

Registered: 2004-05-06
Posts: 4
Sorry.

I wasn't sure about the syntax.

the script runs but the drives don't map. I've tried altering the end results if the script runs correctly but I get the same problem:

Nothing happens!

Top
#119114 - 2004-05-06 02:05 PM Re: Enumerating groups
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
you should wrap the paths to the shares in quotes

hint: USE T: "\\UKDUMF06\ELECTRA"


Edited by Jochen (2004-05-06 02:06 PM)
_________________________



Top
#119115 - 2004-05-06 02:21 PM Re: Enumerating groups
kix_newbie Offline
Lurker

Registered: 2004-05-06
Posts: 4
I thought that but it doesn't seem to make a difference if it is in quotes or not
Top
#119116 - 2004-05-06 02:45 PM Re: Enumerating groups
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, like said, the code looks fine.
so, try to improve it to find any possible brain-fart that might be going on.

that meaning, instead of just doing:
Code:

DO
$Group = ENUMGROUP( $Index )
If len( $Group ) > 0
$Scriptprefix = Substr( $Group, 1, 3)
If $Scriptprefix = "Glo"
$Scriptname= Substr ($Group, 9, 4)
If $scriptname = "elec"
USE T: \\UKDUMF06\ELECTRA
USE L: \\UKPAVF03\ELECTRA
USE J: \\ESMADA10\ELECTRA
endif
Endif
Endif
$Index = $index + 1
UNTIL Len( $Group ) = 0



try something like:
Code:

DO
$Group = ENUMGROUP( $Index )
If len( $Group ) > 0
$Scriptprefix = Substr( $Group, 1, 3)
If $Scriptprefix = "Glo"
"is glo "
$Scriptname= Substr ($Group, 9, 4)
If $scriptname = "elec"
USE T: \\UKDUMF06\ELECTRA
USE L: \\UKPAVF03\ELECTRA
USE J: \\ESMADA10\ELECTRA
else
"but not elec (" $group ")" ?
endif
else
"not glo group (" $group ")" ?
Endif
Endif
$Index = $index + 1
UNTIL Len( $Group ) = 0


_________________________
!

download KiXnet

Top
#119117 - 2004-05-06 03:00 PM Re: Enumerating groups
kix_newbie Offline
Lurker

Registered: 2004-05-06
Posts: 4
Tried what you suggested but still doesn't seem to search through the groups properly.

Thanks for your help. I'll keep trying

Top
#119118 - 2004-05-06 03:59 PM Re: Enumerating groups
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, I didn't provide you any solution, just a way to go about it.
if you can't get something to work, you need to think why it doesn't work.
_________________________
!

download KiXnet

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
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.062 seconds in which 0.028 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