Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The ADsGetObject function binds to an object given its path and a specified interface identifier.
HRESULT ADsGetObject(
[in] LPCWSTR lpszPathName,
[in] REFIID riid,
[out] VOID **ppObject
);
[in] lpszPathName
Type: LPCWSTR
The null-terminated Unicode string that specifies the path used to bind to the object in the underlying directory service. For more information and code examples for binding strings for this parameter, see LDAP ADsPath and WinNT ADsPath.
[in] riid
Type: REFIID
Interface identifier for a specified interface on this object.
[out] ppObject
Type: VOID**
Pointer to a pointer to the requested Interface.
Type: HRESULT
This method supports the standard HRESULT return values, as well as the following.
For more information about other return values, see ADSI Error Codes.
A C/C++ client calls the ADsGetObject helper function to bind to an ADSI object. It is equivalent to a Visual Basic client calling the GetObject function. They both take an ADsPath as input and returns a pointer to the requested interface. By default the binding uses ADS_SECURE_AUTHENTICATION option with the security context of the calling thread. However, if the authentication fails, the secure bind is downgraded to an anonymous bind, for example, a simple bind without user credentials. To securely bind to an ADSI object, use the ADsOpenObject function instead of the ADsGetObject function.
For a code example that shows how to use ADsOpenObject, see Binding With GetObject and ADsGetObject.
It is possible to bind to an ADSI object with a user credential different from that of the currently logged-on user. To perform this operation, use the ADsOpenObject function.
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | adshlp.h |
Library | Activeds.lib |
DLL | Activeds.dll |
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!