none
How to get UserIDs and Profile Pictures of meeting attendees RRS feed

  • Question

  • Right now i am using user account xyz@exchange.com and gave all permisions to impersonate a Room(Resource) calendar.

    By doing this i am able get  the fallowing information like : meetings times,Duration, Attendees email address,organizer ID.

    There are few other things which i want to retrive like Attendees profile pictures and UserId's. What can be done in order to obtain this information.





    • Edited by Rahul_varma Thursday, June 9, 2016 12:56 PM
    Wednesday, June 1, 2016 8:53 AM

All replies

  • Hey Glen,

    can you help me out with this problem.

    Wednesday, June 1, 2016 12:34 PM
  • I would probably suggest you get the SMTPAddress of the Attendee and then use the Get User Photo operation https://msdn.microsoft.com/en-us/library/office/jj190905(v=exchg.150).aspx

    Cheers
    Glen

    Thursday, June 2, 2016 2:45 AM
  • Hey Glen,

    Please Can you show me how can i get smtp address of an attendee.

    Thursday, June 2, 2016 9:26 AM
  • Hey Glen,

    I tried the fallowing code to get ItemID but nothing is returns, I think its beacuse i haven't created any contacts in exchange. anyway thats not what i am tring to achieve. i want itemsID's of existing email user. How can get that ?

      private static void FindEmail(string name)
            {
                NameResolutionCollection resolvedNames = service.ResolveName(name);
               
                // Outputs the list of candidates.
    
                foreach (NameResolution nameRes in resolvedNames)
                {
                    Console.WriteLine("e-mail address: " + nameRes.Mailbox.Address);
                   
                
                    string Fullname = nameRes.Mailbox.Name;
                    string email = nameRes.Mailbox.Address;
                    SplitName(Fullname);
                    Imper(service,email,Fullname);
                    
    
                }
            }
            private static void Imper(ExchangeService service,string email, string fullname)
            {
                ImpersonatedUserId impersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, email);
                service.ImpersonatedUserId = impersonatedUserId;
                ItemView view1 = new ItemView(10);
                SearchFilter sf = new SearchFilter.IsEqualTo(ContactSchema.DisplayName, fullname);
                FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Contacts, view1);
                foreach (Item itemids in findResults)
                {
                    string id = itemids.Id.UniqueId;
                    Console.WriteLine("UniqueID of the contact: "+ id);
                  
                    //GetContactPhoto(service, id);
                }
    
                    
            }

    Please check the code and give some suggestions on it.

    Thanking You.

    Thursday, June 2, 2016 1:12 PM
  • If you use the latest EWS Managed API from git hub https://github.com/OfficeDev/ews-managed-api you just need a couple of lines to use it

                GetUserPhotoResults GetUserPhoto = service.GetUserPhoto("user@doman.com", "HR240x240", "Blah");
                if (GetUserPhoto.Status == GetUserPhotoStatus.PhotoReturned) 
                {
                
                }

    GetUserPhoto take the SMTP Address of the user you want the GAL photo from.

    Cheers
    Glen

    Friday, June 3, 2016 2:43 AM