- Click on Start -> Run and type regedit.
- Locate the key 3. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
- Right click on this key and choose New > DWord Value
- Name this one "DisableLoopbackCheck"
- Double-click then on it and type the value “1”
- Reboot your server. (Mostly not required)
Getting all user profiles within SharePoint tenant using SharePoint Online CSOM API
- retrieve all the users in tenant (Get-MsolUser cmdlet)
- iterate users and utilize SharePoint User Profiles CSOM API to retrieve user profile
function Get-SPOContext([string]$Url,[string]$UserName,[string]$Password){$context = New-Object Microsoft.SharePoint.Client.ClientContext($Url)$context.Credentials = Get-SPOCredentials -UserName $UserName -Password $Passwordreturn $context}function Get-SPOCredentials([string]$UserName,[string]$Password){$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Forcereturn New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword)}function Print-UserProfileInfo([Microsoft.SharePoint.Client.UserProfiles.PeopleManager]$PeopleManager,[string]$AccountName){$ctx = $PeopleManager.Context$accountName = "i:0#.f|membership|" + $AccountName #claim format$userProfile = $PeopleManager.GetPropertiesFor($AccountName)$ctx.Load($userProfile)$ctx.ExecuteQuery()Write-Host $userProfile.PersonalUrl}