Solved

NT Admin access from a User context

Posted on 1998-11-13
8
160 Views
Last Modified: 2010-04-30
I am trying to create a VB prog which will read and write to the NT registry that the system or administrators only have access to.  The program must be launched from the basic User context security level.

If I was doing the task in a batch routine I would us the resource kit utility SU to switch from the user account to an admin just for that script/program.

Is there any alternative or API function call that I can use in VB to solve this issue ?
0
Comment
Question by:mdtt94
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1444709
I know how to change the perimissions of files, but not how to take the context of other users.
0
 

Author Comment

by:mdtt94
ID: 1444710
Thanks but I need to access registry keys that the users are not permitted to use.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1444711
It has do with impersination levels and stuff like that. It was hard to program in C++ so it will be even harder in VB.
BTW: Your solution needs the administrator password, am I right?
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Expert Comment

by:jcstrider
ID: 1444712
What exactly are you trying to do? I've spent alot of time buried in the registry and could help with what you are trying to do. You could possibly do a service and have a regular user start that service (which runs under the admin account) and that service could access the registry. Give me some more info and I'll check into it.
0
 

Author Comment

by:mdtt94
ID: 1444713
It's really a simple front end program that takes some users details and distrubutes the information to various keys in the registry (to set up mulitiple applications which use user information or profiles - Like Netscape, Office etc).  The program also needs to read and write parts of the registry that normal users don't have access to (Computer Name, Logon Name and maybe more).  This information only comes through if you have admin permissions on the workstation.
0
 

Expert Comment

by:jcstrider
ID: 1444714
The only way that I can think of is to write a service that runs under the admin account and have your app start it up and get the information from that. If all the keys you need are in the HKEY_LOCAL_MACHINE you can read that. Most info is kept there and all users should have access to them. I went the services route and found that is was very easy to code and get the info I needed. There is a guy who wrote an article on how to write services and I think he has something regarding the registry also. his http is http://www.flash.net/~ljjohnsn.

John Cantley
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1444715
It would be a security breach if what you want could be done. Therefor it cannot be done.
0
 

Author Comment

by:mdtt94
ID: 1444716
I have found out how to use the API calls to get the information on the computername and user rather than look them up in the registry from the secure keys.  Thanks for your help anyway.  It would indeed be a security problem if a user could access these keys.

Cheers,

Mark
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question