Risorse per professionisti IT > Home page del forum > System Center Essentials - General > Possible Solution: Display Last Logged On User
Formula una domandaFormula una domanda
 

Con rispostaPossible Solution: Display Last Logged On User

  • mercoledì 10 dicembre 2008 20.01UTTO Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     

     

    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.

     

     

     

Risposte

  • venerdì 12 dicembre 2008 8.19Yog Li - MSFTMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    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,

Tutte le risposte

  • venerdì 12 dicembre 2008 8.19Yog Li - MSFTMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    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,

  • venerdì 19 dicembre 2008 9.36FranzSchenk Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    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
  • martedì 30 dicembre 2008 10.51FranzSchenk Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    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
  • martedì 30 dicembre 2008 12.16FranzSchenk Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    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
  • giovedì 2 luglio 2009 12.18Stuart.Clarke Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    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!