Possible Solution: Display Last Logged On User
Hello Together,
i did not want to except that the last logged on user of a workstation cannot be displayed directly in the SCE Console and did some further research on this.
I came around a possible solution to display the information about the last logged on user in a status view. (Only works on XP Clients)
First i created a custom attribute in SCE that retrieves the last logged on user information every 5 Minutes from the registry:
HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultUserName
I saved the attribute in a custom management pack i created before. As Target i chose Windows Client.
After creating the Attribute i went to Monitoring in the SCE Console and created a new status view under my custom management pack. I made a custom view which only includes the netbios name, the ipadress, the status and my new atrribute the last logged on user.
Works like a charm. When someone calls me now i go to status view, search for the user and see on which computer he is logged on. I can then do my tasks (Remote Assistance and more)
I have to say that i did not have much time to do some further improvements. So it would be nice if someone could further develop this idea. Maybe a custom Management Pack with the attribute can be created.
The RegistryKey WinLogon\DefaultUserName is not present in Windows Vista so the better way i think would be to retrieve the last logged on user via WMI which is also possible with a custom attribute. Maybe someone has an advice on this.
Can't wait for your suggestions.
Réponses
- Hi Thomas,
By default, SCE cannot retrieve the last logged on user on the managed computers. However, you can do it by creating a console task. To do it, you should download a command line utility nemed PSLoggedOn firstly:PsLoggedOn v1.33
http://technet.microsoft.com/en-us/sysinternals/bb897545.aspxThe detailed steps are as follows:
In the Authoring Pane select New Task –> Console Tasks –> Command line
Settings were configured as follows:
Application: %systemroot%\psloggedon.exe
Parameters: \$Target Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$
I should note here that when I preceded this parameter with the -l (local only) and/or -x (dont show times) I got an InnerException Failure message. SCE didn’t like something about those parameters.
Working Directory: c:\windows\temp
And DO check the box for capturing output.
For more information, click the link below:
Console Task: Finding currently logged on user from the SCE / Ops Mgr Console
Thanks,
- Marqué comme réponseYog Li - MSFTMSFT, Modérateurvendredi 26 décembre 2008 03:20
Toutes les réponses
- Hi Thomas,
By default, SCE cannot retrieve the last logged on user on the managed computers. However, you can do it by creating a console task. To do it, you should download a command line utility nemed PSLoggedOn firstly:PsLoggedOn v1.33
http://technet.microsoft.com/en-us/sysinternals/bb897545.aspxThe detailed steps are as follows:
In the Authoring Pane select New Task –> Console Tasks –> Command line
Settings were configured as follows:
Application: %systemroot%\psloggedon.exe
Parameters: \$Target Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$
I should note here that when I preceded this parameter with the -l (local only) and/or -x (dont show times) I got an InnerException Failure message. SCE didn’t like something about those parameters.
Working Directory: c:\windows\temp
And DO check the box for capturing output.
For more information, click the link below:
Console Task: Finding currently logged on user from the SCE / Ops Mgr Console
Thanks,
- Marqué comme réponseYog Li - MSFTMSFT, Modérateurvendredi 26 décembre 2008 03:20
- Unfortunately, it doesn't work at all: Getting the error "Input string [$Target Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$] does not contain any $Target references" when executing the task.
Franz - Yog Li - MSFT said:
Hi Thomas,
By default, SCE cannot retrieve the last logged on user on the managed computers. However, you can do it by creating a console task. To do it, you should download a command line utility nemed PSLoggedOn firstly:PsLoggedOn v1.33
http://technet.microsoft.com/en-us/sysinternals/bb897545.aspxThe detailed steps are as follows:
In the Authoring Pane select New Task –> Console Tasks –> Command line
Settings were configured as follows:
Application: %systemroot%\psloggedon.exe
Parameters: \$Target Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$
I should note here that when I preceded this parameter with the -l (local only) and/or -x (dont show times) I got an InnerException Failure message. SCE didn’t like something about those parameters.
Working Directory: c:\windows\temp
And DO check the box for capturing output.
For more information, click the link below:
Console Task: Finding currently logged on user from the SCE / Ops Mgr Console
Thanks,
For us, this is not an answer, because the proposed solution does not work at all - thomas oeser said:
Hello Together,
i did not want to except that the last logged on user of a workstation cannot be displayed directly in the SCE Console and did some further research on this.
I came around a possible solution to display the information about the last logged on user in a status view. (Only works on XP Clients)
First i created a custom attribute in SCE that retrieves the last logged on user information every 5 Minutes from the registry:
HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultUserName
I saved the attribute in a custom management pack i created before. As Target i chose Windows Client.
After creating the Attribute i went to Monitoring in the SCE Console and created a new status view under my custom management pack. I made a custom view which only includes the netbios name, the ipadress, the status and my new atrribute the last logged on user.
Works like a charm. When someone calls me now i go to status view, search for the user and see on which computer he is logged on. I can then do my tasks (Remote Assistance and more)
I have to say that i did not have much time to do some further improvements. So it would be nice if someone could further develop this idea. Maybe a custom Management Pack with the attribute can be created.
The RegistryKey WinLogon\DefaultUserName is not present in Windows Vista so the better way i think would be to retrieve the last logged on user via WMI which is also possible with a custom attribute. Maybe someone has an advice on this.
Can't wait for your suggestions.
Hi Thomas
This is a very good solution, and it works! This solution is superior to others, because all machines with users are displayed in one table, and the last logged on user for every machine is also visible when the machin is not running.
Thanks a lot!
Franz - thomas oeser said:
Hello Together,
i did not want to except that the last logged on user of a workstation cannot be displayed directly in the SCE Console and did some further research on this.
I came around a possible solution to display the information about the last logged on user in a status view. (Only works on XP Clients)
First i created a custom attribute in SCE that retrieves the last logged on user information every 5 Minutes from the registry:
HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultUserName
I saved the attribute in a custom management pack i created before. As Target i chose Windows Client.
After creating the Attribute i went to Monitoring in the SCE Console and created a new status view under my custom management pack. I made a custom view which only includes the netbios name, the ipadress, the status and my new atrribute the last logged on user.
Works like a charm. When someone calls me now i go to status view, search for the user and see on which computer he is logged on. I can then do my tasks (Remote Assistance and more)
I have to say that i did not have much time to do some further improvements. So it would be nice if someone could further develop this idea. Maybe a custom Management Pack with the attribute can be created.
The RegistryKey WinLogon\DefaultUserName is not present in Windows Vista so the better way i think would be to retrieve the last logged on user via WMI which is also possible with a custom attribute. Maybe someone has an advice on this.
Can't wait for your suggestions.
Hi Thomas
This is a very good solution, and it works! This solution is superior to others, because all machines with users are displayed in one table, and the last logged on user for every machine is also visible when the machin is not running.
Thanks a lot!
Franz
For Vista try doing the same thing with the key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser'. It works a treat!

