Page 2 of 2 <12
Topic Options
#166672 - 2006-09-04 07:46 AM Re: Dynamic label mapped drives ?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what this?
Top
#166673 - 2006-09-04 08:11 AM Re: Dynamic label mapped drives ?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Well, the two examples I gave about the way the mappings are made:
- 2 users can get different mappings;
- if a user is put in another group, his drive mappings may start shifting.

Top
#166674 - 2006-09-04 08:33 AM Re: Dynamic label mapped drives ?
Pookie62 Offline
Fresh Scripter

Registered: 2003-10-09
Posts: 37
Loc: Netherlands
Quote:


Code:

DIM $strShareRoot, $IntNoUnits, $arrUnit, $arrShare, $arrDrive, $intNextDrive, $intUnit

$strShareRoot = "\\Server\"
$arrUnit = "_Prod", "_HR", "_AP", "_APSecr", "_FA", "Helpdesk", "_PZ", "_Dir"
$arrShare = "Prod$", "HR$", "AP$", "AP$", "Fin$", "IT$", "PZ$", "Dir$"
$arrDrive = "U:", "V:", "W:", "X:", "Y:", "Z:"
$FriendlyName = "U share", "V Share", "W Share", "X Share", "Y Share", "Z Share"

For $intUnit = 0 To ubound($arrUnit)
If InGroup($arrUnit[$intUnit])
Use $arrDrive[$intUnit] $strShareRoot + $arrShare[$intUnit]
label($arrDrive[$intUnit],$FriendlyName[$intUnit])
EndIf
next






Joeel, with this code the Z is first mapped, and no other share is mapped although I am member of more unit groups.
Originally the first letter to be used is the U, then if the user is member of another group, map the next letter from the array i.e. V to the appropriate share.
Any ideas why no more mappings are made ?
Thanks..

Top
#166675 - 2006-09-04 09:07 AM Re: Dynamic label mapped drives ?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Could it be the first group you are member of is "Helpdesk"? This is the 6th group...
Top
#166676 - 2006-09-04 09:15 AM Re: Dynamic label mapped drives ?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
If these are Windows 9x systems then you can't map the Z: drive and expect to use it. The Windows 9x network redirector using the Z: drive during the logon process.
Top
#166677 - 2006-09-04 09:19 AM Re: Dynamic label mapped drives ?
Pookie62 Offline
Fresh Scripter

Registered: 2003-10-09
Posts: 37
Loc: Netherlands
No, I added myself to AP and HR, Helpdesk is the last group listed in usermanager. Also, when I run this script and there was already a connection to the IT$ share with the U letter, another connection is made with the Z letter to same share. This is not what should happen... :-0
Top
#166678 - 2006-09-04 09:21 AM Re: Dynamic label mapped drives ?
Pookie62 Offline
Fresh Scripter

Registered: 2003-10-09
Posts: 37
Loc: Netherlands
Quote:

If these are Windows 9x systems then you can't map the Z: drive and expect to use it. The Windows 9x network redirector using the Z: drive during the logon process.




No Windows 9x systems here. All Win2K SP4 or XP Pro SP2.
Servers are NT4.0

Top
#166679 - 2006-09-04 09:40 AM Re: Dynamic label mapped drives ?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Maybe the problem is that the drives are mapped persistent and "Use" has problems with them. Unmap them first.
You do not have W9x, so there should be no problem using Z: to map to.
If I read through Jooel his code, he wil map the dives more consequent. So I think you have to add two more drive letters to your list.
Code:

Dim $strShareRoot, $IntNoUnits, $arrUnit, $arrShare, $arrDrive, $intNextDrive, $intUnit

$strShareRoot = "\\Server\"
$arrUnit = "_Prod", "_HR", "_AP", "_APSecr", "_FA", "Helpdesk", "_PZ", "_Dir"
$arrShare = "Prod$", "HR$", "AP$", "AP$", "Fin$", "IT$", "PZ$", "Dir$"
$arrDrive = "S:", "T:", "U:", "V:", "W:", "X:", "Y:", "Z:"
$FriendlyName = "S share", "T Share", "U share", "V Share", "W Share", "X Share", "Y Share", "Z Share"

