Networking Forums

Networking Forums > Computer Networking > Linux Networking > disconnect from samba without loggin off from Windows

Reply
Thread Tools Display Modes

disconnect from samba without loggin off from Windows

 
 
Song Yun Zhao
Guest
Posts: n/a

 
      11-09-2004, 01:14 AM
Hi,

here is the scenario:

a working samba server with multiple accounts, e.g. user1, user2, user3 etc
a windows client running windows xp

problem:

if I connect to samba from the window box as user1, how do I reconnect
to it as user2 without logging off? (a DOS command is preferred, ie.
"net stop"?) Windows seems to remember the username/password settings.

thanks in adance

Song
 
Reply With Quote
 
 
 
 
HisNameWasRobertPaulson
Guest
Posts: n/a

 
      11-09-2004, 10:11 AM
You can make a second connection using the following command:

C:\net use

for exmaple,

net use \\samba-server\share /USER:username password

Although I am not sure how Samba will react, Windows servers a pretty stupid
about this and require previous connections using a different username be
disconnected first. For that you can use:

net use
- to find out what connections are present, then disconnect them using the
following:

net use \\samba-server\share /DELETE
-then make the other connection using the diff username.


"Song Yun Zhao" <(E-Mail Removed)> wrote in message
news:41902821$(E-Mail Removed)...
> Hi,
>
> here is the scenario:
>
> a working samba server with multiple accounts, e.g. user1, user2, user3

etc
> a windows client running windows xp
>
> problem:
>
> if I connect to samba from the window box as user1, how do I reconnect
> to it as user2 without logging off? (a DOS command is preferred, ie.
> "net stop"?) Windows seems to remember the username/password settings.
>
> thanks in adance
>
> Song



 
Reply With Quote
 
Josh Miller
Guest
Posts: n/a

 
      11-09-2004, 12:57 PM
A very handy command that is given by example in the Official Samba-3
HowTo and Reference Guide: 'net use * /d', which will disconnect all of
your active network connections (from a windows PC).

This is a very handy command when you have connected to your Samba
machine before joining the domain or you wish to re-authenticate using a
different username/password combination.

Josh

HisNameWasRobertPaulson wrote:
> You can make a second connection using the following command:
>
> C:\net use
>
> for exmaple,
>
> net use \\samba-server\share /USER:username password
>
> Although I am not sure how Samba will react, Windows servers a pretty stupid
> about this and require previous connections using a different username be
> disconnected first. For that you can use:
>
> net use
> - to find out what connections are present, then disconnect them using the
> following:
>
> net use \\samba-server\share /DELETE
> -then make the other connection using the diff username.
>
>
> "Song Yun Zhao" <(E-Mail Removed)> wrote in message
> news:41902821$(E-Mail Removed)...
>
>>Hi,
>>
>>here is the scenario:
>>
>>a working samba server with multiple accounts, e.g. user1, user2, user3

>
> etc
>
>>a windows client running windows xp
>>
>>problem:
>>
>>if I connect to samba from the window box as user1, how do I reconnect
>>to it as user2 without logging off? (a DOS command is preferred, ie.
>>"net stop"?) Windows seems to remember the username/password settings.
>>
>>thanks in adance
>>
>>Song

>
>
>

 
Reply With Quote
 
Song Yun Zhao
Guest
Posts: n/a

 
      11-11-2004, 12:20 AM
thanks, very handy indeed
 
Reply With Quote
 
Song Yun Zhao
Guest
Posts: n/a

 
      11-11-2004, 02:54 AM
for anyone who is interested:

net use * /d /yes [or just /y]

will disconnect all shared resources without having to answer yes. for
some reason, the /yes switch is not documented when you type "net help
use" in the DOS command prompt

for more info: http://www.computerhope.com/nethlp.htm

this is useful for me as my goal is to write a vbscript to disconnect a
user and then connect as a different user.

here is the script:

Dim WShell
Set WShell = WScript.CreateObject("WScript.Shell")
WShell.Run "net use * /d /y", 0, true
WShell.Run "net use w: \\samba\\share /user:username password", 0, true
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wireless disconnect: linksys + microsoft windows TheFusionWarrior@gmail.com Wireless Internet 4 01-15-2007 10:44 AM
How to manually disconnect from wireless in Windows? Dan Wireless Networks 1 08-29-2005 11:20 PM
A few questions regarding samba from a samba and windows rookie Madhusudan Singh Linux Networking 0 03-30-2005 05:54 PM
VPN disconnect cause router failure on Windows 2003 =?Utf-8?B?WGF2aWVyIFByaWV1cg==?= Windows Networking 1 02-23-2005 04:59 PM
loggin on??? =?Utf-8?B?YWtlbg==?= Windows Networking 2 05-30-2004 04:16 AM



1 2 3 4 5 6 7 8 9 10 11