0

in my company, we're using MS Outlook and Skype. In both applications, I can click on several user to get information about them like the first name, the last name, availability, email adress or the information of WindowsIdentification.Name (i think, this is called the Live ID).

enter image description here It looks like in the picutrue. I just erased personal information from the picture.

Is there a possibility to request this information of any user by their first and last name?

What I'm searching for is the function:

/*This function exists*/
System.Security.Principal.WindowsIdentity.GetCurrent().Name;

But I don't want to know my own LiveID but the ID from some other user. So, I need something like:

/*This function does not exists*/
string UID = System.Security.Principal.WindowsIdentity.GetByName("Max Mustermann").Name;
Console.WriteLine(UID) /*prints DomainName/UserID*/

Is something like that available in .NET?

Jan021981
  • 521
  • 3
  • 28
  • An alternative would be, to search the address book from outlook. Using google, I'm finding may ways to export the whole address book, but that is not an option for me. But automizing the search using c# would help me... – Jan021981 Aug 09 '17 at 13:37

1 Answers1

0

You can use the DirectorySeacher class to do this.

For example:

DirectorySearcher searcher1 = new DirectorySearcher(entry);
searcher1.Filter = string.Format("(&(objectCategory=person)(objectClass=user)(givenname={0})(sn={1}))", aName, aSName);

SearchResultCollection results1;
results1 = searcher1.FindAll();
Sam Makin
  • 1,526
  • 8
  • 23