#176977 - 2007-06-14 02:35 PM
AD login script which maps network drives
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
Hi, Is it possible to create a kix script that map networkdrives in a way so that they reconnect at each logon? (like the option "reconnect at logon" when you manually map a drive) We are currently running this logon script, but lately it has been nothing but trouble. What I need is a kix script to map all the drives with reconnect at logon, so I can run this once on each client, instead of having to do it manually on each computer. Is that possible?
;
; KIXTART.SCR
;
; Bioimage Kixtart Logon script ver. 1.7
;
CLS
;SetTime "\\Vale"
;AT (1,1)@userid ; ...and some macro's
;AT (2,1)@fullname
;AT (3,1)@wksta
;AT (4,1)@lserver
;AT (5,1)@INWIN
; Mapping Std. drive to everybody
Use "*" /Delete ; Delete all mappings
;Bohr
Use L: "\\Bohr\Programs$" ; Maps Programs Drive
Use M: "\\bohr\Compound$" ; Maps Incell Data
Use N: "\\bohr\AssayDev$" ; Maps Incell Data
Use O: "\\Bohr\Swapzone" ; Maps the SwapZone
Use P: "\\Bohr\@userID$" ; Maps the Personal drive
Use Q: "\\Bohr\Projects$" ; Maps Project drive
Use R: "\\Bohr\Functions$" ; Maps Functions drive
Use T: "\\Bohr\Templates$" ; Maps Templates drive
;Armenius
Use U: "\\Armenius\Compound_data" ; Maps Compound_data på Armenius
Use Y: "\\Armenius\Assay_development_data" ; Maps Assay data drive
Use Z: "\\Armenius\Docstore$" ; Maps the Docstore drive
Use I: "\\Armenius\BioImage Procedure Library (BIPL)" ; Maps the New SOP-File drive
If @userid ='Jadc'
Use V: "\\Bohr\software$" ; Maps Software drive for specific users
EndIf
If @userid ='LaKN'
Use V: "\\Bohr\software$" ; Maps Software drive for specific users
EndIf
If @INWIN = 2
;Use W: "\\Thor\win98$"
Use Y: "\\Armenius\assay_Data"
Use J: "\\Armenius\comdata"
EndIf
If @wksta = LSM_MICRO
Goto End
EndIf
If @wksta = INcell_PC
Goto End
EndIf
If @wksta = ALPHA5
Goto End
EndIf
if @wksta = zymark
Goto End
Endif
; Antivirus
If @WKSTA = odin
Goto end
Else
Goto Thor
EndIf
:Thor
If @WKSTA = Thor
Goto end
Else
Goto Bohr
EndIf
:Bohr
If @WKSTA = Bohr
Goto end
Else
Goto Armenius
EndIf
:Armenius
If @WKSTA = Armenius
Goto end
Else
Goto end
EndIf
:end
Cookie1
|
Top
|
|
|
|
#177003 - 2007-06-15 12:47 PM
Re: AD login script which maps network drives
[Re: Les]
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
So, for instance:
Use L /persistent: "\\Bohr\Programs$"
?
Thank you in advance
|
Top
|
|
|
|
#177004 - 2007-06-15 12:55 PM
Re: AD login script which maps network drives
[Re: lakn]
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Yes that's right, though more usually like this:
USE "L:" "\\Bohr\Programs$$" /PERSISTENT
|
Top
|
|
|
|
#177005 - 2007-06-15 01:24 PM
Re: AD login script which maps network drives
[Re: Richard H.]
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
Thank you both. I will give it a try
|
Top
|
|
|
|
#177010 - 2007-06-15 01:58 PM
Re: AD login script which maps network drives
[Re: lakn]
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
Hi Again Is it possible to create a condition for mapping the drives, like if the drive "L:" is allready mapped -> do nothing, else USE "L:" "\\Bohr\Programs$$" /PERSISTENT? If so could anybody show me for one of the drives? Regards Lars Kragh
|
Top
|
|
|
|
#177013 - 2007-06-15 02:16 PM
Re: AD login script which maps network drives
[Re: Mart]
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
Hi Mart, Sounds good. What you mean is, if someone allready has a drive mapped as "L" from a different network connection? So where should the USE "L:" "\\Bohr\Programs$$" /PERSISTENT go? (sorry, but im a coding retard)
|
Top
|
|
|
|
#177016 - 2007-06-15 02:42 PM
Re: AD login script which maps network drives
[Re: Mart]
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
Hi, No, what I mean is, how would the code look like for checking if a drive letter is allready mapped and if not, map the drive persistent. Could you write a full example of this?
|
Top
|
|
|
|
#177019 - 2007-06-15 03:11 PM
Re: AD login script which maps network drives
[Re: Les]
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
Thank you Les!
|
Top
|
|
|
|
#177038 - 2007-06-18 10:45 AM
Re: AD login script which maps network drives
[Re: Arend_]
|
lakn
Fresh Scripter
Registered: 2007-06-14
Posts: 8
|
Hi, I aggree with both of you and I am sorry. Its all about learning and not copy/pasting. The thing is, as apronk so kindly said, I didnt have time to learn how to code Kixtart. I needed to modify an active directory script, that a former employee made years back and then never touch it again (crossed fingers). Anyways, I thank you all for the help. Next time I won't ask for the full solution.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 507 anonymous users online.
|
|
|