qnd:sharepoint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
qnd:sharepoint [2021/06/23 20:23] – created mguptonqnd:sharepoint [2022/11/04 13:34] (current) mgupton
Line 1: Line 1:
-====== SharePoint ======+====== Sharepoint ======
   * [[https://docs.microsoft.com/en-us/sharepoint/]]   * [[https://docs.microsoft.com/en-us/sharepoint/]]
 +
 +
 +====== Sharepoint Migration Tool/SPMT Report Packer ======
 +  * #powershell
 +  * Report folder: ''%appdata%\Microsoft\MigrationTool\<domain-name>''
 +
 +This is a quick-n-dirty script to collect all the reports from SPMT and package it up as a ZIP archive. The script is designed to be ran in the root of the SPMT report folder, ''%appdata%\Microsoft\MigrationTool\<domain-name>''.
 +<code powershell>
 +$jobs = @{}
 +
 +ls | foreach {
 +
 +    $rpt = "$_\Report"
 +    $summary = import-csv "$rpt\SummaryReport.csv"
 +    $id = split-path -leaf $_
 +
 +    $summary | foreach {
 +        $lastrun = $_.{Start time}
 +        $lastrun = [datetime]::parseexact($lastrun, 'M/d/yyyy h:m:s tt', $null)
 +        $sitename = split-path -leaf $_.Source
 +
 +        $job = [PSCustomObject]@{
 +            id = $id
 +            sitename = $sitename
 +            src = $_.Source
 +            rpt = $rpt
 +            lastrun = $lastrun
 +        }
 +
 +        if ($jobs.Keys -notcontains $job.src) {
 +            $jobs[$job.src] = $job
 +
 +        }
 +        else {
 +            if ($job.lastrun -gt $jobs[$job.src].lastrun) {
 +                $jobs[$job.src] = $job
 +            }
 +        }
 +    }
 +
 +}
 +
 +
 + foreach ($job in $jobs.GetEnumerator()) {
 +    $job = $job | select -ExpandProperty value
 +    write-host "$env:TEMP\$($job.sitename)_$($job.id)"
 +    Compress-Archive -Path $job.rpt -DestinationPath "$env:TEMP\$($job.sitename)_$($job.id)"
 +}
 +</code>
 +
 +====== Sharepoint Online ======
 +===== Assorted Things =====
 +  * One way to prevent a redirect (on pages that auto-redirect) if you need to get to the page is to add the stay=true URL parameter to the end of the site URL.
 +
 +===== Deleting Redirect URL =====
 +When a site is renamed the redirect URL needs to be deleted if you want to create a new site with the name previously used by the renamed site.
 +<code powershell>
 +# List all redirect URLs
 +Get-SPOSite -Template REDIRECTSITE#0
 +
 +# Delete a redirect URL
 +Remove-SPOSite -Identity <redirect URL>
 +</code>
 +
 +
 +  * [[https://learn.microsoft.com/en-us/answers/questions/727371/how-to-change-a-team-site-into-a-communication-sit.html]]
 +
 +===== Some Handy Management Commands =====
 +  * [[https://www.enjoysharepoint.com/powershell-sharepoint-commands/]]
 +
  
  • qnd/sharepoint.1624479789.txt.gz
  • Last modified: 2021/06/23 20:23
  • by mgupton