Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > BOOK: Beginning ASP 3.0
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 5th, 2004, 08:04 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Displaying sessions logged into Win2K Server

Hi,
I am developing an application which will use a query command to display all the sessions logged into win2k server. My code is as shown below:
%@ language="vbscript" %>
<%

Response.Write "<script type=text/javascript language=javascript src=top_nav1.js></script>"

dim x(50),i,count,j,serv
i = 0
j = 0
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("cmd /c query user /server:")//put the server name
Set objStdOut = objWshScriptExec.StdOut
Set objShell = Nothing

While Not objStdOut.AtEndOfStream
strLine = objStdOut.ReadLine
strLine = Wscript.Stdout.ReadLine
strLine = strLine & vbCRLF
x(i) = Trim(Mid(strLine,42,3))
    if j = 0 then
    response.write "<pre>" & strLine & "</pre>"
    response.write ""
    else
    response.write "<pre>" & strLine & "</pre>"
    response.write "<b><a href=TERMINATETS001.asp?mode="& x(j) &"> Disconnected </a></b>"
    response.write ""
    end if
i = i + 1
j = j + 1
Wend

Response.Write "<center><script type=text/javascript language=javascript src=bottom_nav.js></script></center>"
%>
The above script works for Terminal server, but when i am trying to run the same script to display sessions of win2K server running active directory. It doesnt display the sessions. If, same script is executed from win2k server itself, it works properly. I have also checked that command which i am passing in exec method is perfect. When you run the same command from dos prompt it will display sessions of remote win2k server. I have also ensured that i have admin rights. Can you please help me as i am stuck here since last week without luck.
Thanks
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IIS5 Win2K Sessions being dropped (apparently) BrianWren Internet Information Services 3 January 22nd, 2007 03:48 PM
How to use sessions to remember logged on user? MTLedari ASP.NET 2.0 Basics 6 December 7th, 2006 04:17 AM
Mixing classic ASP sessions with ASP.NET sessions scorpion_king General .NET 2 August 4th, 2004 08:20 AM



All times are GMT -4. The time now is 04:06 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.