Tom's Hardware > Forum > Windows 2000/NT > Windows 2000/NT General Discussion > File sessions are not disconnecting

File sessions are not disconnecting

Forum Windows 2000/NT : Windows 2000/NT General Discussion - File sessions are not disconnecting

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.win2000.file_system (More info?)

 

I have a file server that has multiple servers connecting to it to retrieve
files via UNC paths. The problem we are seeing is that after a few weeks, we
get a message that indicates that we have run out of connections. When I
look under Computer Management -> Shared Folders -> Sessions I can see that
there are many sessions with a 'connected since' date going back days or
weeks. If I disconnect them, file access speeds up and more connections are
allowed.

Is there any way to have these sessions automatically close when idle? Or
does anyone know a better way to do this?

Thanks.

Sponsored Links
Register or log in to remove.

Archived from groups: microsoft.public.win2000.file_system (More info?)

 

On Fri, 3 Jun 2005 09:28:07 -0700, "Ryan Smith" <Ryan Smith@discussions.microsoft.com> wrote:

>I have a file server that has multiple servers connecting to it to retrieve
>files via UNC paths. The problem we are seeing is that after a few weeks, we
>get a message that indicates that we have run out of connections. When I
>look under Computer Management -> Shared Folders -> Sessions I can see that
>there are many sessions with a 'connected since' date going back days or
>weeks. If I disconnect them, file access speeds up and more connections are
>allowed.
>
>Is there any way to have these sessions automatically close when idle? Or
>does anyone know a better way to do this?
>
>Thanks.

You could schedule the following batch to run every day:


@echo off
setlocal ENABLEDELAYEDEXPANSION
for /F "Tokens=1-8*" %%a in ('net sessions^|Find "\\"') do (
call :sess %%a %%b %%c %%d %%e %%f %%g %%h %%i
@echo !comp! !idle!
)
endlocal
goto :EOF
:sess
set comp=%1
set idle=00:00:00
:sessL
shift
if {%1}=={} goto sessT
set idle=%1
goto sessL
:sessT
for /f "Tokens=1 Delims=:" %%x in ('@echo %idle%') do (
if "%%x" GTR "01" net session %comp% /DELETE
)

Reply to Anonymous

Archived from groups: microsoft.public.win2000.file_system (More info?)

 

Thank you Jerold. However, even if I disconnect them all (with net files
/delete /y or similar) they just come back. It is like the requesting
servers are keeping the connection alive for some reason.

"Jerold Schulman" wrote:

> On Fri, 3 Jun 2005 09:28:07 -0700, "Ryan Smith" <Ryan Smith@discussions.microsoft.com> wrote:
>
> >I have a file server that has multiple servers connecting to it to retrieve
> >files via UNC paths. The problem we are seeing is that after a few weeks, we
> >get a message that indicates that we have run out of connections. When I
> >look under Computer Management -> Shared Folders -> Sessions I can see that
> >there are many sessions with a 'connected since' date going back days or
> >weeks. If I disconnect them, file access speeds up and more connections are
> >allowed.
> >
> >Is there any way to have these sessions automatically close when idle? Or
> >does anyone know a better way to do this?
> >
> >Thanks.
>
> You could schedule the following batch to run every day:
>
>
> @echo off
> setlocal ENABLEDELAYEDEXPANSION
> for /F "Tokens=1-8*" %%a in ('net sessions^|Find "\\"') do (
> call :sess %%a %%b %%c %%d %%e %%f %%g %%h %%i
> @echo !comp! !idle!
> )
> endlocal
> goto :EOF
> :sess
> set comp=%1
> set idle=00:00:00
> :sessL
> shift
> if {%1}=={} goto sessT
> set idle=%1
> goto sessL
> :sessT
> for /f "Tokens=1 Delims=:" %%x in ('@echo %idle%') do (
> if "%%x" GTR "01" net session %comp% /DELETE
> )
>

Reply to Anonymous
Tom's Hardware > Forum > Windows 2000/NT > Windows 2000/NT General Discussion > File sessions are not disconnecting
Go to:

There are 839 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them