16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

998 Part IX: Maintaining a Server in Windows SharePoint Services<br />

}<br />

try<br />

{<br />

//5. Retrieve the PropertyData array for GUID saved when<br />

// the user was first retrieved<br />

UserProfileWebService.PropertyData[] userData =<br />

userProfileWS.GetUserProfileByGuid(<br />

new Guid(e.Node.Tag.ToString()));<br />

//6. For every property in the profile<br />

foreach(UserProfileWebService.PropertyData userProperty<br />

in userData)<br />

{<br />

//7. Add the name <strong>and</strong> value to the listbox<br />

listBox1.Items.Add(userProperty.Name + ": "<br />

+ userProperty.Value);<br />

}<br />

}<br />

catch<br />

{<br />

//8. Message the user if the account name is not found<br />

listBox1.Items.Add("Account Name Not Found");<br />

}<br />

Type an account name into the text box in the format domain\username or<br />

just a username, <strong>and</strong> click the button. If the account is found, it will be added to the<br />

tree view of previous successful retrievals <strong>and</strong> its properties will be presented in the<br />

list box, shown in Figure 36-4.<br />

F36XR04<br />

Figure 36-4 Profile properties returned by UserProfileService Web service<br />

Clicking any previously retrieved profile in the tree view will re-retrieve that<br />

profile using the GUID stored in the tree view node’s tag property.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!