Regd Last Logon of User Logged onto portal

Hi Experts,
I am new to Enterprise Portal developments. I have a requirement like to display the last logon date and time of a person logged onto the portal.
The Last Logon date and time ought to be displayed in the portal masthead. I already tried a few methods in doing it but it was not successful.
In my coding I used getUserFactory() method to get the user data, but the compiler is throwing a compiling exception. I have included the com.sap.security.api.jar file. (Development is done in NWDS)
Still its showing error. Is there anything I am missing in the above method. Is there any easier method than the above ??
Thanks in Advance. Your help will be highly appreciated!!
Regards
Anand Sekar

Hi Anand,
You can use the below code to get the information you are seeking. To test it create n abstract portal component and copy and paste below code:
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
          DataSource dataSource= null;
          ResultSet resultSet= null;
          String sqlStatement =null;
          ResultSetMetaData rsmd =null;
          String nativesqlStatement=null;
          try
          sqlStatement = "select MAX(TIMESTAMPHOUR),LOGONID from WCR_USERSTAT GROUP BY LOGONID";
               InitialContext initialContext= new InitialContext();
               dataSource= (DataSource) initialContext.lookup("jdbc/SAP/EP_PCD");
               java.sql.Connection connection= dataSource.getConnection();
               java.sql.Statement statement= connection.createStatement();
               Statement stmt=NativeSQLAccess.createNativeStatement(connection);
               resultSet= statement.executeQuery(sqlStatement);               
               rsmd=resultSet.getMetaData();
               if(resultSet!=null)
                    int m = 0;
                    response.write("<html>");
                    response.write("<body>");
                    response.write("<br>");
                    response.write("<TABLE width='100%' border='2' cellspacing='2'>");
                    response.write("<tr>");
                    response.write("<td>"+"LAST SUCCESSFULL LOGON" +"</td>" );
                    response.write("<td>"+"LOGONID"+"</td>" );
                    response.write("</tr>");
                    while (resultSet.next()) {
                         m++;
                         Timestamp ts = new Timestamp(resultSet.getLong(1));
                         response.write("<tr>");                         
                         response.write("<td>"+ts.toGMTString()+"</td>" );
                         response.write("<td>"+resultSet.getString(2)+ "</td>");
                         response.write("</tr>");
                    response.write("</table>");
                    response.write("<br>");
                    response.write("Record count is " + m);
               catch (Exception e)
                     response.write("<br>Exception : " + e);
                     response.write("</body>");
                     response.write("</html>");

Similar Messages

  • What is the last time a user logged in?

    I want to create a portlet which shows the last time a user logged in (before the current session)
    As PORTAL user using sql, I could query view orasso.wwsso_audit_log_view , but this view is not accessible for normal users in the portal. So I can't access this view in a dynamic page portlet.
    What's the best way to retrieve this info?
    Regards,
    Ton

    Ton,
    create a PL/SQL function in the Portal schema that accepts username as a parameter and returns required data. Grant execute privilege on that function to PUBLIC or to a DB schema in which you are building your portlet.
    Cheers

  • Can I see when the last time a user logged was?

    Can I see when the last time a user logged was?
    Both in local directory and Open Directory

    I got the last ~10 logins on the computer, but not the last time a specific user was logged in.

  • Script needed to query last logon for users within an AD security group

    Hi all,
    I'm looking for a vbscript that will query a specific AD security group, and export the following information into an Excel document:
    1. Full name of the user.
    2. A timestamp of the last logon for each user.
    Any help would be great.

    At the moment I'm using a batch script to attempt to query a few different security groups. Below is a line from the script:
    dsquery group -samid <group name> | dsquery * -filter "&(objectClass=person)(ObjectCategory=user)" -attr cn lastLogonTimestamp
    There a two issues with the command.
    1. The results aren't being pulled from the security group specified.
    2. The timestamp is in an unreadable format. I've understand this needs to be converted?
    The Powershell option looks handy, but sadly the clients environment is Server 2003 based with no Powershell option.

  • Different masterhead image based on the user logged in portal

    HI,
    Presently we are using standard portal theme.How can I change the image in the masterhead based on the user logged in.How can i change that and i want to assign that masteredhead to users.
    Can anybody give me suggesion about this.
    Thanks,
    Regards,
    Srinivas

    Dear Srinivas,
    Simple of achiving this kind of scnario is create separate themes for different users and assign the themes to the users in master rule collection through Desktop Page.Here in this case you will be creating one framework page and multiple Desktops and themes.All the desktops will be having the same framework page and different themes based on the user type or group type.
    Otherway of achiving this is create an pdk application where it will have multiple jsp components in it and based on the each component create one PAR iview.Let us take if four groups of users then you will be creating four different jsps in pdk application which will inturn contains different masterhead images and related logos.After creating the iview place the iview in the correcsponding framework page below the masterhead iview.Here multiple framework pages and Desktops and you can go with single theme.
    In the first scenario the masteread , we are managing through the theme and in second the masterhead we are managing throgh application.
    Either of the scenarios can be used to create differet masterheads for different users.
    Hope the answer helps you....
    Reward the points if it is helpful.
    Thanks,
    Rudradev Devulapalli

  • LabView hangs when trying to load the same VI with a different user logged onto Win2k

    When 'User A' is logged onto Win2k, a particular VI loads and runs fine. When 'User B' logs onto the same Win2k box, LabView hangs when trying to load the VI.
    I'm also not seeing the setup channels in the Data Neighborhood in MAX when logged on as 'User B'. I tried loading the configuration when logged on as 'User B' that I think is being used for 'User A', but nothing happens.
    Where are the configuration files (of whatever type) that tell LabView which user is logged on?
    Thank you!

    There are no configuration files that tells LabVIEW what users are logged on. It is Win2K permissions settings that allow different users access to different folders and applications. Try changing the permissions for the LabVIEW folder and see if that doesn't fix your problem.

  • Restrict the number of users logging onto the JAVA engine

    hi
    IS it possible to restrict the number of users logging on the JAVA Engine, if YES, how ?
    Thanks
    Jonu Joy

    Thanks for the replies, here's a little more info...
    We're working on project which allows a company to buy user licenses to access our portal.  So if a company has bought 5 licenses, the 6th user for that company will not be able to login.
    *Note: We treat each Access Key in the portal as a company.
    The way we determine if the user belongs to a company is by the AccessKey that is assigned to that user. We're not depending on IP addresses at all.
    Hope this clears the issue !
    I think we'll have to write some custom code to accomplish this.
    Thanks,
    harman

  • Problem in logging onto portal "Java iView Runtime " error

    Hi,
    We are getting the following message when trying to logon to the portal.
    "Java iView Runtime
    Version : 5.0.200212121529
    (c) 2001 SAP Portals
    The following exception occured while processing your request:
    com.sapportals.portal.prt.runtime.PortalRuntimeException: delegatedplugin
    Exceptions details :
    com.sapportals.portal.prt.runtime.PortalRuntimeException: delegatedplugin
         at com.sapportals.portal.prt.portalconnection.sapnative.DelegatedPlugIn.handleRequest(DelegatedPlugIn.java:1044)
         at com.sapportals.portal.prt.portalconnection.sapnative.PortalPlugIn.handleRequest(PortalPlugIn.java:132)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:635)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)
         at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:833)
         at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:672)
         at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:314)
         at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)
         at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)
         at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
         at com.inqmy.core.cluster.impl3.ParserRunner.run(ParserRunner.java:30)
         at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)
    Caused by: javax.naming.NameNotFoundException: PortalLicense not found
         at com.sapportals.portal.prt.service.jndi.PortalServiceProviderContext.lookup(PortalServiceProviderContext.java:58)
         at com.sapportals.portal.prt.service.jndi.PortalServiceProviderContext.lookup(PortalServiceProviderContext.java:65)
         at javax.naming.InitialContext.lookup(InitialContext.java:345)
         at com.sapportals.portal.prt.portalconnection.sapnative.DelegatedPlugIn.handleRequest(DelegatedPlugIn.java:240)
         at com.sapportals.portal.prt.portalconnection.sapnative.PortalPlugIn.handleRequest(PortalPlugIn.java:132)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:635)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)
         at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:833)
         at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:672)
         at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:314)
         at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)
         at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)
         at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
         at com.inqmy.core.cluster.impl3.ParserRunner.run(ParserRunner.java:30)
         at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)
    If this situation persists, please contact your system administrator"
    Tried restarting the portal servers but the problem still persists.
    Request you to please suggest the solution for the same.

    Hi Sireesha,
    When it is working last time.
    Are any changes made to portal recently
    may be it is a permission issue in security zones.
    Below links may help you.
    http://help.sap.com/saphelp_nw04s/helpdata/en/25/85de55a94c4b5fa7a2d74e8ed201b0/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/ee/acd8403e37762ae10000000a155106/content.htm
    Raghu

  • User log in Portal

    Hi All
    One of the user password is changed in the portal.
    Now where i can see the log of this user, who has changed, when changed and from which terminal.
    If so please mention the detail navigation to see these logs and advice needed.
    Thanks in Advance.
    Regards
    Bhaskar.T

    Hi,
    What's your UME Data source?
    If you are using Abap Datasource then check in Change documents(SUIM).
    if you are using Java Datasource, i believe you can check with identity management.
    Please have a look on the below link.
    http://help.sap.com/saphelp_nw70/helpdata/EN/b2/4f9b3e1f1e7c7de10000000a114084/frameset.htm
    -Srini

  • Unable to log onto portal as an Administrator

    Hi Experts,
    I am facing a problem in logging on to the portal server as an Administrator on its homw page : http://<sid>:port/irj/portal .
    While i try to log in to visual admin , i am able to do so with the same id.
    Any specific reason for this ??
    Regards,
    Ashish Shah

    Hi Ashish,
    If the portal installation is on a dual stack installation(server with ABAP and JAVA Stack on the same server), then the default j2ee admin user is j2ee_admin.If it is on pure java stack installation, the j2ee admin user is administrator.For the dual stack installations, SAP* user would be there for ABAP administration.
    If you are going to configure the Portal for UME as ABAP datasource, then make it sure that the same admin and guest users are not there both on the portal server and ABAP server.If the same users ids are on both servers, then you will not be able to login on to the portal server using that particular user ID. Unique user ids should be maintained if you are planning for UME as ABAP Datasource.
    Just refer this note for getting details on supporting datasource changes. note number - 718383. In this note, it is clearly mentioned that, if you have already changed the datasource to ABAP, then we will not be able to revert it back to original state.So be aware before doing the datasource change.
    Just refer this forum for further clarifications on UME as ABAP datasource and regarding SSO especially with this configuration. I have mentioned i clearly in this thread.
    Re: EP User Creation through SAP ECC
    Regards,
    Kishor Gopinathan

  • Since the last upgrade i cannot log onto my internet banking. It won't accept my usual access number or format

    I can no longer log in to my internet banking. it keeps asking me to use the correct format in my access number, but i haven't changed anything. I have spoken to my bank and they said that it is an issue with the latest Firefox update and that Firefox are aware of it. I just need it fixed or i will have to go back to a previous version of Firefox.

    I use only support.mozilla.org and never used any other websites. However, the same problem here. My ID and Password are not accepted. Had to create a new account with a temporary email to use Support - it would not allow me to use my main email, because "it is used by another account". Try to reset password - receive no email (even though there is a confirmation on the website that email to reset password has been sent). At the same time can easily receive a confirmation about User ID and account activation. Thus, the account is completely locked, and I can not use my email address for a new one. Please fix this problem.

  • 12 users log onto 1 computer with their unique password, firefox will not open for them.

    I have multiple users (12-15) that share a computer. I installed firefox under my login (Admin). it opens on my login , but none of the other users can open firefox with their login. I have other computers that everyone can use firefox on their login so it is unique to this single computer.
    == This happened ==
    Every time Firefox opened
    == since installing firefox under my login.

    I have exactly the same issue. After FF upgraded on its own to version 5, it won't open from start menu, taskbar, desktop icon, or even by pressing firefox.exe in program files directory. It does so by pressing a link at msn messenger, inside Outlook etc.
    Disabling all addons, didn't help. Moreover, I can't start FF in safe mode or start profile manager (Start > Run> firefox.exe -ProfileManager).
    OS: Windows 7 64bit
    Windows Event Viewer entry details:
    Faulting application name: firefox.exe, version: 5.0.0.4183, time stamp: 0x4df95302
    Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
    Exception code: 0xc0000005
    Fault offset: 0x8c724fa6
    Faulting process id: 0xc0c
    Faulting application start time: 0x01cc37fe2fae7e8b
    Faulting application path: C:\Program Files (x86)\Mozilla Firefox\firefox.exe
    Faulting module path: unknown
    Report Id: 6e7f03eb-a3f1-11e0-8f4d-a4badb0238f6

  • Whenever User Logs Onto Sap Its In A Different Language

    Hi Experts,
    I have a situation where I deleted the language files off the server, but whenever one of my users connects to SBO through a client machine it picks up a different language. Is there anything I can change on the client side to fix this?
    Regards,
    Lebo

    I had a similar problem, I was able to do a workaround by deleting the Language files not required off the Client and not off the server.
    What I did to fix this is:
    I explore to C:\Program Files\SAP\GUI
    Then deleted all the languages package except English.
    I'm assuming that will work for the other languages as well.
    Edited by: M. Jenkins on May 7, 2009 1:13 PM

  • Portal users - last logon time details

    Hi , 
    We have an requirement to get the list of users who logged in with the Last Logon Information  .
    From Standard Portal activity report ...we can get only the First logon date of the users .
    Kindly let us know the other possibilities to get it .
    Thanks ,
    Keerthi

    Hi Keerthi,
    Apart from Coding there is one option available through Authentication logs,this is tested in NW7.3 iam not sure which version you are using if you are using 7.0 then please check if this is available in 7.0 or not.
    1) Go to NWA
    2) Go to troubleshooting and logs section
    3) Open log viewer and choose Authentication logs from the logs option
    4) Specify the time frame in filter and choose everywhere for the logs to be picked up in generated report ,this wil gather authentication data from all server nodes.
    5) these logs will show each and every login performed bu Useres and it also shows how many times user have logged in to a particular application,choose IRJ as the application.
    6) Export the content to excel file and apply filter ,choose aplication as IRJ and choose date and time and select a user it will show all login with the date and time.
    7) You can feed this data to a predefined excel format and pull out necessary info ,only you need to develop an excel template for your reporting purpose and manually logs requires to be pulled in from NWA to feed the excel .
    this is another way which does not involve any java coding and tested on NW7.3 versions of Portal.
    hope this helps.
    Thx,
    Siddharth

  • Need to find Logon Group in which the user Logged in

    Dear Experts,
    I have a issue to find the logon group while logging into the SAP
    For example
    One server having three LogonGroups
    1) MFSTRESS
    2) TEST
    3) HQSTRESS
    in that I want to find out the logon group in which the user logged in. I am not able to find in the transaction SMLG or AL08
    Is ther any function module is available  or any other way to find the logongroup.
    Please help on that its very urgent . I will reward the points immediately.

    hi,
    TH_USER_INFO – Returns information about user
    TH_USER_LIST – Displays users logged onto server
    Hope this helps, Do reward.

Maybe you are looking for

  • Hearing Aids try to pair with multiple Devices!

    My wife just got a pair of Starkey Halo hearing aids, and we've had some problems getting them paired successfully, consistently, and keeping them paired. One key problem is our household has multiple iOS devices (iPhone 5, 6, 6+, iPad Air, iPod Touc

  • How to make WLC 5508-HA controller mantainance mode to HA mode

    Hi, I have two wlc 5508 with HA mode, If unfortunally redudndent link disconnected and standby wlc goes to mantainance mode. then again I connected redundent link but second wlc does not come in ha, it still remain in mantainance mode. What is the co

  • Change price during GRN

    Dear Experts, Please check this We create a PO for a year (eg, 1000 nos @ 10 INR) For the first partial delivery we receive @ the same price=10 Say for following  delivery after long time we receive the goods @ say 15 INR and we accept the price from

  • BAPI : Network internal Number range

    hi all, I am using bapi_project_maintain , in this i am giving  network as external number . Is there a way to generate internal number for network  using this bapi . Thanks , sridhar .

  • How do I find / reinstall NHL Gamecenter on Apple TV 2?

    It has totally disappeared.  The software says it's up to date.  Thank you!