Page 1 of 1 1
Topic Options
#131391 - 2004-12-15 11:17 PM Active Directory Groups and Drive Mapping
susan_ling Offline
Lurker

Registered: 2004-12-15
Posts: 1
first of all i am new here and having a hard time finding the post link / start a new topic.

anyways, need help here with the script.

somehow the drives do not map. the only one that does is the one outside the loop.

where am i going wrong. susan_ling@yahoo.com




Dim $server1
Dim $server2
Dim $index
Dim $group
Dim $profile
Dim $location
Dim $dom

; *** assign values to the variables here ***
$server1 = "lantestsvr"
$server2 = "lantestsvr"
$dom = "lantest"

DO
$group = ENUMGROUP($index)

IF $group="Accounting" Or $group="lantest\Accounting"
USE U: "\\$server1\groups\accounting"
ENDIF

IF $group="FoodBeverage" Or $group="lantest\FoodBeverage"
USE V: "\\$server1\groups\foodbeverage"
ENDIF

IF $group="HumanResource" Or $group="lantest\HumanResource"
USE W: "\\$server1\groups\humanresource"
ENDIF

IF $group="Programs" Or $group="lantest\Programs"
USE H: "\\$server1\groups\programs"
ENDIF

UNTIL Len($group) = 0

USE Q: "\\$server1\public"

EXIT

Top
#131392 - 2004-12-16 01:48 AM Re: Active Directory Groups and Drive Mapping
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Welcome to the board, Susan. The Post link is sitting next to the Previous, Index, Next, Expand,and Collapse links. Please be sure to visit the FAQ forum for some helpful information on getting started with KiX.

Now, to help you with your immediate problem. It looks like you haven't used the EnumGroup function properly. I don't think you need to use it anyway. Here is a re-write of your code to map shares based off of group membership...

Code:

Dim $server1, $server2

; *** assign values to the variables here ***
$server1 = "lantestsvr"
$server2 = "lantestsvr"
$dom = "lantest"

IF InGroup("Accounting","lantest\Accounting")
USE U: "\\$server1\groups\accounting"
ENDIF

IF InGroup("FoodBeverage","lantest\FoodBeverage")
USE V: "\\$server1\groups\foodbeverage"
ENDIF

IF InGroup("HumanResource","lantest\HumanResource")
USE W: "\\$server1\groups\humanresource"
ENDIF

IF InGroup("Programs","lantest\Programs")
USE H: "\\$server1\groups\programs"
ENDIF

USE Q: "\\$server1\public"

EXIT



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

Generated in 0.103 seconds in which 0.079 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