#155812 - 2006-01-23 02:34 PM
Kix and deleting shares create by a netlogon share
|
LotharGores
Fresh Scripter
Registered: 2006-01-23
Posts: 5
|
How do I delete drive mappings created by netlogon scipt as kix does not seem to be able to delete those drive mappings (kix can delete its own created drive mappings) using “USE p: /DELETE” (in this case p: was created previously using a batch file in the netlogon
Help is appreciated.
|
Top
|
|
|
|
#155813 - 2006-01-23 02:44 PM
Re: Kix and deleting shares create by a netlogon share
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
if there are files in use on the share, it will be hard to close the connection.
also, if the drive was mapped persistent it will come back at next logon, unless you add /persistent to the "use p: /delete /persistent"
|
Top
|
|
|
|
#155814 - 2006-01-23 04:38 PM
Re: Kix and deleting shares create by a netlogon share
|
LotharGores
Fresh Scripter
Registered: 2006-01-23
Posts: 5
|
Scenario, I have been using a "logon.bat" in my netlogon up to now. this created all my drives for me fine.
With KIX I am trying to reconnect those drives, but found that I had to first disconnect all drives created by my logon.bat before KIX will re-create those drives.
I have 1200 workstation and just cannot see how I am going to disconnect those drives.
Thanks
|
Top
|
|
|
|
#155815 - 2006-01-23 05:21 PM
Re: Kix and deleting shares create by a netlogon share
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
"use p: /delete /persistent"
or
"use * /delete /persistent" to delete them all
|
Top
|
|
|
|
#155816 - 2006-01-23 07:24 PM
Re: Kix and deleting shares create by a netlogon share
|
LotharGores
Fresh Scripter
Registered: 2006-01-23
Posts: 5
|
does not work - will only delte those drives created by KIX
|
Top
|
|
|
|
#155819 - 2006-01-23 08:46 PM
Re: Kix and deleting shares create by a netlogon share
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I recommend delting the explicit drive just before you attempt to remap it. An example is shown below.
If this still fails then you will need to check @error @serror just after the stement: USE $Drive /Delete /Persistent
Be aware that my UDF call other UDF code that you may not have in your script.
Code:
Function MapDrive($Drive, $Server, $Share) Dim $Drive, $Server, $Share, $shell Color c+/n
If $Drive<>"" and $Server<>"" and $Share<>"" $LogText="Connecting $Drive to \\$Server\$Share" ? $LogText USE $Drive /Delete /Persistent USE $Drive "\\$Server\$Share" If @error=0 color g+/n $x=" - Success" "$x" If val($DOS) >= 5 $shell=createobject("shell.application") $shell.namespace($Drive+"\").self.name=$Share + " on '" + $Server + "'" $shell = 0 Endif Else color r+/n $x=" - Failed: Error @error" "$x" $ErrorState=1 Endif WriteLog ($LogText + $x) WriteLog2("%temp%\MapDrive.log",$LogText + $x,1) Color w+/n Else WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'") Endif Endfunction
Edited by Howard Bullock (2006-01-23 08:47 PM)
|
Top
|
|
|
|
#155820 - 2006-01-23 09:23 PM
Re: Kix and deleting shares create by a netlogon share
|
LotharGores
Fresh Scripter
Registered: 2006-01-23
Posts: 5
|
Ok Here is what is happening: WindowsXP SP2 workstation - Server 2003 SP1
I map my p: drive using DOS (net use p: \\server\share) - this maps my p drive for this test
now I run KIX: A) USE p: /DELETE /PERSIST -- no error from @ERROR looking at the windows xp explorer my P drive now changes to a "disconnected network drive" type
B) next in the script: USE p: "\\server\share" /persistent -- error: "Connection to another network resource"
My old p mapping is still in a "disconnected network drive" state but when i cklick on the drive letter my old drive maps back.
If i use DOS and manually do above using: net use p:/ d net use p: \\server\share everything works fine
|
Top
|
|
|
|
#155821 - 2006-01-23 09:53 PM
Re: Kix and deleting shares create by a netlogon share
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Please run this and post the returned information.
Code:
Break On @KIX ? USE P: /DEL /PERSISTENT 'Return: ' +@ERROR +' '+@SERROR ?
|
Top
|
|
|
|
#155822 - 2006-01-23 10:03 PM
Re: Kix and deleting shares create by a netlogon share
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Is this "/PERSIST" a valid switch for USE? That was not in my example.
|
Top
|
|
|
|
#155823 - 2006-01-24 12:27 AM
Re: Kix and deleting shares create by a netlogon share
|
LotharGores
Fresh Scripter
Registered: 2006-01-23
Posts: 5
|
OK - what happened was is that one server (server1) hosting the share "sharename" broke. \\server1\sharename
so I moved the share to a second server (server2) with the same sharename. so now I have: \\server2\sharename
and thats were kix stopped working. I now re-created server1 and moved the share back to server1 (from server2) and EVERYTHING is working fine !?!?!? Again, it seems that WindowsXP keeps a record of the share, and stopps kix from mapping the same share name to a different servernae - does this make any sense?
|
Top
|
|
|
|
#155824 - 2006-02-28 04:06 PM
Re: Kix and deleting shares create by a netlogon share
|
Rosario Carcò
Fresh Scripter
Registered: 2002-08-28
Posts: 8
|
Quote:
it seems that WindowsXP keeps a record of the share, and stopps kix from mapping the same share name to a different servernae - does this make any sense?
I am experiencing this very same behaviour since our Workstations started to run under XP. Under Win NT 4 and Win 2K my Kix-Login-Script, which is still the same, deleted the mapping before remapping it. Starting with XP, if the user maps something on a letter, say X:, the kix statement USE X: /DELETE can not free up the letter X: The user has to disconnect the drive first manually in the windows-explorer. Only after that, the letter can be used by kix at next logon. I did not try the suggested option /Delete /Persistent yet.
Ok, now I made another series of tests and the suggested Option does the trick. So use Code:
USE X: /DELETE /PERSISTENT
to be sure that persistently mapped drives by the user are also disconnected and available for a new mapping.
Edited by Rosario Carcò (2006-03-07 03:24 PM)
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 248 anonymous users online.
|
|
|