VMware {code} Community
moakan
Contributor
Contributor

Identity Impersonation

Hi,

I have written a client program using the Vix api. It is suppose to run with the credentials of a pre-defined user account. It runs fine under the current user account who has Administrative previledge in the server. But when it runs with the credentials of pre-defined user account, it is crashing. To avoid this, I have impersonated the pre-defined user account to use the credentials of a user account (may be the current user or other with Admin preveledge) passed as arguments. But it is not working.

Sequence of operation as like below:

1. run the client under pre-defined user account.

2. Create a user token with credentials (have Admin previledge) passed as argument,

3.Impersonate the pre-defined user account with user token created in step 2

4. try to do operations in VMs in VMware server

It is not working.

Do you have any idea about it? Does this Vix API will work under impersonated user account?

Thanks!

0 Kudos
2 Replies
admin
Immortal
Immortal

Are you trying to connect to a local server host or a remote server?

If it is the local case, can you try connecting as if remote (that is, pass an IP address, port, user name, and password)?

Is the impersonation related to connecting/authenticating with the server, or for some other purpose?

0 Kudos
moakan
Contributor
Contributor

I am calling the Vix API from a test client written in C#, using PInvoke. I impersonate the user, then create a thread from the managed code, then call the Vix API to connect with server . When it returns from the Vix API, the thread doesn't retain the impersonated context.

I have used the full computer name to connect.

0 Kudos