Home All Groups Group Topic Archive Search About

Disconnect TCP connections shown in Netstat

Author
23 Oct 2006 6:08 PM
DB
Basically what I want to do is disconnect one of the TCP connections that
shows Established when running netstat.  I know that in theory you can end
the process associated with the connection, but in this case its System. 
Don't think that one is going to die properly.

A bigger use would be to make a connection to a network share using a
different name than I'm currently connected as.  Windows won't allow for
this.  I'd have to disconnect any active connections to that server before
re-connecting with new credentials.  I need a way to manually kill that TCP
connection.  I'd prefer not to download any utilities to to this as it seems
something that should be doable in the OS.  But Microsoft has left
head-scratching holes in their utilities before.

Author
26 Oct 2006 1:08 AM
John Wunderlich
=?Utf-8?B?REI=?= <D*@discussions.microsoft.com> wrote in
news:98F0B759-21C2-427E-B9BC-B938DA18DF0B@microsoft.com:
[...snip...]
> A bigger use would be to make a connection to a network share
> using a different name than I'm currently connected as.  Windows
> won't allow for this.  I'd have to disconnect any active
> connections to that server before re-connecting with new
> credentials.
[...snip...]

Windows does allow this from the command line.  Try bringing up a
command window and entering the command:

  net use * \\computername\sharename  password /user:domain\username

If you omit the password, it will prompt.
Be careful of forward slashes vs. back slashes.
This will allow connection to network share with different credentials.

HTH,
  John
Author
26 Oct 2006 4:00 PM
DB
Unfortunately, John, it does not.  This is just the command line way of
trying to do map a network drive with given credentials through explorer.

The same message comes through the command line.
"Multiple connections to a server or shared resource by the same user, using
more than one user name, are not allowed.  Disconnect all previous
connections to the server or shared resource and try again.."

Windows does not allow you to connect to a server with two different sets of
credentials at the same time.  This I know and accept.  I would just like a
way to disconnect the first connection so I can establish a new one with
different credentials.

Show quoteHide quote
"John Wunderlich" wrote:

> =?Utf-8?B?REI=?= <D*@discussions.microsoft.com> wrote in
> news:98F0B759-21C2-427E-B9BC-B938DA18DF0B@microsoft.com:
> [...snip...]
> > A bigger use would be to make a connection to a network share
> > using a different name than I'm currently connected as.  Windows
> > won't allow for this.  I'd have to disconnect any active
> > connections to that server before re-connecting with new
> > credentials.
> [...snip...]
>
> Windows does allow this from the command line.  Try bringing up a
> command window and entering the command:
>
>   net use * \\computername\sharename  password /user:domain\username
>
> If you omit the password, it will prompt.
> Be careful of forward slashes vs. back slashes.
> This will allow connection to network share with different credentials.
>
> HTH,
>   John
>
Author
27 Oct 2006 4:05 AM
John Wunderlich
=?Utf-8?B?REI=?= <D*@discussions.microsoft.com> wrote in
Show quoteHide quote
news:6C55912B-DF19-4767-A49A-9E8D71995B85@microsoft.com:

> Unfortunately, John, it does not.  This is just the command line
> way of trying to do map a network drive with given credentials
> through explorer.
>
> The same message comes through the command line.
> "Multiple connections to a server or shared resource by the same
> user, using more than one user name, are not allowed.  Disconnect
> all previous connections to the server or shared resource and try
> again.."
>
> Windows does not allow you to connect to a server with two
> different sets of credentials at the same time.  This I know and
> accept.  I would just like a way to disconnect the first
> connection so I can establish a new one with different
> credentials.
>
>

I'm sorry, I misunderstood.  I didn't realize you already had a
connection in place.

I've always had luck right-clicking on "My Network Places", then
selecting the "Disconnect Network Drive" option.  Sometimes my
connection shows up greyed-out but selecting it anyway and clicking
"OK" seems to break the connection and allows me to login with
different credentials.

Another attack (particularly if you have an administrative connection
to ipc$) would be to open a command prompt and type in
  net use
and examine your current connections.  Find the one you want to
disconnect and type in the command
  net use \\computer\share /delete
to disconnect.

Between these two methods, I've always been able to disconnect.

HTH,
  John