get Exchange 5.5 Assoc-NT-Account

  • Thread starter Thread starter steletroll
  • Start date Start date
S

steletroll

Hi,

i'm getting crazy...

I try to translate my vbscripts to C# but i can't retrieve some
attributes of an Exchange 5.5 mailbox (particularly Assoc-NT-Account).

So, if someone had a piece of code that retrieve the primary windows
account of an exchange mailbox (even the SID form...), i will be the
happiest guy.

Thanks,

Sté
 
Show us what you have, and what's not working, maybe we can help you find
the problem.

Willy.
 
Hi,

first thanks for your answer.

If i use the following code :

DirectoryEntry entry = new DirectoryEntry(
"LDAP://server/objectldappath",
"dc=domain,cn=user,cn=admin",
"*******",
AuthenticationTypes.ServerBind);

foreach (string prop in entry.Properties.PropertyNames)
{
Console.WriteLine(prop);
}

i get the following output :

objectClass
rdn
cn
distinguishedName
Hide-From-Address-Book
rfc822Mailbox
mail
textEncodedORaddress
otherMailbox
conferenceInformation
mailPreferenceOption
givenName
Home-MTA
uid
MAPI-Recipient
sn
Alt-Recipient
memberOf

nothing about the Assoc-nt-Account, nt-security-descriptor...
So my question was how i can get those values.

Thanks for your help
 
Ok, this proves only that the Assoc-nt-Account (a binary SID )is not
assigned to the mailbox you are binding with.
I suggest you try using adsiedit and look what this one returns when binding
to exactly the same object.

Willy.
 
I am sure that the attribute is not empty. I can see the value the
exchange administrator in raw mode.

In vbscript, i use opendsobject to bind to the object and i can
retrieve the SID, but i can't with DirectoryService...

I have no idea...

Ste
 
I did not say the attribute was empty, I said it wasn't assigned to. If you
enumerate all the properties, Assoc-nt-Account did not show up, that means
it's not in the properties collection.
Do you run the script with the same user credentials aand authentication
type as you are binding to using DirectoryEntry?
Is it possible that the property is protected by an ACL?
These are all questions you can answer yourself using Adsiedit.msc.

Willy.
 
Back
Top