Get 5.5 SecurityDescriptor with ADSI?
- From: "David W" <David W@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Mar 2005 17:45:05 -0800
Hi,
I've been looking at the how to enumerate the security descriptor on
Exchange 5.5 objects. I started looking at ADSI and put together some C++
code based on a few samples I found. It retrieves and prints a couple of
attributes ok, but goes into orbit when I try and query the SD.
Here's a quick snippet of the code:
LPWSTR strAttribute[] = { L"Home-MDB", L"NT-Security-Descriptor" };
hr = ADsBuildVarArrayStr((LPWSTR*)strAttribute, dwNumber, &var);
if ( hr == S_OK )
{
hr = pADs->GetInfoEx(var, 0L);
VariantClear(&var);
hr = pADs->Get(_bstr_t("Home-MDB"), &var);
if( hr != S_OK)
{
//This prints ok
wprintf(L"Get Home-MDB failed: 0x%x\n", hr);
goto Cleanup;
}
wprintf(L" Home-MDB = %S\n", V_BSTR(&var)) ;
VariantClear(&var);
}
hr = pADs->Get(_bstr_t("NT-Security-Descriptor"), &var);
if ( FAILED(hr) ) {
wprintf(L"Get NT-Security-Descriptor failed: 0x%x\n", hr);
goto Cleanup;
}
pDispSD = V_DISPATCH( &var );
hr = pDispSD->QueryInterface(IID_IADsSecurityDescriptor,(void**)&pSD);
It all works ok until I execute the last line. It then hogs 100% CPU until I
halt it. If I examine pDispSD just before the call, the structure contains
some CXX0030 errors, which makes me wonder if this is supported against 5.5
(or I've done something really dumb :-))
Is it possible to use ADSI to retrieve and enumerate the security desciptor
on 5.5? If not, what's the best method to use?
Thanks in advance,
Dave
.
- Prev by Date: Re: Serialize an object and send to message queue in vb 6
- Next by Date: How to get all receipients value
- Previous by thread: Re: Serialize an object and send to message queue in vb 6
- Next by thread: How to get all receipients value
- Index(es):
Relevant Pages
|