For $intUnit = 0 To Ubound($arrUnit)
If InGroup($arrUnit[$intUnit])
Use $arrDrive[$intUnit] /DELETE /PERSISTENT
Use $arrDrive[$intUnit] $strShareRoot + $arrShare[$intUnit]
label($arrDrive[$intUnit],$FriendlyName[$intUnit])
EndIf
Next


I think Label() is an UDF written by Jooel, you will find it in the UDF section.

Top
#166680 - 2006-09-04 10:23 AM Re: Dynamic label mapped drives ?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
maybe it is that you added yourself to the groups but didn't flush the group cache nor even logoff and log on again.
Top
#166681 - 2006-09-04 10:31 AM Re: Dynamic label mapped drives ?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
True, maybe flush cache
WKIX32 /I /F YourScript.kix

Top
#166682 - 2006-09-04 11:31 AM Re: Dynamic label mapped drives ?
Pookie62 Offline
Fresh Scripter

Registered: 2003-10-09
Posts: 37
Loc: Netherlands
Unmapped manually my U drive (IT$) ran wkix32 /i/f ../script.kix.
Now I have no U drive but the Z drive mapped to the IT share (and friendly name ICT)
No other drives, I should also have AP, Products and Dir cause I'm member of the groups.
Considering to let go of this.. taking a lot of time and effort..
Unless you are determined to get this running ?
Another weird thing:
When I use this line :
Use $arrDrive[$intUnit] /DELETE /PERSISTENT
I get no friendly name.
If I comment that line, I do get friendly name (on Z drive)
Getting stranger all the time.. (LOL)

Top
#166683 - 2006-09-04 01:23 PM Re: Dynamic label mapped drives ?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Strange, I would expect it should work.
- Are you sure you are in the groups you want the mappings for?
- Are you sure you flushed the tokencache?
- Are you sure you extended the $arrDrive with two more letters, S: and T:?
Maybe try a harder way to delete the tokencache: deltree
Maybe add some extra lines to debug the script
Start the code with:
kix32 code.kix /f
Code:

If NOT @LOGONMODE
Break On
EndIf

Dim $SO
;delete KiXtart Token Cache
$SO = DelTree("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")

Dim $strShareRoot, $arrUnit, $arrShare, $arrDrive
$strShareRoot = "\\Server\"
$arrUnit = "_Prod", "_HR", "_AP", "_APSecr", "_FA", "Helpdesk", "_PZ", "_Dir"
$arrShare = "Prod$", "HR$", "AP$", "AP$", "Fin$", "IT$", "PZ$", "Dir$"
$arrDrive = "S:", "T:", "U:", "V:", "W:", "X:", "Y:", "Z:"

For $intUnit = 0 To Ubound($arrUnit)
If InGroup($arrUnit[$intUnit])
Use $arrDrive[$intUnit] /DELETE /PERSISTENT
Use $arrDrive[$intUnit] $strShareRoot + $arrShare[$intUnit]
Else
? "Not in group " $arrUnit[$intUnit]
EndIf
Next
Sleep 60


I hope this helps you finding where the errors are situated. Good luck!

Top
#166684 - 2006-09-04 01:29 PM Re: Dynamic label mapped drives ?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you are not using the script I wrote.

Top
#166685 - 2006-09-04 01:53 PM Re: Dynamic label mapped drives ?
Pookie62 Offline
Fresh Scripter

Registered: 2003-10-09
Posts: 37
Loc: Netherlands
Damn, I feel dumb..!!
It was the not logging of..(yeah, you told me..(shame on me)) therefor I still wasn't in the groups I wanted.
Sorry guys.. thanks very much for supporting me, it's working fine now..

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
0 registered and 2375 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.069 seconds in which 0.029 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org