Hi,
How can i check the number of incoming network connections in PS. I'm
looking for something similar to net session. ?
Thanks
Hi,
How can i check the number of incoming network connections in PS. I'm
looking for something similar to net session. ?
Thanks
Hans wrote:Did you need anything additional? Because you can just run 'net
> Hi,
>
> How can i check the number of incoming network connections in PS. I'm
> looking for something similar to net session. ?
>
> Thanks
session' directly from within PowerShell.
Marco
--
----------------
PowerGadgets MVP
http://www.powergadgets.com/mvp
Blog:
http://marcoshaw.blogspot.com
Well i'm creating a backup script (to backup some MS-Access database), but i
want to check if any else in the network is still using the database. So
idea is to check the number of incoming network connections;
"Marco Shaw" <marco.shaw@_NO_SPAM_gmail.com> schreef in bericht
news:Oc0ud3p$HHA.4568@xxxxxx
> Hans wrote:>
>> Hi,
>>
>> How can i check the number of incoming network connections in PS. I'm
>> looking for something similar to net session. ?
>>
>> Thanks
> Did you need anything additional? Because you can just run 'net session'
> directly from within PowerShell.
>
> Marco
>
> --
> ----------------
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com
Hans wrote:You're best bet might be to check if there's a if there's a lock file
> Well i'm creating a backup script (to backup some MS-Access database),
> but i want to check if any else in the network is still using the
> database. So idea is to check the number of incoming network connections;
though.
But you can just call 'net session' directly:
PSH> net session
There are no entries in the list.
PSH> $result=net session
PSH> if ($result -like "*no entries*"){"no connections"}
no connections
Marco
gwmi win32_serverSession might give the onfo you need
also you can use performance counters from PowerShell
see also
http://mow001.blogspot.com/2005/12/g...info-from.html
h.t.h.
Greetings /\/\o\/\/
"Hans" wrote:
> Well i'm creating a backup script (to backup some MS-Access database), but i
> want to check if any else in the network is still using the database. So
> idea is to check the number of incoming network connections;
>
>
> "Marco Shaw" <marco.shaw@_NO_SPAM_gmail.com> schreef in bericht
> news:Oc0ud3p$HHA.4568@xxxxxx>
> > Hans wrote:> >
> >> Hi,
> >>
> >> How can i check the number of incoming network connections in PS. I'm
> >> looking for something similar to net session. ?
> >>
> >> Thanks
> > Did you need anything additional? Because you can just run 'net session'
> > directly from within PowerShell.
> >
> > Marco
> >
> > --
> > ----------------
> > PowerGadgets MVP
> > http://www.powergadgets.com/mvp
> >
> > Blog:
> > http://marcoshaw.blogspot.com
>
On Sep 24, 8:16 pm, "Hans" <hans.hant...@xxxxxx> wrote:You can use something similar to this:
> Hi,
>
> How can i check the number of incoming network connections in PS. I'm
> looking for something similar to net session. ?
>
> Thanks
Get-WmiObject -ComputerName MYSERVER01 -Query {Select * From
Win32_ServerConnection Where NumberOfFiles>"0" and
ShareName="MYSHARE"} | Select-Object UserName,ShareName,NumberOfFiles
| Format-Table -autosize
This will work if the Database is the ONLY thing in the share. For
some reason I can't figure out a way to check specific open files
within shares just connections to a share that have files open.
Replace MYSERVER01 with your server name and MYSHARE with the share
name.
| Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| network connections gone?! | sobriquet | Vista General | 2 | 30 Jul 2009 |
| Network Connections disappeared in Network sharing center | oseni abiola | Vista networking & sharing | 1 | 15 Jun 2008 |
| Ridiculous Methods for Checking Network Status | Spikeys-World | Vista networking & sharing | 1 | 14 Jul 2007 |
| Network Connections | neil2jo | Vista General | 2 | 18 May 2007 |
| Network Connections | DawnR | Vista networking & sharing | 10 | 20 Mar 2007 |