Question

When submitting a job to a Microsoft HPC Server by using the HPC's API, a job is submitted by calling the SubmitJob function:

void SubmitJob (ISchedulerJob job, string username, string password);

If the username is null, the system uses the Windows' username, if the password is null, the system searches for a cached password.

If there isn't a cached password (or the cached password is incorrect), the system prompt a console screen that requests the user's password (until the correct password has been entered).

I want to avoid this screen, instead I would like to check if the user has a correct cached password, otherwise present my own dialog instead of the default console screen.

The problem is that so far I was unable to find a way to do so, IScheduler has a method called GetUserPrivileges() which tell you if the user has No Access \ User \ Admin privileges on the server. But it would return User for any existing username on the server, nevermind if a cached password exists.

Is it possible to check before submitting a job if a user has a correct cached password, and if not, request a password? or perhaps replacing the default request password console with my own custom dialog?

Was it helpful?

Solution

From MSDN:

For Windows HPC Server 2008 R2, you can indicate that the SubmitJob method should generate an exception if cached credentials cannot be used for the job. To indicate that SubmitJob should generate an exception in that case, specify a value of false for the isConsole parameter and an IntPtr object for a value of -1 as the hwnd parameter when you call the SetInterfaceMode method. For example, SetInterfaceMode(false, new IntPtr(-1));.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top