Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

Friday, April 24, 2015

SharePoint 2010/2013: Trim audit Logs with Powershell

In case that your storage or MSSQL filegroup is full, because  you didn't implement a proper housekeeping of your Audit logs, you can use this PowerShell command to delete them fast:


$site = Get-SPSite https://yoursite.yourdomain.com
$date = Get-Date "20/04/2015"
$site.Audit.DeleteEntries($date)

As the deletion in SQL Server LL happen on a Transaction base it might take a while. Moke sure you have enough free space on your log drive, as the log LL grow and please don't truncate table or apply any operations directly in SQL Server - SharePoint LL not be your friend anymore after such operations! ;-)




Thursday, April 23, 2015

SharePoint 2013: Configure Search Topology with Powershell

The best and the only tool to configure a SharePoint 2013 Search Topology is PowerShell. in my case i had to reconfigure a midsize Server farm with one wfe and an one application Server based classical farm architecture. The script below can also be used to configure a streamlined farm architecture.

 #Define topology variables and assign servernames:

$SPApplication1 = Get-SPEnterpriseSearchServiceInstance -Identity "SEARCHSERVER/APPLICATION"
$SPWFE1 = Get-SPEnterpriseSearchServiceInstance -Identity "WFE"

#Start Search Service Instances on both servers

Start-SPEnterpriseSearchServiceInstance -Identity $SPApplication1
Start-SPEnterpriseSearchServiceInstance -Identity $SPWFE1

#Get services Status / Make sure thate Service is in started state, otherwise don't proceed with configuration and fix issue first.

#Get Search Service Instance status (started or stopped) after running the above commands
Get-SPEnterpriseSearchServiceInstance -Identity $SPApplication1
Get-SPEnterpriseSearchServiceInstance -Identity $hostWF1
#Setting up the topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa

#SEARCHSERVER
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1
New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1 -IndexPartition 0

#WFE
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostWF1
#Activate the Topology
Set-SPEnterpriseSearchTopology -Identity $newTopology
# Verify the Topology
Get-SPEnterpriseSearchTopology -SearchApplication $ssa

Thursday, August 8, 2013

SharePoint 2013: Standalone installation with local accounts

If u try to install SharePoint without a Domain, u might face the Problem, that SharePoint Products and Configuration Wizard stops with the following error after passing database Access account:

"The specified user MACHINENAME\Username" is a local account. Local accounts should only be used in stand alone mode."

Are we unable to install SharePoint 2013 with local accounts for real? I mean in production this would def. make no sense, but for a development or test Environment it can make sense in certain cases.

The trick here is to precreate the SharePoint_Config database with Power Shell. Use the following command:

> New-SPConfigurationDatabase

This creates all necessary databases and u can run Configuration Manager after with the option “Connect to existing farm”, sure u can successfully setup SharePoint then with local accounts on a single machine.

As this is one of the most time consuming parts of the Setup, u can go for a coffe now. it will take some time...