#166674 - 2006-09-04 08:33 AM
Re: Dynamic label mapped drives ?
|
Pookie62
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
|
|
|
|
#166677 - 2006-09-04 09:19 AM
Re: Dynamic label mapped drives ?
|
Pookie62
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
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
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
|
|
|
|
#166682 - 2006-09-04 11:31 AM
Re: Dynamic label mapped drives ?
|
Pookie62
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
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
|
|
|
|
#166685 - 2006-09-04 01:53 PM
Re: Dynamic label mapped drives ?
|
Pookie62
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2501 anonymous users online.
|
|
|