Page 1 of 1 1
Topic Options
#155812 - 06/01/23 02:34 PM Kix and deleting shares create by a netlogon share
LotharGores Offline
Fresh Scripter

Registered: 06/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 - 06/01/23 02:44 PM Re: Kix and deleting shares create by a netlogon share
Radimus Moderator Offline
Moderator
*****

Registered: 00/01/06
Posts: 5186
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"
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#155814 - 06/01/23 04:38 PM Re: Kix and deleting shares create by a netlogon share
LotharGores Offline
Fresh Scripter

Registered: 06/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 - 06/01/23 05:21 PM Re: Kix and deleting shares create by a netlogon share
Radimus Moderator Offline
Moderator
*****

Registered: 00/01/06
Posts: 5186
Loc: Tampa, FL
"use p: /delete /persistent"

or

"use * /delete /persistent" to delete them all
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#155816 - 06/01/23 07:24 PM Re: Kix and deleting shares create by a netlogon share
LotharGores Offline
Fresh Scripter

Registered: 06/01/23
Posts: 5
does not work - will only delte those drives created by KIX
Top
#155817 - 06/01/23 07:41 PM Re: Kix and deleting shares create by a netlogon share
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 01/06/05
Posts: 22294
Loc: Claremore, OK
what is the error?

yes, the @error
_________________________
!

download KiXnet

Top
#155818 - 06/01/23 08:07 PM Re: Kix and deleting shares create by a netlogon share
Les Offline
KiX Master
*****

Registered: 01/06/11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

does not work - will only delte those drives created by KIX



I have to disagree. Perhaps does not work for you for unknown reasons.

The wildcard delete however is a bit version dependent due to a prior bug.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#155819 - 06/01/23 08:46 PM Re: Kix and deleting shares create by a netlogon share
Howard Bullock Offline
KiX Supporter
*****

Registered: 00/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 (06/01/23 08:47 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#155820 - 06/01/23 09:23 PM Re: Kix and deleting shares create by a netlogon share
LotharGores Offline
Fresh Scripter

Registered: 06/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 - 06/01/23 09:53 PM Re: Kix and deleting shares create by a netlogon share
NTDOC Administrator Offline
Administrator
*****

Registered: 00/07/28
Posts: 11545
Loc: CA
Please run this and post the returned information.

Code:
Break On
@KIX ?
USE P: /DEL /PERSISTENT
'Return: ' +@ERROR +' '+@SERROR ?


 

Top
#155822 - 06/01/23 10:03 PM Re: Kix and deleting shares create by a netlogon share
Howard Bullock Offline
KiX Supporter
*****

Registered: 00/09/15
Posts: 5809
Loc: Harrisburg, PA USA
Is this "/PERSIST" a valid switch for USE? That was not in my example.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#155823 - 06/01/24 12:27 AM Re: Kix and deleting shares create by a netlogon share
LotharGores Offline
Fresh Scripter

Registered: 06/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 - 06/02/28 04:06 PM Re: Kix and deleting shares create by a netlogon share
Rosario Carcò Offline
Fresh Scripter

Registered: 02/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ò (06/03/07 03:24 PM)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 113 anonymous users online.
Newest Members
schnuggel, h315060, johnnyutah, pmk31, ArserHsieh
17412 Registered Users

Generated in 0.037 seconds in which 0.013 seconds were spent on a total of 12 queries. Zlib compression enabled.

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