title: How to Get list of departments in user profile from SharePoint?
body: <p>How to get list of departments in user profiles from SharePoint? </p>
  
  <p>I have got a list of departments of user profile by getting into each profile in SharePoint and archiving the department property value of each. But it becomes slow when number of user profiles increase because of getting into each profile for department by using for each loop.</p>
  
  <p>So what I would like to know, is there any way to get this list of departments from user profile. I am using C#.</p>