Optimizing a search index #983
Synthetic post for stress testing. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.
Section
More body text. a search index is the subject. Tags: sql, next.
powershell
Param( [Parameter(Mandatory = $True)] [String] $SharepointURL, [Parameter(Mandatory = $True)] [String] $tenantID)$scope = 'User.Read.All'Connect-MgGraph -TenantId $tenantId -Scopes $scopeConnect-SPOService -Url $SharepointURL;$list = @() #list of UPN to pass to the SP command$Totalusers = 0 #total user provisioned.#Get licensed users$users = Get-MgUser -Filter 'assignedLicenses/$count ne 0' -ConsistencyLevel eventual -CountVariable licensedUserCount -All -Select UserPrincipalNameforeach ($u in $users) { $Totalusers++ Write-Host "$Totalusers/$($users.Count)" $list += $u.userprincipalname if ($list.Count -eq 199) { #We reached the limit Write-Host "Batch limit reached, requesting provision for the current batch" Request-SPOPersonalSite -UserEmails $list -NoWait Start-Sleep -Milliseconds 655 $list = @() }}if ($list.Count -gt 0) { Request-SPOPersonalSite -UserEmails $list -NoWait}Disconnect-SPOServiceDisconnect-MgGraphWrite-Host "Completed OneDrive Provisioning for $Totalusers users"
My Blog