learn.microsoft.com Open in urlscan Pro
23.52.162.50  Public Scan

Submitted URL: http://microsoft.com/webservices/SharePointPortalServer/UserProfileSe=
Effective URL: https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ms518393(v=office.14)
Submission: On August 16 via api from CA — Scanned from CA

Form analysis 3 forms found in the DOM

Name: nav-bar-search-formGET /en-us/search/

<form class="nav-bar-search-form" method="GET" name="nav-bar-search-form" role="search" id="nav-bar-search-form" aria-label="Search" action="/en-us/search/">
  <div class="autocomplete" data-bi-name="autocomplete"><!---->
    <div class="field-body control ">
      <input role="combobox" maxlength="100" aria-autocomplete="list" autocapitalize="off" autocomplete="off" autocorrect="off" spellcheck="false" id="site-search-input" data-test-id="site-search-input" class="autocomplete-input input input-sm
						
						" type="search" name="terms" aria-expanded="false" aria-owns="ax-42-listbox" aria-controls="ax-42-listbox" aria-activedescendant="" aria-label="Search" aria-describedby="ms--site-search-input-description" placeholder="Search previous versions"
        pattern=".*">
      <span aria-hidden="true" class="icon is-small is-left" hidden="">
        <span class="has-text-primary docon docon-undefined"></span>
      </span>
      <span aria-hidden="true" class="autocomplete-loader loader has-text-primary " hidden=""></span>
      <span hidden="" id="ms--site-search-input-description"> Suggestions will filter as you type </span>
    </div>
    <ul role="listbox" id="ax-42-listbox" data-test-id="site-search-input-listbox" class="autocomplete-suggestions is-vertically-scrollable padding-xxs " aria-label="Suggestions" hidden="">
    </ul>
    <!---->
  </div>
  <!-- mobile safari will not dispatch submit event unless there's a submit button that is not display:none -->
  <button type="submit" class="visually-hidden" tabindex="-1" aria-hidden="true"></button>
  <input name="category" hidden="" value="">
  <input name="dataSource" hidden="" value="previousVersions">
</form>

Name: nav-bar-search-formGET /en-us/search/

<form class="nav-bar-search-form" method="GET" name="nav-bar-search-form" role="search" id="nav-bar-search-form-desktop" aria-label="Search" action="/en-us/search/">
  <div class="autocomplete" data-bi-name="autocomplete"><!---->
    <div class="field-body control has-icons-left">
      <input role="combobox" maxlength="100" aria-autocomplete="list" autocapitalize="off" autocomplete="off" autocorrect="off" spellcheck="false" id="site-search-input-desktop" data-test-id="site-search-input-desktop" class="autocomplete-input input input-sm
						control has-icons-left
						" type="search" name="terms" aria-expanded="false" aria-owns="ax-43-listbox" aria-controls="ax-43-listbox" aria-activedescendant="" aria-label="Search" aria-describedby="ms--site-search-input-desktop-description"
        placeholder="Search previous versions" pattern=".*">
      <span aria-hidden="true" class="icon is-small is-left">
        <span class="has-text-primary docon docon-search"></span>
      </span>
      <span aria-hidden="true" class="autocomplete-loader loader has-text-primary " hidden=""></span>
      <span hidden="" id="ms--site-search-input-desktop-description"> Suggestions will filter as you type </span>
    </div>
    <ul role="listbox" id="ax-43-listbox" data-test-id="site-search-input-desktop-listbox" class="autocomplete-suggestions is-vertically-scrollable padding-xxs " aria-label="Suggestions" hidden="">
    </ul>
    <!---->
  </div>
  <!-- mobile safari will not dispatch submit event unless there's a submit button that is not display:none -->
  <button type="submit" class="visually-hidden" tabindex="-1" aria-hidden="true"></button>
  <input name="category" hidden="" value="">
  <input name="dataSource" hidden="" value="previousVersions">
</form>

javascript:

