IDsObjectPickerCredentials object

The IDsObjectPickerCredentials interface allows you to override credentials for the IDsObjectPicker object implementing this interface.

To obtain an instance of this interface, call QueryInterface with the IID_IDsObjectPickerCredentials interface identifier as shown below.

When to use

Use this interface when you need to override the current credentials, replacing them with a different set of credentials most commonly with higher privileges.

Methods

The IDsObjectPickerCredentials object has these methods.

MethodDescription
SetCredentials

Sets credentials to be used by the Object Picker.

 

Examples



//
// Code fragment showing use of Object Picker interfaces.
//
static BOOL InitCredentials(IDsObjectPicker *pDsObjectPicker,
				LPCWSTR szUser,
				LPCWSTR szPassword)
{
	HRESULT hr;
	IDsObjectPickerCredentials* pDsObjectPickerCredentials = NULL;

	// Get the interface needed.
	hr = pDsObjectPicker->QueryInterface(IID_IDsObjectPickerCredentials, 
				(void**)&pDsObjectPickerCredentials);
	if (FAILED(hr))
	{
		// Failure - interface not supported.
		goto exit;
	}

	// Set the credentials to be used.
	hr = pDsObjectPickerCredentials->SetCredentials(szUser, szPassword);
	if (FAILED(hr))
	{
		// Failure - invalid credentials.
		goto exit;
	}

exit:;
	// Done
	if (NULL != pDsObjectPickerCredentials)
	{
		pDsObjectPickerCredentials->Release();
	}
	return SUCCEEDED(hr) ? TRUE : FALSE;
}

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008

Header

Objsel.h

DLL

Objsel.dll

IID

IID_IDsObjectPickerCredentials is defined as e2d3ec9b-d041-445a-8f16-4748de8fb1cf

 

 

Show: