Skip to content

Commit 629c0a4

Browse files
committed
Fixed code sample now that API is available
1 parent 26a4fb9 commit 629c0a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/solution-guidance/multigeo-userprofileexperience.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ GET https://contoso.sharepoint.com/_api/SP.UserProfiles.PeopleManager/GetPropert
4040
If you're using C#, CSOM, as shown in the following example, is easier to use.
4141

4242
```C#
43-
public string GetUserPersonalSiteHostUrlCSOM(ClientContext ctx, string userPrincipalName)
43+
public string GetUserPersonalSiteHostUrlCSOM(string userPrincipalName)
4444
{
4545
string result = null;
4646

47-
PeopleManager peopleManager = new PeopleManager(ctx);
48-
var userProperties = peopleManager.GetPropertiesFor(userPrincipalName);
47+
PeopleManager peopleManager = new PeopleManager(this.clientContext);
48+
var userProperties = peopleManager.GetPropertiesFor($"i:0#.f|membership|{userPrincipalName}");
49+
this.clientContext.Load(userProperties);
4950
this.clientContext.ExecuteQuery();
5051
result = userProperties.PersonalSiteHostUrl;
5152

0 commit comments

Comments
 (0)