SharePoint 2016: Microsoft SharePoint Foundation Administration missing
SharePoint 2016: Microsoft SharePoint Foundation Administration missing
PS C:\Users\2016spadmin> Start-SPService -Identity “Microsoft SharePoint Foundation Administration”
Start-SPService : Cannot start or stop the service ‘Microsoft SharePoint Foundation Administration’. It is a system
service.
At line:1 char:1
+ Start-SPService -Identity “Microsoft SharePoint Foundation Administra …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-SPService], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletStartService
SharePoint 2016: Reduce the size of logging database
How to reduce the size of logging database and how to purge the old data from Logging Database
When i ran the command in my Sharepoint 2016 farm, it gave me following error:
Get-SPUsageDefinition | ForEach-Object {Set-SPUsageDefinition -Identity $_.name -DaysRetained 1}
The above command gave me below error:
Set-SPUsageDefinition : The number of days to keep usage data must be greater than the number of days to keep detailed
data.
At line:1 char:41
+ … Each-Object {Set-SPUsageDefinition -Identity $_.name -DaysRetained 1}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share…UsageDefinition:SPCmdletSetUsageDefinition) [Set-SPUsage
Definition], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletSetUsageDefinition
Tried to find if this error is reported in all search engines but unable to find any information.
I did stumble upon this good link which talks about change in how settings are changed in SharePoint 2016.
So i modified my command and ran following:
Get-SPUsageDefinition | ForEach-Object {Set-SPUsageDefinition -Identity $_.name -DaysRetained 1 -DaysToKeepUsageFiles 0}
That’s it!
The command ran successfully and i validated the changes.
I then ran following command to start by timer jobs:
Get-SPTimerJob | Where-Object { $_.title -like “*usage data*” } | Start-SPTimerJob
How to find site collection creation date
Please run below script in SharePoint 2013 Management Shell
$w = Get-SPWeb https://this_is_Site_Collection_url
$w.Created
HOW TO RETRIEVE ALL APPS INSTALLED ON A SHAREPOINT 2013 WEB APPLICATION THROUGH POWERSHELL
For my reference:
Add-PsSnapin Microsoft.SharePoint.PowerShell $webApp = Get-SPWebApplication "http://sp2013" foreach($site in $webApp.Sites) { Write-Host $web.Url -BackgroundColor DarkGreen foreach($web in $site.AllWebs) { $appInstance = Get-SPAppInstance -Web $web.Url | select Title,Appwebfullurl,Id if($appInstance -ne $null) { $appInfo = $appInstance.Title + " - " + $appInstance.Appwebfullurl Write-Host $appInfo } } }
SP2013: Find All search crawl Property
Requirement:
How to find all search crawl property in a TEXT or EXCEL file for a specific site collection using PowerShell
Resolution:
1st Phase:
Find the GUID for site collection by running below script from Windows PowerShell ISE on any of the sharepoint servers in farm.
Add-PSSnapin “Microsoft.SharePoint.PowerShell”
$site = Get-SPSite https://sharepoint.contoso.com/sites/SP2013
$siteguid = $site.id
echo $siteguid
2nd Phase
Once you got the GUID for site collection from phase 1, run below script
Add-PSSnapin “Microsoft.SharePoint.PowerShell”
$searchapp = Get-SPEnterpriseSearchServiceApplication
Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -SiteCollection <Site_GUID> -limit All >C:\Temp\crawlproperty.csv