![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | See who is logged in on a remote computer. I'm trying to put together a script to see who is logged in on a remote computer on my domain. Below is a sample of what I've found, but it only works on certain computers, not all of them. Does .NET have to be installed on these machines for this to work? <code> #whologon.ps1 $a = Read-Host "Enter Machine Name" $strComputer = "$a" $Var = GWMI -Computer $strComputer -CL Win32_ComputerSystem "Machine Name: " + $Var.Name + " User Name: " + $Var.UserName </code> The below works for all machines, why doesn't the above? <code> $a= Read-Host "Enter Machine Name" $compy = $a $server="$compy" $process=[System.Diagnostics.Process] $process::GetProcesses($server) </code> |
My System Specs![]() |
| | #2 (permalink) |
| | Re: See who is logged in on a remote computer. Hello Pedro, Try PsLoggedOn.exe from SysInternals: http://technet.microsoft.com/en-us/s.../bb897545.aspx PS > psloggedon -l -x \\computerName Users logged on locally: NT AUTHORITY\LOCAL SERVICE NT AUTHORITY\NETWORK SERVICE DOMAIN\ShayL NT AUTHORITY\SYSTEM --- Shay Levy Windows PowerShell http://blogs.microsoft.co.il/blogs/ScriptFanatic P> I'm trying to put together a script to see who is logged in on a P> remote computer on my domain. Below is a sample of what I've found, P> but it only works on certain computers, not all of them. Does .NET P> have to be installed on these machines for this to work? P> P> <code> P> #whologon.ps1 P> $a = Read-Host "Enter Machine Name" P> $strComputer = "$a" P> $Var = GWMI -Computer $strComputer -CL Win32_ComputerSystem P> "Machine Name: " + $Var.Name + " User Name: " + $Var.UserName P> </code> P> The below works for all machines, why doesn't the above? P> P> <code> P> $a= Read-Host "Enter Machine Name" P> $compy = $a P> $server="$compy" P> $process=[System.Diagnostics.Process] P> $process::GetProcesses($server) P> </code> |
My System Specs![]() |
| | #3 (permalink) |
| | Re: See who is logged in on a remote computer. You could query the security event logs on your DCs for Event ID: 680: through DCOM with a "System.Diagnostics.EventLog" object -or- via WMI via Win32_NTLogEvent -JW "Pedro" <Pedro@xxxxxx> wrote in message news:5A846218-FA46-4B5B-90F3-66B211B886A1@xxxxxx Quote: > I'm trying to put together a script to see who is logged in on a remote > computer on my domain. Below is a sample of what I've found, but it only > works on certain computers, not all of them. Does .NET have to be > installed > on these machines for this to work? > > > <code> > #whologon.ps1 > $a = Read-Host "Enter Machine Name" > $strComputer = "$a" > $Var = GWMI -Computer $strComputer -CL Win32_ComputerSystem > "Machine Name: " + $Var.Name + " User Name: " + $Var.UserName > </code> > > > The below works for all machines, why doesn't the above? > > <code> > $a= Read-Host "Enter Machine Name" > $compy = $a > $server="$compy" > $process=[System.Diagnostics.Process] > $process::GetProcesses($server) > </code> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Restrict logged on user access to resources on computer | Vista General | |||
| computer deletes files whenever it is logged off or shut down | Vista performance & maintenance | |||
| checked for logged on user on remote machine + remote reboot | PowerShell | |||
| Remote Desktop Crashes Vista machin logged into | Vista General | |||
| Others are logged on to this computer Warning | Vista security | |||