Creating a Windows Session

Hi,
My service runs in Session0 of Windows. Since Session0 applications can't have GUI, I want to start an application in SessionN from my service. I found a good API function CreateProcessAsUser() to create a process in some other Session. But if nobody
has logged into the system or the user whose session I want to use, has not logged into the system, I need to create session on my own. I didn't found any API to create a session programatically. I know that it is possible because RemoteDesktop application
also does the same thing. Please help
Rajiv Bansal

hi,
     I have the same issue here. I tired the LogonUser which Sheng mentioned, It worked. and using logonsession to see, it truely create a session using LogonUser. Like following
[15] Logon session 00000000:32694ba6:
    User name:    IP-CNG132W2CJ\testuser2
    Auth package: NTLM
    Logon type:   Interactive
    Session:      0
    Sid:          S-1-5-21-3655873288-4145182009-2901068769-1031
    Logon time:   11/5/2013 1:05:11 PM
    Logon server: IP-CNG132W2CJ
    DNS Domain:
    UPN:
But acturelly OS just created a DosDevices under Session 0. It can be seen using WinObj tool.  As HomeCloset mentioned, LogonUser didn't create real Session for users. So is there anybody can help on how to create Sessions ?
Thanks.

Similar Messages

  • How to create a new session in JSP file

    Usually a child IE window uses same session with parent window. Dose someone know how to create a new session when creating a new IE window by clicking a URL in parent window? The web page is writen by jsp file.

    I am not sure of your question. Are you wanting to have 2 Session objects (one for the parent window and another for the child)?
    A session is usually created once per client and is stored on the server the session id is carried around in a cookie or a URL rewrite so that everytime the user submits a page you will be able to store/access information.
    // this will create a new session object if one doesn't already exist.
    HttpServletRequest.getSession( true );
    Hope this helps

  • Must have a valid X Window Session!?!?

    Hi!
    I recently discovered that if you're about to use the BufferedImage-functionality in the standard Java SDK (1.4.1) then you must have a running X-Window session which the SUN-classes connects to when your create your BufferedImage.
    Why is that?
    I'm running Java on our Linux-server and does not want to have an unecessary X-Window session running just to be able to create BufferedImages in memory.
    Have anyone else discovered this?
    /Charlie

    There are pseudo-X-servers to provide the minimal facilties to a java awt client.
    See also "headless" operation.

  • Dynamic window session title

    Hello,
    I'm running a report with diffrent variants ,in parallel , using   rfc function module with "starting new task".
    All the window sessions that are beeing created
    are set with the same name-the report title.
    How can i set a different title to each window, let say
    the variant title...
    Thanks,
    koby.

    Hello,
    Thank u for the reply.The problem is that i dont know how to handle the title of the
    new window that was created, in the ms_window
    level. The sap passes the report title to that window.If i can take control on this ,
    i think it will be the answer.
    Koby

  • Creating / Handling multiple sessions

    How can I create multiple sessions with Servlets/JSP?
    The requirement is this:
    An admin-type user logs into my application. There, he can see a list of normal (non-admin) users, and should be able to log into those users accounts. Therefore, it is necessary to start a new session as this user, while the he should still be able to be logged into his admin account (and log into more users accounts, if need be). So, the admin session must remain valid, and for each login into a user account, a new session must be created.
    I understand that this is not possible using the standard cookie-based approach, so I turned them off for the respective context in Tomcat and encoded all URLs using <c:url ...>. Still, I don't know how to start a new session, there seems to be no method to do this. When there is an active session, getSession(false) returns it, that's all I get. So how do I create a new session with a new session id?
    While trying to figure this out, I also noticed some odd behavior in Tomcat (Version 6, though this might apply to other Tomcat Versions or even other web containers. If no session is yet active (like, on the Login page of the application), or the active session is being invalidated (as after logout), a new session is created every time one of those pages is accessed. This also happens if no session id is given at all in the URL (and, probably, if an expired session id is submitted, I didn't try this one yet).
    This is not good, simply speaking. This way, the web container will quickly get swamped with ghost sessions that were, on my part, never created, and never used; still, they hang around until they expire, of course.
    Any ideas? :)

    BalusC wrote:
    Tyrathect wrote:
    Bad approach? Could you elaborate please? :)It is just plain cumbersome and coding is impossible without horrible hacks.Hm, why cumbersome? The only difference between your approach and mine is that I would use two seperate sessions, as if the user had logged in using his username and password, while you would use one session for both.
    As for coding, I see no need for hacks. The admin is supposed to be able to create users, enter/change some contact data and do some settings for the users accounts, and log in as that user (without having to ask him for his login credentials) for support cases etc. Where is the need for hacks here? Except maybe if there is no way to create a session from another session...
    but it wouldn't allow for an admin to look into more than one user account at once (right?) which is somewhat a requirement.So you want to impersonate more than one user simultaneously? What's the benefit of this? If you want to switch between users, just go back to the admin panel and pick another user.Yes, or rather, support staff will want to do this.
    This is a common scenario in the company I work for, where 3 support people serve about 1000 active customers (of another, PHP-based project). Customer calls, a supporter will use the admin account to log in to his account and have the problem explained. If the solving takes longer, he will tell the customer that he will look into it and call back when it's sorted out. Now while he is working on this, the next customer calls, so the supporter will use the admin account again to log in this account, also, to have the problem explained etc. If the second problem is solved quickly, he will then just log out of the second customers user session and simply continue working on the first customers problem which is still active in another browser window.
    Now, if the support people can have only one user session open at a time, they will have to close the first customers user session they were working in (probably having to save some work only halfway done) when the second customer calls, log in to that second customers account, help him, log out of the account to go back to the admin panel, log back into the first customer account, resume work there.
    Long story short, while the first approach enables them to do small tasks on the side while working on a bigger problem, this is not possible in the second approach.
    Still, any idea about the rogue sessions when I wrote about in the last paragraph?I don't understand your doubt. Every request should take place in a session. If it isn't there or if it is invalidated/expired, then the appserver will create one. I don't see how that is a problem.Ok, if this is normal behavior, then no problem. I just got suspicios when sessions kept appearing while I was not creating any myself.

  • I cant find my sqlite dtabase created for windows phone 8.1 phonegap app in visual stdio community 2013?

    Hello...
    I am creating a windows phone 8.1 phoegap app.It is using local databse called websql using this link.I created app and datas can be fetch from offline.It is working
    very well
    But the problem is i need to see the databse i created.Where to find the databse.In visual studio there is no option to see the databse.
    There is no editor.
    Please tell me where it is stored?

    Hello,
    Based on my knowledge, the db file usually store in storage folder. You can use the following code snippet to find it.
    WinJS.Application.local.exists(dbname).done(
    function (found)
    if (!found) {
    //not found
    There is sample usage in the link you provided, I would recommend you have a look at this.
    https://github.com/MSOpenTech/cordova-plugin-websql.
    If not help, please post more information about your scenario.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • How to create popup window with radio buttons and a input field

    Hi Guys,
    Can somebody give some directions to create a stand alone program to create a window popup with 2 radio button and an input field for getting text value. I need to update the text value in a custom table.
    I will call this stand alone program from an user exit. 
    Please give me the guidance how go about it or please give any tutorial you have.
    Thanks,
    Mini

    Hi,
    There are multiple aspects of your requirements. So let's take them one at a time.
    You can achieve it in the report program or you can use a combination of the both along.
    You can create a standalone report program using the ABAP Editor (SE38). In the report program you can call the SAP Module pool program by CALL Screen <screen number>. And then in the module pool program you an create a subscreen and can handle the window popup with 2 radio button and an input field for getting the text.
    For help - Module Pool programs you can search in ABAP Editor with DEMODYNPRO* and you will ge the entire demo code for all dialog related code.
    For Report and other Module pool help you can have a look at the following:
    http://help.sap.com/saphelp_nw70/helpdata/en/47/a1ff9b8d0c0986e10000000a42189c/frameset.htm
    Hope this helps. Let me know if you need any more details.
    Thanks,
    Samantak.

  • How to creat new window?

    Hello, got a question, is it possible to creat new window in nokia lumia 800 (check the pic what i mean).
    Solved!
    Go to Solution.
    Attachments:
    nokia-lumia-800-2.jpg ‏33 KB

    Unfortunately no. 

  • I need the code for creating popup windows and code for open and close

    I can write the code for creating popup window , i am getting problem while trying to open and closing that popup windows.
    Can anybody help me in that pls ?
    Regards
    Sreeni.

    Hi
    For pop up window
    IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("PopWin");
    IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
    window.setWindowPosition (300, 150);
    window.show();
    wdContext.currentYourNodeElement().setPopupAttribute(window);
    For closing window code
    IWDWindow window = wdContext.currentYourNodeElement().getPopupAttribute();
    window.hide();
    window.destroyInstance();
    For more infornation refer this link
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/20d2def3-f0ec-2a10-6b80-877a71eccb68&overridelayout=true
    This link is very useful for you.
    Regards
    Ruturaj
    Edited by: Ruturaj Inamdar on Aug 13, 2009 9:10 AM

  • How do I save PSD files created in windows so MAC users can open and work

    I have been designing photoshop files for sale to photographers online and all of my work has been created in a windows 7 system. I had a photographer contact me saying that the PSD was trouble to open and that the fonts would not work on his MAC computer.
    Can someone supply me with information on creating/saving windows PSD files so that a MAC user can open them and also use the fonts I supply with the files.
    The files I create are multilayered PSD's and contain fonts for windows PC use and I don't want to exclude MAC users from utilizing my work.
    Any help appriciated.
    Bqwhitten

    Just save.  There is no difference in files between platforms.
    There are some Windows-centric font formats that aren't portable, by any OpenType or TrueType font will be portable between platforms.

  • How can I create a windows scheduler for shutdown my system in network?

    Hello.
    I want to create a windows scheduler for shutdown my system in a specific time but it can't let me to create it. I used below link to create a task but when I click on Finish it show me an error about permission. I used administrator account too but
    got same error.
    http://www.wikihow.com/Automatically-Shut-Down-Your-Computer-at-a-Specified-Time
    Thank you.

    Hello,
    Can you try opening Task Scheduler as Administrator :
    Right-click on "Task Scheduler" shortcut and select "Run as administrator
    Regards,
    Régis

  • How to create Dynamic Window in Smartforms

    Hi all,
    Could you please help me out on how to create Dynamic Window in smartforms excluding Main Window.
    Thanks in Advance.
    Vinay.

    hi,
    Hi,
    1.If you are creating the Different windows for the Countries,then In conditions tab of window specify the Condition i.e.
    company -code = '2201'.
    2.Then that window can trigger ofr that condition.
    3.Other wise, if you are using the different layouts ,then write the condition in Print program and call that form .
    reward me if helpful.

  • Is it possible to create a Windows 7 Partition via Bootcamp while having an internal RAID 0 Setup ?

    Is it possible to create a Windows 7 Partition via Bootcamp while having an internal RAID 0 Setup ?

    Yes, just not on the RAID. Boot Camp Assistant will only partition a single drive containing OS X. You cannot partition a RAID array.

  • Creating multiple stateful session beans from a java client. (EJB 3.0)

    I'm having difficulties with the following:
    To access the ShoppingCartBean, I have to put the following annotation in my standalone java client:
    @EJB
    private static ShoppingCartRemote shoppingCartBean;
    The static must be there, thus only one ShoppingCartBean will exist within my java client. But as the ShoppingCartBean is a stateful session bean, I want to be able to get different beans of the same type.
    What is the correct way to do this in EJB 3.0?

    Great question. Because Home interfaces have been removed for the EJB 3.0 simplified
    API, stateful session bean creation happens as a side-effect of injection. However, the
    same is true of EJB 3.0 business interface lookups. The easiest way to create additional
    stateful session beans is to lookup the same dependency that was declared via your
    @EJB annotation.
    E.g.,
    // Assuming the declaring class is pkg1.ShoppingCartClient.java
    InitialContext ic = new InitialContext();
    ShoppingCartRemote scr1 = (ShoppingCartRemote)
    ic.lookup("java:comp/env/pkg1.ShoppingCartClient/shoppingCartBean");
    Note that the name relative to java:comp/env is the default associated with your
    @EJB annotation since the name() attribute wasn't used. Alternatively, you
    could have used :
    @EJB(name="scb") private static ShoppingCartRemote shoppingCartBean;
    InitialContext ic = new InitialContext();
    ShoppingCartRemote scr1 = (ShoppingCartRemote) ic.lookup("java:comp/env/scb");
    Yet another alternative is to declare the @EJB at the class-level. This just defines
    the dependency without any injection, which is fine if you want to create a bunch of
    them via lookup anyway.
    @EJB(name="scb", beanInterface=ShoppingCartRemote.class)
    public class .... {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Creating a window through a DLL called through CLFN

    Hi, sorry if this is a relatively simple problem but I've been unable to find proper results after a couple hours or so of searching.
    My group is interacting wtih a DLL that requires a window to draw to. We tried drawing directly to a LabVIEW window (using the FindWindow function through the Windows API), however while that worked we were unable to save the drawn image (the Front panel-> export image invoke node wouldn't save the drawn image). 
    So, what we did was write some C code and make a wrapper DLL that creates a window to draw to through the CreateWindow function, which we would then export to our main vi (less than ideal, but that's another problem). However, when we call up this wrapper DLL via the CLFN, it won't create the window.  Windows doesn't throw an error, it just won't instantiate the window at all and the function returns an error that the window was never created. The reason I'm posting this problem here instead of a general C++ forum is because we've tested out this wrapper DLL via a test project that imports the DLL and it works fine.
    This is how I'm setting up the window. I pass the LabVIEW Window found via the FindWindow function in as hInst (sorry for the formatting, I tried the HTML <code> tag and the board doesn't seem to accept it):
    int initializeWindow(HINSTANCE hInst)
        // Initialize global strings
        LoadString(hInst, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
        LoadString(hInst, IDC_WINDOW_CLASS, szWindowClass, MAX_LOADSTRING);
        MyRegisterClass(hInst);
        // Perform application initialization:
        if (!InitInstance (hInst, 1))
            return 0;
        return 1;
    ATOM MyRegisterClass(HINSTANCE hInst)
        WNDCLASSEX wcex;
        wcex.cbSize = sizeof(WNDCLASSEX);
        wcex.style            = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNCLIENT;
        wcex.lpfnWndProc    = WndProc;
        wcex.cbClsExtra        = 0;
        wcex.cbWndExtra        = 0;
        wcex.hInstance        = hInst;
        wcex.hIcon            = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UVIEW));
        wcex.hCursor        = LoadCursor(NULL, IDC_ARROW);
        wcex.hbrBackground    = (HBRUSH)(COLOR_WINDOW+1);
        wcex.lpszMenuName    = MAKEINTRESOURCE(IDC_UVIEW);
        wcex.lpszClassName    = szWindowClass;
        wcex.hIconSm        = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
        return RegisterClassEx(&wcex);
    BOOL InitInstance(HINSTANCE hInst, int nCmdShow)
       hwnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE | WS_DLGFRAME |  SS_BLACKRECT,
          0, 0, X_WINDOW_SIZE, Y_WINDOW_SIZE, NULL, NULL, hInst, NULL);
       if (hInst == NULL)
            MessageBox(hwnd, TEXT("Problem making instance"), TEXT("ERROR"),0);
            return FALSE;
       if (!hwnd)
          MessageBox(hwnd,TEXT("Problem making window"),TEXT("ERROR"),0);
          return FALSE;
       ShowWindow(hwnd, nCmdShow);
       UpdateWindow(hwnd);
       return TRUE;
    LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     // Standard WndProc implementation.. probably not worth posting all the code unless necessary
    Does anyone see an obvious problem? Or something I should try?
    Thanks in advance!
    Message Edited by wgerard on 05-16-2010 12:18 AM

    I can be short about that. A Windows HINSTANCE is NOT a HWND by a long stretch. The first is a module handle and the second is ... well yes a window!
    FindWindow() returns a HWND and you can use that as parent handle for another window, but you can not use it as HINSTANCE ever.
    To get at the HINSTANCE for registering new window classes you will need to extract that somehow from the HWND, probably by something like GetWindowLongPtr(.., GWLP_HINSTANCE, ..) or something similar.
    But you won't be able to retrieve your own resources from that instance, because it is the instance for the LabVIEW executable, not your DLL.
    Message Edited by rolfk on 05-16-2010 10:31 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for