Posts

PowerShell scripts to Create personal site

$site=Get-SPSite "https://mysitesp2013.x.com";
$serviceContext = Get-SPServiceContext -Site $site
$userProfileConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)
$testuser = $userProfileConfigManager.GetUserProfile("domain\user")
$testuser.PersonalSiteInstantiationState
$testuser.CreatePersonalSite()

Slow search crawling in SharePoint 2013

We have faced recently huge slowness in content sources crawling:

What we have done to resolve it:

1- first make sure that you have antivirus scanning exclusion per Microsoft recommendation.
https://support.microsoft.com/en-us/help/952167/certain-folders-may-have-to-be-excluded-from-antivirus-scanning-when-y

2- Run  EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN' as mentioned here:
https://support.microsoft.com/en-us/help/3103194/outdated-database-statistics-decrease-sharepoint-server-performance-ca



Restoring Content Databases between Farms

Have you ever faced scenario where you would like to restore content database between production/test/dev.

Here you are the steps:

1- Take SQL backup.
2- Copy backup to the other farm.
3- Attach to the SQL server.
4- from Central admin in the farm you would like to restore to go to application management then content database and select the correct web application.
5- detach the old Database and attach the copied one.

Is it ready?
Not yet as when you do that the sites will come with the path that was created in the previous farm i.e. contoso.com but in this farm you want it to be contoso-tst.com

so how you fix it?
run the following commands for each site to modify URL
$site = Get-SPSite -Identity http://consoto.com $site.Rename("https://consoto-tst.com")

The site is now ready.

OWA Office web App-Troubleshooting

You will need to check claims service is running
PowerShell to  provision:

$h = Get-SPServiceHostconfig
$h.Provision()
$services = Get-SPServiceApplication
foreach ($service in $services) { $service.provision();
write-host $service.name}


In OWA server some important commands to set verbose logs and to turn it off:


Set-OfficeWebAppsFarm -LogVerbosity "High" Restart-Service WACSM
Set-OfficeWebAppsFarm -LogVerbosity "" Restart-Service WACSM

Where to troubleshoot User Profile Sync

ForeFront Identity Manager ClientForeFront Identity Manager client is provided by Microsoft to monitor the User Profile Synchronization that takes place in the Synchronization Server. It is located at the below location as “miisclient” application :
C:\Program Files\Microsoft Office Servers\15.0\Synchronization Service\UIShell\
then open Miisclient

Adjust the Search SharePoint Performance level

-Set-SPEnterpriseSearchService -PerformanceLevel PartlyReduced
On all search app servers
-Open NodeRunner process configuration file below in Notepad C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config. Update <nodeRunnerSettings memoryLimitMegabytes=”0″ />. This is the configuration to limit NodeRunner process memory usage, replace 0 to 500 or 1000
-Restart SharePoint Search Host Controller service

Merge ULS logs

Commands to generate ULS logs during troubleshooting Set-SPLogLevel -TraceSeverity VerboseEx -Identity *Search*:* New-SPLogFile $starttime = get-date
//do the operations $enddate = get-date


Clear-SPLogLevel -Identity *Search*:*
Merge-SPLogFile -Path e:\Crawllog.log -StartTime $starttime -EndTime $enddate

Merge-SPLogFile -Path e:\zellber1.log -StartTime "04/30/2018 9:00" -EndTime "04/30/2018 18:00" Clear-SPLogLevel