<form action="javascript:" role="search" aria-label="Search" class="margin-bottom-xxs"><label class="visually-hidden" for="ax-44">Search</label>
  <div class="autocomplete display-block" data-bi-name="autocomplete"><!---->
    <div class="field-body control has-icons-left">
      <input role="combobox" maxlength="100" aria-autocomplete="list" autocapitalize="off" autocomplete="off" autocorrect="off" spellcheck="false" id="ax-44" data-test-id="ax-44" class="autocomplete-input input input-sm
						control has-icons-left
						width-full" type="text" aria-expanded="false" aria-owns="ax-45-listbox" aria-controls="ax-45-listbox" aria-activedescendant="" aria-describedby="ms--ax-44-description" placeholder="Filter by title" pattern=".*">
      <span aria-hidden="true" class="icon is-small is-left">
        <span class="has-text-primary docon docon-filter-settings"></span>
      </span>
      <span aria-hidden="true" class="autocomplete-loader loader has-text-primary " hidden=""></span>
      <span hidden="" id="ms--ax-44-description"> Suggestions will filter as you type </span>
    </div>
    <ul role="listbox" id="ax-45-listbox" data-test-id="ax-44-listbox" class="autocomplete-suggestions is-vertically-scrollable padding-xxs " aria-label="Suggestions" hidden="">
    </ul>
    <!---->
  </div>
</form>

Text Content

Skip to main content


This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security
updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
Documentation
Global navigation
 * Learn
   
 * Documentation
   
 * Training
   
 * Certifications
   
 * Q&A
   
 * Code Samples
   
 * Assessments
   
 * Shows
   
 * Events
   
 * More
     
   * Documentation
     
   * Training
     
   * Certifications
     
   * Q&A
     
   * Code Samples
     
   * Assessments
     
   * Shows
     
   * Events
     
   

Suggestions will filter as you type
Suggestions will filter as you type
Search
Sign in

 * Profile
 * Settings

Sign out
Table of contents Exit focus mode
Dismiss alert

We're no longer updating this content regularly. Check the Microsoft Product
Lifecycle for information about how this product, service, technology, or API is
supported.

Return to main site
Search
Suggestions will filter as you type
 * SharePoint 2010
 * SDK Documentation
   * SDK Documentation
   * New Developer Content for SharePoint Foundation 2010
   * New Developer Content for SharePoint Server 2010
   * New APIs in SharePoint 2010 Service Pack 1 (SP1)
   * Installing and Using the SharePoint 2010 SDK Download
   * SharePoint Foundation 2010 General Reference
   * SharePoint Server 2010 General Reference
   * SharePoint Online General Reference
   * SharePoint 2010 Class Libraries and Web Service References
     * SharePoint 2010 Class Libraries and Web Service References
     * SharePoint Foundation 2010 Class Libraries
     * SharePoint Server 2010 Class Libraries and Web Service References
     * SharePoint 2010 Web Services
       * SharePoint 2010 Web Services
       * SharePoint Foundation 2010 Web Services
       * SharePoint Server 2010 Web Services
         * SharePoint Server 2010 Web Services
         * Search Web Service
         * PublishedLinksService Web Service
         * SocialDataService Web Service
         * UserProfileChangeService Web Service
         * UserProfileService Web Service
           * UserProfileService Web Service
           * ChoiceTypes Enumeration
           * ContactData Class
           * GetUserProfileByIndexResult Class
           * InCommonData Class
           * MemberGroupData Class
           * MembershipData Class
           * MembershipSource Enumeration
           * OrganizationProfileData Class
           * PinnedLinkData Class
           * Privacy Enumeration
           * PropertyData Class
           * PropertyInfo Class
           * QuickLinkData Class
           * SPTimeZone Class
           * SuggestionType Enumeration
           * UserProfileService Class
             * UserProfileService Class
             * UserProfileService Members
             * UserProfileService Constructor
             * UserProfileService Methods
             * UserProfileService Properties
             * UserProfileService Events
           * ValueData Class
   * Glossary for SharePoint 2010
 * Developer References
 * Technical Articles
 * Book Excerpts
 * Visual How Tos
 * Quick Notes
 * SharePoint Workspace 2010

    
 1. Learn
    
    
 2. Previous Versions
    
    
 3. Office
    
    
 4. SharePoint 2010
    
    
 5. SDK Documentation
    
    
 6. SharePoint 2010 Class Libraries and Web Service References
    
    
 7. SharePoint 2010 Web Services
    
    
 8. SharePoint Server 2010 Web Services
    
    
 9. UserProfileService Web Service
    
    
    

    
 1. Learn
    
    
 2. Previous Versions
    
    
 3. Office
    
    
 4. SharePoint 2010
    
    
 5. SDK Documentation
    
    
 6. SharePoint 2010 Class Libraries and Web Service References
    
    
 7. SharePoint 2010 Web Services
    
    
 8. SharePoint Server 2010 Web Services
    
    
 9. UserProfileService Web Service
    
    
    

C#
 * C#
 * 
 * VB
 * 

Read in English Add
Table of contents Read in English Add Print

