Hi,
i want to add an extern associated account to an mailenabled ad
object. everthing works fine (i'm working with vb.net 2008 express)
but saving produces an error.
both lines:
objExMbx.InvokeSet("msExchMasterAccountSID", RawSid)
objExMbx.InvokeSet("msExchMailboxSecurityDescripto r", objSD)
lead to an exception (in german)
Unbehandelte Ausnahme: System.Reflection.TargetInvocationException:
Ein Aufrufziel hat einen Ausnahmefehler verursacht.
---System.Runtime.InteropServices.COMException (0x80004005): Beim
Aufruf einer COM-Komponente wurde ein HRESULT E_FAIL
-Fehler zurückgegeben.
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.DirectoryServices.DirectoryEntry.InvokeSet( String
propertyName, Object[] args)
bei SetMSExternalAccount.Main.Main() in C:\Dokumente und
Einstellungen\user\Eigene Dateien\Visual Studio 200
8\Projects\SetMSExternalAccount\SetMSExternalAccou nt\Module1.vb:Zeile
300.
RawSid is "Dim RawSid as IntPtr" and the sid is converted via
ConvertStringSidToSid
Declare Auto Function ConvertStringSidToSid Lib "advapi32.dll" ( _
ByVal StringSid As String, _
ByRef Sid As IntPtr) As Long
and objSD is "Dim objSD As ActiveDs.SecurityDescriptor"
i checked the contents of the SD which is:
NT-AUTORITÄT\SELBST, 131075, 0, 2, 0, ,
NT-AUTORITÄT\SELBST, 131075, 0, 2, 0, ,
TOPTEST\user, -2147418107, 0, 0, 0, ,
and is correct. where am i wrong?
Regards, Dirk