![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Script to list open files I am having trouble getting the following script from the Scripting Guys to run on my SBS2003 Premium server: Set objConnection = GetObject("WinNT://atl-ws-01/LanmanServer") Set colSessions = objConnection.Sessions For Each objSession in colSessions Wscript.Echo "Computer: " & objSession.Computer Wscript.Echo "Connected Time: " & objSession.ConnectTime Wscript.Echo "Idle Time: " & objSession.IdleTime Wscript.Echo "Name: " & objSession.Name Wscript.Echo "User: " & objSession.User Wscript.Echo Next The error is in the first line. The error message states that "The network path was not found." I tried rebooting the server as I had read that restarting the Server (LanManServer) might resolve the issue, but it did not. Any ideas as to why this simple script won't work? Thanks, Keith |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Script to list open files "Keith" <Keith@xxxxxx> wrote in message news:1AAAB8A5-1000-49FE-9B28-E6683F1F741F@xxxxxx Quote: >I am having trouble getting the following script from the Scripting Guys to > run on my SBS2003 Premium server: > > Set objConnection = GetObject("WinNT://atl-ws-01/LanmanServer") > Set colSessions = objConnection.Sessions > > For Each objSession in colSessions > Wscript.Echo "Computer: " & objSession.Computer > Wscript.Echo "Connected Time: " & objSession.ConnectTime > Wscript.Echo "Idle Time: " & objSession.IdleTime > Wscript.Echo "Name: " & objSession.Name > Wscript.Echo "User: " & objSession.User > Wscript.Echo > Next > > The error is in the first line. The error message states that "The > network > path was not found." I tried rebooting the server as I had read that > restarting the Server (LanManServer) might resolve the issue, but it did > not. > Any ideas as to why this simple script won't work? > > Thanks, > > Keith > service on the computer atl-ws-01". I suspect that your server has a name other than "atl-ws-01", hence the error message. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Script to list open files Is "atl-ws-01" the NetBIOS name of the server? If not, replace this string with the name of your server. Or, if you are running the script on the server, you can have the script retrieve the NetBIOS name: Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName Set objConnection = GetObject("WinNT://" & strComputer & "/LanmanServer") If you are running the script remotely, you need to assign the name to the variable strComputer. Finally, I believe you must have administrator privileges or you will get no sessions. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- "Keith" <Keith@xxxxxx> wrote in message news:1AAAB8A5-1000-49FE-9B28-E6683F1F741F@xxxxxx Quote: >I am having trouble getting the following script from the Scripting Guys to > run on my SBS2003 Premium server: > > Set objConnection = GetObject("WinNT://atl-ws-01/LanmanServer") > Set colSessions = objConnection.Sessions > > For Each objSession in colSessions > Wscript.Echo "Computer: " & objSession.Computer > Wscript.Echo "Connected Time: " & objSession.ConnectTime > Wscript.Echo "Idle Time: " & objSession.IdleTime > Wscript.Echo "Name: " & objSession.Name > Wscript.Echo "User: " & objSession.User > Wscript.Echo > Next > > The error is in the first line. The error message states that "The > network > path was not found." I tried rebooting the server as I had read that > restarting the Server (LanManServer) might resolve the issue, but it did > not. > Any ideas as to why this simple script won't work? > > Thanks, > > Keith > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Script to list open files Thanks for the help! Keith "Richard Mueller [MVP]" wrote: Quote: > Is "atl-ws-01" the NetBIOS name of the server? If not, replace this string > with the name of your server. Or, if you are running the script on the > server, you can have the script retrieve the NetBIOS name: > > Set objNetwork = CreateObject("Wscript.Network") > strComputer = objNetwork.ComputerName > Set objConnection = GetObject("WinNT://" & strComputer & "/LanmanServer") > > If you are running the script remotely, you need to assign the name to the > variable strComputer. Finally, I believe you must have administrator > privileges or you will get no sessions. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > "Keith" <Keith@xxxxxx> wrote in message > news:1AAAB8A5-1000-49FE-9B28-E6683F1F741F@xxxxxx Quote: > >I am having trouble getting the following script from the Scripting Guys to > > run on my SBS2003 Premium server: > > > > Set objConnection = GetObject("WinNT://atl-ws-01/LanmanServer") > > Set colSessions = objConnection.Sessions > > > > For Each objSession in colSessions > > Wscript.Echo "Computer: " & objSession.Computer > > Wscript.Echo "Connected Time: " & objSession.ConnectTime > > Wscript.Echo "Idle Time: " & objSession.IdleTime > > Wscript.Echo "Name: " & objSession.Name > > Wscript.Echo "User: " & objSession.User > > Wscript.Echo > > Next > > > > The error is in the first line. The error message states that "The > > network > > path was not found." I tried rebooting the server as I had read that > > restarting the Server (LanManServer) might resolve the issue, but it did > > not. > > Any ideas as to why this simple script won't work? > > > > Thanks, > > > > Keith > > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Need Help With Script To List and Delete Printers | VB Script | |||
| remove list of files from open dialog box | Vista General | |||
| is there any script to get a list of COM Objects in a computer? | PowerShell | |||
| list open files in a shared folder | PowerShell | |||
| Optimizing PS Script to List directories | PowerShell | |||