ICluster.SetCachedCredentials Method
Sets credentials for the specified user in the credential cache.
Namespace: Microsoft.ComputeCluster
Assembly: CcpAPI (in ccpapi.dll)
Usage
Syntax
'Declaration
Sub SetCachedCredentials ( _
userName As String, _
password As String, _
isConsole As Boolean, _
hwndParent As Integer _
)
void SetCachedCredentials (
string userName,
string password,
bool isConsole,
int hwndParent
)
void SetCachedCredentials (
String^ userName,
String^ password,
bool isConsole,
int hwndParent
)
void SetCachedCredentials (
String userName,
String password,
boolean isConsole,
int hwndParent
)
function SetCachedCredentials (
userName : String,
password : String,
isConsole : boolean,
hwndParent : int
)
Parameters
- userName
The name of the RunAs user, in the form domain\username, under which the job will run. If NULL, the method adds the calling user's credential to the cache. The user name is limited to 80 Unicode characters.
- password
The RunAs user's password. The password is limited to 127 Unicode characters. If this parameter is NULL or empty, the current user is prompted for the credentials. If the isConsole parameter is true, the user is prompted in the console window; otherwise, the standard credentials dialog box is used.
- isConsole
Set the value to true if the application is a console-mode application. Set the value to false if the application is a GUI application.
- hwndParent
The handle to use as the parent window for the modal credentials dialog box. If 0, HWND_DESKTOP is used. The handle is ignored if isConsole is true.
Remarks
Each cluster manages its own credentials cache. (If you specify credentials on cluster A, the credentials are not available to cluster B.) The cluster creates a cache for each user that calls this method. A user's cache can contain one or more valid credentials. If the credential already exists in the cache, the credential is overwritten.
If you call the ICluster.SubmitJob method (or any method that asks for credentials) and set the userName parameter to NULL, the cluster searches the calling user's credential cache for the credentials to use. If the cache contains only one credential, that credential is used. If the cache does not exist or contains multiple credentials, the user is prompted for the credentials.
To specify cached credentials for a job after the job has been queued, call the ICluster.SetJobCredentialsFromCache method.
To delete cached credentials, use the ICluster.DeleteCachedCredentials method. Only the user that cached the credentials can delete the credentials.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Development Platforms
Microsoft Windows Compute Cluster Server 2003, Windows Server 2003, Windows XP
Target Platforms
Microsoft Windows Compute Cluster Server 2003, Windows Server 2003 with Compute Cluster Pack Client Utilities, Windows XP with Compute Cluster Pack Client Utilities
See Also
Reference
ICluster Interface
ICluster Members
Microsoft.ComputeCluster Namespace
ICluster.DeleteCachedCredentials Method
SetJobCredentials
SetJobCredentialsFromCache