Twitter LinkedIn Facebook Email
Table of contents


USERPROFILESERVICE CLASS

 * Article
 * 01/20/2015




IN THIS ARTICLE

    
 1. Inheritance Hierarchy
    
 2. Syntax
    
 3. Examples
    
 4. Thread Safety
    
 5. See Also
    

Provides a Web service to manage user profiles.


INHERITANCE HIERARCHY

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Web.Services.Protocols.WebClientProtocol
        System.Web.Services.Protocols.HttpWebClientProtocol
          System.Web.Services.Protocols.SoapHttpClientProtocol
            [UserProfileService Web service].UserProfileService

Namespace:  [UserProfileService Web service]
Web service reference: http://Site/_vti_bin/UserProfileService.asmx


SYNTAX

'Declaration
<WebServiceBindingAttribute(Name := "UserProfileServiceSoap", Namespace := "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService")> _
Public Class UserProfileService _
    Inherits SoapHttpClientProtocol
'Usage
Dim instance As UserProfileService


C# Copy


[WebServiceBindingAttribute(Name = "UserProfileServiceSoap", Namespace = "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService")]
public class UserProfileService : SoapHttpClientProtocol



EXAMPLES

The following example shows how to get information about the membership of a
user, colleagues of a user, links, and user profile property data. Make sure you
add a Web reference to a UserProfileService Web service site to which you have
access. Change the using GetProfileDataSample.MyServer002; directive to point to
the Web service site you are referencing. In addition, replace
"domain\\username" with valid values.

C# Copy


using System;
using System.Collections.Generic;
using System.Text;

// TODO 
// Change the using GetProfileDataSample.MyServer002 directive
// to point to the Web service you are referencing.
using GetProfileDataSample.MyServer002;

namespace GetProfileDataSample
{
    class Program
    { 
        //Instantiate the Web service. 
        public static UserProfileService userProfileService = new UserProfileService();

        static void Main(string[] args)
        {
            //Set credentials for requests.
            //Use the current user log-on credentials.
            userProfileService.Credentials =
                System.Net.CredentialCache.DefaultCredentials;

            GetUserProfilePropertyData();
            GetUserMemberships();
            GetUserColleagues();
            GetUserLinks();
        }

            static void GetUserProfilePropertyData()
        {
            // TODO 
            // Replace "domain\\username" with valid values.
            PropertyData[] properties = 
                userProfileService.GetUserProfileByName("domain\\username");
            for (int i = 0; i < properties.Length; i++)
            {
                Console.WriteLine(properties[i].Name);
                Console.WriteLine(properties[i].Values);
            }

            Console.Read();
        }
         static void GetUserMemberships()

        {
            // TODO 
            // Replace "domain\\username" with valid values.
            MembershipData[] memberships = 
                userProfileService.GetUserMemberships("domain\\username");
            for (int i = 0; i < memberships.Length; i++)
            {
                Console.WriteLine(memberships[i].DisplayName);
            }

            Console.Read();
        }

        static void GetUserColleagues()
        {
            // TODO 
            // Replace "domain\\username" with valid values.
            ContactData[] contacts = 
                userProfileService.GetUserColleagues("domain\\username");
            for (int i = 0; i < contacts.Length; i++)
            {
                Console.WriteLine(contacts[i].Name);
            }
            Console.Read();
        }

        static void GetUserLinks()
        {
            // TODO 
            // Replace "domain\\username" with valid values.
            QuickLinkData[] links = 
                userProfileService.GetUserLinks("domain\\username ");
            for (int i = 0; i < links.Length; i++)
            {
                Console.WriteLine(links[i].Url);
            }

            Console.Read();
        }
        }
    }



THREAD SAFETY

Any public static (Shared in Visual Basic) members of this type are thread safe.
Any instance members are not guaranteed to be thread safe.


SEE ALSO

REFERENCE

UserProfileService Members

UserProfileService Web Service




--------------------------------------------------------------------------------


ADDITIONAL RESOURCES





English (United States)
Theme
 * Light
 * Dark
 * High contrast

 * 
 * Previous Versions
 * Blog
 * Contribute
 * Privacy
 * Terms of Use
 * Trademarks
 * © Microsoft 2023


ADDITIONAL RESOURCES






IN THIS ARTICLE



English (United States)
Theme
 * Light
 * Dark
 * High contrast

 * 
 * Previous Versions
 * Blog
 * Contribute
 * Privacy
 * Terms of Use
 * Trademarks
 * © Microsoft 2023