I am trying to run an application on Server 2012 as local user (system) and hit a db2 server (on another 2012 machine), when remotely logged in. I am trying to do this in code (VB.NET). I'm not sure how to go about this without using 3rd party software as suggested in other posts.
I may be able to get by with getting the server user name and using that in my connection string. But I can't seem to get that either. The closest I can get is:
Dim x = Environment.UserDomainName
This only gives me my local user, not the server (local user) I am logged on to. I need to launch this application (or modify my connection string, both would work) so 2012 and db2 do not throw a fit when trying to connect to the db.
**EDIT: I made this change in the execution level: http://blog.hazaveh.net/2011/05/make-your-visual-basic-application-run-as-administrator/
And it prompts to run it as admin, but works. Any other solutions or I'll make that an answer.
I found a way way to force the program to launch as administrator, which solves my problem. The answer is: here
In the VB Project Properties, under Application Tab, the View Window Settings I changed the "RequestExecutionLevel" from "asInvoker" to "requireAdministrator".
Now, when the program is installed on the 2012 Box it is run as admin and fixes the issue I was having.