Resources for IT Professionals > 포럼 홈 > System Center Essentials - General > Possible Solution: Display Last Logged On User
질문하기질문하기
 

답변됨Possible Solution: Display Last Logged On User

  • 2008년 12월 10일 수요일 오후 8:01UTTO 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

     

    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.

     

     

     

답변

  • 2008년 12월 12일 금요일 오전 8:19Yog Li - MSFTMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
    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.aspx

     

    The 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

    http://www.systemcenterforum.org/news/console-task-finding-currently-logged-on-user-from-the-sce-ops-mgr-console/

     

    Thanks,

모든 응답

  • 2008년 12월 12일 금요일 오전 8:19Yog Li - MSFTMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
    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.aspx

     

    The 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

    http://www.systemcenterforum.org/news/console-task-finding-currently-logged-on-user-from-the-sce-ops-mgr-console/

     

    Thanks,

  • 2008년 12월 19일 금요일 오전 9:36FranzSchenk 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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
  • 2008년 12월 30일 화요일 오전 10:51FranzSchenk 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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.aspx

     

    The 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

    http://www.systemcenterforum.org/news/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
  • 2008년 12월 30일 화요일 오후 12:16FranzSchenk 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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
  • 2009년 7월 2일 목요일 오후 12:18Stuart.Clarke 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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!