Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2004, 08:04 PM
Registered User
 
Join Date: Sep 2004
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





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





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