How to how to get the privilege of domain controller

L

Leo

Hi,
guys.
I want to use c# to get the privilege of a domain controller in a
non-DC machine as i have the user name and password of DC.
But i can't find any functions in MSDN.
Has anyone met the same problem?

regards
Leo.
 
W

Willy Denoyette [MVP]

| Hi,
| guys.
| I want to use c# to get the privilege of a domain controller in a
| non-DC machine as i have the user name and password of DC.
| But i can't find any functions in MSDN.
| Has anyone met the same problem?
|
| regards
| Leo.
|

It is not clear to me what you mean with this, could you be more explicit
and tell us in a few words what you are trying to accomplish.

Willy.
 
L

Leo

Sorry. It's my fault.

For example, I have a domain with machine A, B and C.
A is the domain controller. It can access the info in B and C, like
files or registry, etc.
Now i want to write a program running in B.
The program needs to fetch the info from A and C.
This operation needs the privilege of domain controller, but i don't
know how to get it.


"Willy Denoyette [MVP] дµÀ£º
"
 
W

Willy Denoyette [MVP]

Sorry. It's my fault.

For example, I have a domain with machine A, B and C.
A is the domain controller. It can access the info in B and C, like
files or registry, etc.
Now i want to write a program running in B.
The program needs to fetch the info from A and C.
This operation needs the privilege of domain controller, but i don't
know how to get it.

You don't seem to understand how domain membership works, do you? The domain
controller has no access to B and C, domain accounts may have access to B
and C, and this only when they are given access to resources on B or C.
This means that if you have a domain account with access privileges to B and
C, you need to logon into the domain using this domain account and run the
program. If you login usung a local account (say on B), you'll have to call
Win32 API 'LogonUser' using the domain credentials in order to obtain an
access token, and impersonate this token when accessing A or C's resources.
The framework doc's on MSDN have an example that illustrates this (search
for LogonUser).

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top