[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

See Logged on RDP user with Powershell or WMI

Asked by Gr8-Ideas in Powershell, Remote Desktop/Terminal Services, Windows Management Instrumentation (WMI)

Tags: RDP, Logged On, Powershell, WMI

Is there a way to see on a PC if there are any logged on RDP users.

The code shown works perfectly for any machine on the domain, but it does not show for logged on RDP users. It reports back the username that ran the script.

Any PS / WMI experts out there with a solution to this?

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
"###########" | Write-Host -ForegroundColor green
""
$PCNAME = Read-Host "Please enter the computer name" 
$CS = Gwmi Win32_ComputerSystem -Comp $PCNAME
$CD = Gwmi Win32_LoggedOnUser -ComputerName $PCNAME
 
clear
 
"###########" | Write-Host -ForegroundColor green
""
"Machine Name: " + $CS.Name | Write-Host -ForegroundColor red
""
"Logged On User: " + $CS.UserName | Write-Host -ForegroundColor red
""
"###########" | Write-Host -ForegroundColor green
""
[+][-]10/14/09 03:06 AM, ID: 25568720Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/14/09 02:43 PM, ID: 25575567Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/15/09 12:43 AM, ID: 25578156Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/16/09 12:45 PM, ID: 25592679Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/17/09 12:15 PM, ID: 25597065Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/19/09 08:00 AM, ID: 25605754Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/19/09 08:22 AM, ID: 25605997Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/19/09 08:59 AM, ID: 25606409Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/20/09 12:03 AM, ID: 25611594Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625