• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1209
  • Last Modified:

Batch File: Sessions Idle time

Hi there,

I need to make a batch file that, on a Windows Server 2003, will list: users, their sessions "connected time" and "idle time".

I know that the following command does not exist but it would be something like:

@ECHO OFF
WMIC logon get user,connected,idletime

Thanks for your help,
Rene
0
ReneGe
Asked:
ReneGe
  • 6
  • 5
2 Solutions
 
OrenRozenCommented:
did you try the command QUSER ?

0
 
ReneGeAuthor Commented:
Nice! I do have this on my W7 but not on XP. Is this XP compatible? You have the M.S. link?

Thanks
0
 
OrenRozenCommented:
the following link will give information on the quser command
http://technet.microsoft.com/en-us/library/cc754583%28WS.10%29.aspx

before quser the command was 'query user'. I think that can work on windows XP.
http://technet.microsoft.com/en-us/library/cc788125%28WS.10%29.aspx
0
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
ReneGeAuthor Commented:
I got a go sleep. I'll followup on this tomorrow (today).

Thanks O.R.
0
 
MDI1981Commented:
Hi

You can try qwinsta /server:nameofserver

0
 
ReneGeAuthor Commented:
-qwinsta did not display idle time for me.
-But inspired by "MDI1981" your suggestion, I found "query user"
-If I ""query user /server:any2003svr", I get a favorable response.
-However, when I "query user /server:anyXPpc" I get:

Error opening Terminal server
Error [5]: Access Denied

Have any ideas?

Thanks,
Rene

0
 
OrenRozenCommented:
Hi ,

Look at my second link in my last post regarding "query user". it include a link to Microsoft KB.

as for the access denied, make sure you're logged in with the correct access rights to the domain.

Thanks.
0
 
OrenRozenCommented:
never tested trying to read from XP (and I don't know if its possible), but make sure that remote rdp is enabled and that the user you're trying to connect with has access to thins computer.
0
 
ReneGeAuthor Commented:
@OrenRozen

You did mention it. My sincere apologies.

-I am a member of all the Admin groups in this domain so I have all the rights.
-Remote RDP is enabled on the tested XP PCs
-What do you mean by "thins computer"? You ment "this computer" right?
-When I make the test, I am logged in as my own "all access" user account.

Have any new thoughts about it?

Thanks and cheers,
Rene
0
 
OrenRozenCommented:
1. is the remote XP a member of the domain?
2. when you connect to the remote XP using RDP, are you using a domain user with admin rights?
3. when you run the query command, are you logged on using a domain user with admin rights?
0
 
ReneGeAuthor Commented:
1=Yes
2=Yes
3=Domain Admins
0
 
ReneGeAuthor Commented:
Sorry guys for keeping you waiting on this.

I'll close it, split the points accorkding to the level of contribution and comment when I find the solution.

Thanks for your precious help.

Cheers,
Rene
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now