#118189 - 2004-04-18 11:38 AM
Enumgroup
|
Mattps
Fresh Scripter
Registered: 2004-04-18
Posts: 12
|
I have only been using KIXtart for a short while and have been playing with the enumgroup function. Can any one tell me what order enumgroup returns groups from a users account details. e.g. return groups alphabetically or by SID.
Thanks.
|
|
Top
|
|
|
|
#118191 - 2004-04-18 03:41 PM
Re: Enumgroup
|
Mattps
Fresh Scripter
Registered: 2004-04-18
Posts: 12
|
I need to know what order they are enumerated in because I am trying to map 4 drive letters to user specific folders and one on the folders needs to be mapped to S: depending on the group. Is there relationship in the order the groups are listed in AD U&C and when enumerated?
|
|
Top
|
|
|
|
#118193 - 2004-04-18 05:19 PM
Re: Enumgroup
|
Mattps
Fresh Scripter
Registered: 2004-04-18
Posts: 12
|
Okay here goes... Currently we reorganising out folder structure on our file srevers so that the follow convention is ahered to:
Shared folder | |-Organisation 1 | |-Department 1 | | |-Departmental folders | |-Department 2 | |-Departmental folders |-Organisation 2 |-Department 1 | |-Departmental folders |-Department 2 |-Departmental folders
Department global groups have been created to apply to each resource (can't use DLG's as still in Mixed mode) so that each department folder can only be accessed by their repsective departments. The standard convention is that shared folder mappings use the S: drive.
However, and this is were I get a headache...
One particular organisation historically accessed multiple deparmental folders. So we have allocated 4 drive letters for use with shared folders S:, N:, O:, and T: - I swear I didn't pick these!
One of our techs wrote a script so that should a user be a member of multiple groups it would map more than one drive. But the script was just a list of Ingroup statements that had no structure and users would end up 2 or drive mappings to the same locations because one person in the department accessed more than one share. So I have written the below script which works on my test network. However and this is where I am stumped. Because historically the default shared drives where mapped to the s: I want to carry this on. When my script runs it enumerated the groups that a use is in and then assigns one of the available drive letters whether it be S:, N:, O: or T:. If there was a way to get KIX to enumerate a users group membership in the same order as shown in AD U&C then I could put the primary froup at the top of the membership list and this would following in the script enumeration and would be assigned as S:. I know this sounds complicated, here is what I have come up with so far:
CLS DIM $Index DIM $DriveIndex DIM $NextDrive Dim $Temp GLOBAL $Group[40] $Index = 0 DO $Group[$Index]=0 $Index=$Index+1 UNTIL $Index=40 $Index=0 DO $Group[$Index] = ENUMGROUP($Index) $Index = $Index + 1 UNTIL Len($Group[$Index]) = 0 $DriveIndex = 0 $Index = 0 DO SELECT CASE $DriveIndex = "0" $NextDrive = "S:" CASE $DriveIndex = "1" $NextDrive = "N:" CASE $DriveIndex = "2" $NextDrive = "O:" CASE $DriveIndex = "3" $NextDrive = "T:" ENDSELECT $Temp = $Group[$Index] IF $Temp = "HOME\gRPCTDept1" USE $NextDrive "\\hmdc01\shared\rpct\Department 1" $DriveIndex = $DriveIndex + 1 ENDIF IF $Temp = "HOME\gRPCTDept2" USE $NextDrive "\\hmdc01\shared\rpct\Department 2" $DriveIndex = $DriveIndex + 1 ENDIF IF $Temp = "Home\gRPCTDept3" USE $NextDrive "\\hmdc01\shared\rpct\Department 3" $DriveIndex = $DriveIndex + 1 ENDIF $Index = $Index + 1 UNTIL ($DriveIndex = 4) OR ($Index = 40) OR ($Temp = 0)
|
|
Top
|
|
|
|
#118196 - 2004-04-18 06:20 PM
Re: Enumgroup
|
burnsc
Starting to like KiXtart
Registered: 2004-04-14
Posts: 171
|
There is another aspect to this too. It really adds highly to 'support costs' as well. Add this to the fact if you ever reach a point where you are 'pushing' or 'pulling' application images it makes you not be able to trust your own drive mappings. It is best (as Les said in less words) to group directories to as few shares as possible and use pathing in the applications. At least this has been my experience.
|
|
Top
|
|
|
|
#118197 - 2004-04-19 09:58 AM
Re: Enumgroup
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Have to agree.
I have a tree structure which maps Organisation, Region and office/branch.
The business requirement was that users only see "their" information, because it was deemed that they were too stupid to be able to navigate a three tier folder tree.
This means that local staff mapped to the office share, regional managers to the region share so that they can see all of their depots, and Divisional manager mapped to the top level.
This has been an administrative nightmare, and I'm doing stealth changes to move everyone to the top of the tree and use application path settings to access files at the right level.
Much simpler, much less hassle and sooo much easier when the branches get re-organised.
So, stick to a single share, use file/directory permissions to control access and set the paths for applications on the fly at login.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1471 anonymous users online.
|
|
|