Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

SharePoint Administration

Delete ALL One-Time SPTimerJobs

One time SharePoint timer jobs can often get “stuck” and fail to execute.   Clearing them all out manually in Central Admin is tedious.  PowerShell below will remove all “One-time” jobs with a one liner. Cheers.  

shades_smile

PowerShell Code

Get-SPTimerJob |? {$_.Schedule.GetType().ToString() -eq "Microsoft.SharePoint.SPOneTimeSchedule"} | % {$_.Delete()}

Screenshot

image

References

Daily Front End Backup

The below PowerShell can be run once per day via Task Scheduler on just one machine in a SharePoint farm to backup front end configuration.   Yes, SQL backups are wonderful and a must have for user data protection.   However, front end backups are handy for restore scenarios like:

 

  • IIS configuration
  • IIS home folder
  • WPS farm solutions
  • 14/15 hive manual changes  (yeah yeah … not best practice, but you have them too)

 

These front end artifacts might not be in a SQL full BAK.   Also, having troubleshooting options on the front end helps SharePoint admins respond quickly to a recovery without having to wait for DBAs to first restore a database.    Hope that helps.  

Smile

 

Start-Transcript

Write-Host "Starting..."
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$dest = "d:\backuptest"
$day = Get-Date -Format "yyyy-MM-dd"
("iisconfig","inetpub","farmsol","hive","ipfs") |% {New-Item "$dest\$_-$day" -ItemType Directory -ErrorAction SilentlyContinue} | Out-Null

Write-Host " - IIS config"
Copy-Item "C:\windows\system32\inetsrv\config" "$dest\iisconfig-$day" -Recurse

Write-Host " - IIS home folder"
Copy-Item "C:\inetpub" "$dest\inetpub-$day" -Recurse

Write-Host " - SharePoint farm solutions"
Get-SPSolution |% {$s=$_.SolutionFile;$n=$s.Name;$s.SaveAs("$dest\farmsol-$day\$n")}

Write-Host " - SharePoint hive folder"
$major = (Get-SPFarm).BuildVersion.Major
Copy-Item "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\$major" "$dest\hive-$day"  -Recurse

Write-Host " - InfoPath Forms Services"
Backup-SPFarm -Directory "$dest\ipfs-$day" -BackupMethod Full -Item "InfoPath Forms Services"

Write-Host " - Remove old folders"
$threshold = (Get-Date).AddDays(-2)
$files = Get-ChildItem $dest | Sort-Object LastWriteTime -Descending
$files | ?{ $_.LastWriteTime -lt $threshold } | Remove-Item -Force -Recurse

Write-Host "Operation completed successfully"

Stop-Transcript

MSODAL – Microsoft Online Services Diagnostics and Logging

With more people using Office365 every day, it can be helpful to have a few troubleshooting tools nearby.   I had issues sending files over Lync IM and found this helpful download during my research.   It verifies the local PC client configuration and is able to apply minor repairs for common configuration issues.   Something to keep nearby as we all support more Office365 users.

 

http://support.microsoft.com/kb/2386684

  • Desktop or Application sharing can’t connect in a Lync Online conference

https://technet.microsoft.com/en-us/library/hh852475.aspx

  • Download MOSDAL (Microsoft Online Services Diagnostics and Logging) Support Toolkit

 

4
5
11-11-2013 4-48-16 PM
2
3

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