If I might interject a couple of observations:
1. I think the syntax is "net session \\computername" not "net
\\computername session"
2. If I understand correctly, the net session command reports "incoming"
sessions, not "outgoing" sessions (if there is such a thing) and the /delete
option only temporarily disconnects an incoming session. Thus:
a. on the client computer
i. key net use x: \\server\share * /user:domain\user
ii. key the password (nothing shows in the command prompt window)
iii. key net session or net session \\server will report "no entries
in the list" - no incoming session
or, use the Explorer, Tools, Map Network Drive... with "Connect using a
different user name." dialog
b. go over to the "server" computer
i.key net session - this will show the session from the client (the
computer used in step a.)
ii. key net session \\client will show details about the "session"
iii. key net sesssion \\client \delete
iv. key net session - no entries in the list
or, use Computer Management, Shared Folders, Sessions
c. go over to the "client" computer
i. in a Command Prompt window, key net use - observe "Disconnected x:
\\server\share
ii. key x:, then dir - observe the content of the target share
or
iii. in Explorer, key x:\ in the Address Bar and observe the content
of the share
So, using "net session ... /d" on a server only temporarily disconnects a
session from a client. Am I missing something here?
3. By default, connecting a mappped network drive via the net use command
(on most Windows systems) will create a "persistent" connection. That is,
the drive mapping will be done again at the next logon - may require
re-entry of the password.
To check this, key
net use
If the response includes "New connections will be remembered", then any net
use command that does NOT include "/persistent:no" will be remembered across
logoff/logon. This can be changed by using the command
net use /persistent:no
which changes the default; this setting is retained across logoff/logon - it
is permanent uless net use /persistent:yes is used later.
4. When the net use ... /d command (or the Explorer, Tools, Disconnect
Network Drive dialog) is used , the connection (mapped network drive) will
be disconnected and will NOT be reconnected at the next logon (even if
/persistent:yes - explicit or implied - was used to establish the
connection).
5. I don't know of any user interface way to remove the target names from
the Explorer, Tools, Map Network Drive... dialog, but these targets are
stored in the registry at:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Map
Network Drive MRU
so if you're really concerned about it, you can remove the "value"
containing the one you don't want anyone to see.
--
Bruce Sanderson MVP
http://members.shaw.ca/bsanders/
It's perfectly useless to know the right answer to the wrong question.
Post by Roger Abell [MVP]Post by M.SilerI've established a connection to the resouce via
net use r: \\myserver\hshare$ *
I now do a net session and it always comes back and tells me ""there are
no entries in the list."
What am I doing wrong?
Nothing.
I just wanted to make sure your machine is clean of
any lingering connections
Post by M.SilerPost by Roger Abell [MVP]OK, but make sure that there is no lingering connection,
as you could see by use of net session.
Windows will "bundle" multiple sessions over a single
connection to a single machine. That is why one at times
sees message that credentials one is trying conflict with
those already in use with a target machine. If you disconnect
the share as you indicate, it may be that something is still
keeping the connection alive. If so, it will be recycled as
you have originally posted about.
Post by M.SilerI'd still like to know if there is a setting or registry hack that will
stop Explorer from caching that get's type in for the path.
I think it is not Explorer doing any caching of credentials, as
you are assuming, but lingering handles/references keeping
the connection from being torn down (i.e. it is a Windows
thing, not an Explorer thing).