Monday, February 25, 2019

SharePoint Online Tuning Web Page

SharePoint Online Tune Web Page

Per:

https://sharepointinterface.com/2017/07/07/the-five-minute-page-performance-troubleshooting-guide-for-sharepoint-online/


Network Trace:


  • SPIisLatency. This is a measure of the amount of time (in milliseconds) that the request spent queued and waiting to be processed by IIS (Internet Information Services – the web server). Ideally, it should be zero or very close to zero. In my example, the SPIisLatency is 3ms.
  • SPRequestDuration. This is the amount of time (again, in milliseconds) that it took to process the request on the server. Basically, this is the end-to-end processing time for the page. Healthy pages range from a couple hundred milliseconds to around a second depending on the content of the page. In my example, the SPRequestDuration is 249ms.
  • X-SharePointHealthScore. This is the value, from zero to ten, that indicates how heavily loaded the SharePoint Server is at the time when the page was served. A score of zero means the server is not under load, while a score of ten means the server is overloaded. As the X-SharePointHealthScore goes up, the server begins to selectively suspend work designated as “low priority,” like some Timer Service jobs, Search requests, and various other low-priority tasks. ideally, this value should be zero – or close to it. In my example, the value is zero. For example see here

Saturday, February 2, 2019

SharePoint Online: Using PnP to Manage Recycle Bin

#Get-Module SharePointPnPPowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending
# Connect-PnPOnline –Url https://mysite-admin.sharepoint.com –UseWebLogin
# Get-PnPTenant

Connect-PnPOnline -Url https://mysite.sharepoint.com/engineering –UseWebLogin

$now = (Get-Date)

Write-Host "ManageRecycleBin.Restore() : START at: " (Get-Date)


$currentSubwebs = Get-PnPSubwebs

Write-Host "Web Count: " $currentSubwebs.Count

#set the restore date to yesterday
$today = (Get-Date)
$restoreDate = $today.date.AddDays(-18)

#Write-Host "RecycleBin.Count: " (Get-PnPRecycleBinItem).count
Write-Host "restoreDate: " $restoreDate

#(Get-PnPRecycleBinItem).count

 
#get all items that are deleted yesterday or today, select the last 10 items and display a list with all properties
  # Get-PnPRecycleBinItem | ? DeletedDate -gt $restoreDate | select -last 10 | fl *


#Filter by Date
#$today = (Get-Date)
# $date1 = $today.date.addDays(-4)
#$date2 = $today.date.addDays(-6)
# DOES NOT WORK : DeletedDate : The term 'DeletedDate' is not recognized as the name of a cmdlet, function, script file, or operable program
#Get-PnPRecycleBinItem | Where-Object { DeletedDate -gt $date2 -and DeletedDate -lt $date1}  | select -last 10 | fl *


#Filter on user
#$Get-PnPRecycleBinItem -FirstStage | ? DeletedByEmail -eq 'john@contoso.com'

#Filter on file type
# Get-PnPRecycleBinItem -FirstStage | ? LeafName -like '*.docx'

#Export results to CSV
# Get-PnPRecycleBinItem | ? {$_.DeletedDate -gt $restoreDate -and $_.DeletedByEmail -eq 'john@contoso.com'} | Export-Csv c:\temp\restore.csv

#Restoring the files
# Get-PnPRecycleBinItem -firststage | ? {$_.DeletedDate -gt $restoreDate -and $_.DeletedByEmail -eq 'john@contoso.com'} | Restore-PnpRecycleBinItem -Force


#Filter on file type
#Get-PnPRecycleBinItem | ? DirName -like '*engineering/*'  | select -last 10 | fl *

Write-Host "Get-PnPRecycleBinItem:START... " (Get-Date)
#Get-PnPRecycleBinItem | ? {$_.DeletedDate -gt $restoreDate -and $_.DirName -like '*engineering/Active Projects/*'} | select -last 10 | fl *
Get-PnPRecycleBinItem | ? {$_.DeletedDate -gt $restoreDate -and $_.DirName -like '*engineering/Active Projects/*'} | Export-Csv C:\temp\20190202.00.csv

#Get-PnPRecycleBinItem | ? {$_.DeletedDate -gt $restoreDate -and $_.DeletedByEmail -eq 'john@contoso.com'} | select -last 10 | fl *

# ERROR below,
#Get-PnPRecycleBinItem | ? DeletedDate -gt $restoreDate -and DirName -like '*engineering/*' | select -last 10 | fl *
#Get-PnPRecycleBinItem | Where-Object { DeletedDate -gt $restoreDate -and DirName -like '*engineering/*'}  | select -last 10 | fl *
Write-Host "Get-PnPRecycleBinItem:START... " (Get-Date)


Write-Host "ManageRecycleBin.Restore() : DONE at: " (Get-Date)