Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impersonate System Account

Status
Not open for further replies.

pmegan

Programmer
Aug 29, 2005
1,186
US

I'm hoping somebody can help me out with this.

Is it possible to impersonate the system account from a vb.net windows application? If so, how do you go about it?

Here's my situation. I inherited a home-grown desktop application, vb.net 1.1, that's loaded on about 70 w2k & XP Pro computers in 14 locations. I've been assigned the lovely job of adding some error handling so our MIS guys can get accurate info when there are problems. They asked if it could be in seperate event log to make remote management easier.

I have this working on my test system, the issue is creating the log on the live pc's. Basically when the rewritten error library is called it checks for the new log and creates it if needed. My problem is that you need local admin rights to create a log, and the people using this program absolutely do not have that kind of access.

What I'd like to do is impersonate the system account long enough to create & configure the log and then revert back to the user who logged on.

Does anybody have any ideas?

Thanks,
Pat


 
I just dealt with a similar issue. You can impersonate a system account to open files on the local computer. Impersonation will mimic the credentials of the specified user. However, to open log files on remote computers from within the app, you need to use delegation.

Hope this helps.
 
Thanks for the response.

I don't I worded the question right. The users don't have the privilege to create new logs, so I'm actually trying to create the new log under the local system account. Since we change passwords on a semi-regular basis I can't hardcode the user/pass.

Pat

 
Can you write to the Windows EventLog?
If your IT guys are using a systems tool like MOM or NetIQ, they ought to be able to remotely read the entries you put in. No file needed.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top