See logged on or locked status of another windows computer

We have no admin access in this environment but do have the ability to login remotely to another computer using the remote desktop feature built into W7.  However, before connecting, I would prefer to check and make sure that nobody is using it.  The locked and/or login status is needed.  Assistance is greatly appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
There is no way without a domain involved.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
And what about query session /server:ComputerName listing the remote sessions?
David Johnson, CD, MVPOwnerCommented:
should work, Qlemu, I'd forgotten about that.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

frugalmuleAuthor Commented:
hmm,  forgive my ignorance here.  Let's assume the IP of the machine I need to inquire about is 192.168.x.x.  It is on a domain called ad.local.  How do I write the syntax?

I'm checking to see if anyone is currently logged-in.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
query session /server:192.168.x.x
frugalmuleAuthor Commented:
Error 5 getting session names, access denied.  I tried hostname and fully qualified hostname also
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Then try by making a network drive connection first, which provides the appropriate credentials:
net use \\192.168.x.x /u:Domain\User Password
query session /server:192.168.x.x
net use \\192.168.x.x /d

Open in new window

frugalmuleAuthor Commented:
I'm not 100% clear on what each line does.
In line 1 specifically, u seems to indicate user but then you typed Domain.  I'm a little fuzzy here.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Domain is either the domain or computer name. User and Password are obvious, and need to be replaced, like the IP.
frugalmuleAuthor Commented:
you didn't understand my question
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
You didn't understand the answer?!
frugalmuleAuthor Commented:
Does U: mean user?
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
All of this terms need to get replaced by real data:

/u:  is the switch name of net use to indicate a username is following.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.