In Visual Studio, create a console application.
Create a web reference using the following inputs:
URL: https://yourSite.url/_vti_bin/userprofileservice.asmx?WSDL
Name: UPS1
In the program.cs class, replace the Main method with the following:
1 2 3 4 5 6 7 8 9 | static void Main(string[] args) { UPS1.UserProfileService ups1 = new UPS1.UserProfileService(); ups1.UseDefaultCredentials = true; UPS1.PropertyData[] info = ups1.GetUserProfileByName(@ "domain\username" ); for (int i = 0; i < info.Length; i++) { Console.WriteLine(info [i] .Name); for (int j = 0; j < info [i] .Values.Length; j++) { Console.WriteLine(info [i].Values[j] .Value); } } Console.ReadLine(); } |
Run the app.