List Info

Thread: disconnect network sessions remotely




disconnect network sessions remotely
user name
2006-04-27 18:46:50
"Excuse me while I whip this out."

*sound of large documentation manual landing on the table*

I believe Win32::Lanman, the 100-pound Swiss Army Knife of
Win32 modules
has what you need.

Scroll through the extensive documentation for the following
functions:

Win32::Lanman::NetSessionEnum()
Win32::Lanman::NetSessionGetInfo()
Win32::Lanman::NetSessionDel()
Win32::Lanman::NetConnectionEnum()

They're all in the same section.

On a side note, I used to have a ZIP file with the
documentation split
up into Word docs by section, and I seem to have misplaced
it.  If I
find it I'll try to make it available again.

NOTE:  There used to be a bug with CPAN where you could only
find the
module by looking up its author, JHELBERG.



-----Original Message-----
From: perl-win32-admin-bounceslistserv.ActiveState.com
[mailto:perl-win32-admin-bounceslistserv.ActiveState.com]
On Behalf Of
extern.Lars.OescheyAUDI.DE
Sent: Thursday, April 27, 2006 6:38 AM
To: perl-win32-adminlistserv.ActiveState.com
Subject: RE: disconnect network sessions remotely

<snip>

I now found a way via CGI like this:

use Win32::NetResource qw(NetShareGetInfo);
NetShareGetInfo($netname, \%SHARE, $servername);
print $cgi->h3("$SHARE{'current-users'}");
system ('net sessions /delete /y');

this works ok, but now the target-users have a problem: they
need to
just
disconnect *specific* connections to specific files. The
system command
used
here though deletes every session, so other applications
would be
affected
too...

So is there a way to list all existing sessions? The
NetResource Command
only gives me the number of connections...



_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Adminlistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )