Docteur L – François Lessard

SharePoint Architect, IT Manager and IT Specialist

SharePoint 2010 – What’s your server name again?

Tags: , , , , , ,

Have you ever run into a problem like this before? You’ve been workin two days straight on the newly installed SharePoint 2010 Farm, everything run perfectly and you’re about to release it in production. The Network Administrator calls and says he has a problem with one of the servers. There’s a mispell in the name of the machine, and it’s not following the IT naming convention. So the server must be renamed. In the Windows Server world, this action is very easy to execute, but with a SharePoint 2010 farm, renaming a server has some consequences. In fact, the name of a server is stored in the SharePoint Configuration Database, many communications between servers member of a SharePoint Farm are based on the server name. It’s logical. Tied with the LAN DNS, changing an IP address of one of the servers has no impact if all communications are based on server name.

Because of this name retention in the configuration database, do we need to reinstall the SharePoint Application if the name is changed? Fortunally no! Again PowerShell comes at the rescue.

  1. First rename the server in Windows
  2. Run this PowerShell Command using the SharePoint 2010 Shell Command.

Rename-SPServer –Identity “wfb1″ –Name “WFE1″

The complete reference is available on TechNet.

Share on TwitterShare on LinkedInSubmit to StumbleUponDigg ThisSubmit to reddit
  • Author:
  • Published: Oct 14th, 2011
  • Category: Crawled Properties, Export, Import, Metadata Properties, PowerShell, Search engine
  • Comments: None
  •             

How to export Search Metadata Properties using PowerShell

Tags: , , ,

How to export Search Metadata Properties using PowerShell  from a Development (Test) Environment and import it in a Production Environment.

#Export Crawled Properties
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
 
if ($snapin -eq $null)
{
	Write-Host "Loading SharePoint Powershell Snapin"
	Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
 
$CrawledPropertyName = "ows*"
$SearchService = "Search Service"
$PathXmlFiles = "C:\deploy\xml"
 
Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $SearchService | Where-Object {$_.name -like $CrawledPropertyName} | Export-Clixml $PathXmlFiles\getcrawledproperty.xml
 
Write-Host "Crawled Property exported to $PathXmlFiles\getcrawledproperty.xml" -ForegroundColor Yellow
 
#Import Crawled Properties
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null)
{
	Write-Host "Loading SharePoint Powershell Snapin"
	Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
$SearchService = "Search Service"
$PathXmlFiles = "\\(mydevserver)\C$\deploy\xml"
$xmlmetadata = Import-Clixml $PathXmlFiles\getcrawledproperty.xml
 
foreach ($metadata in $xmlmetadata)
{
	$created = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $SearchService | Where-Object {$_.Name -eq $metadata.Name}
	if ($created)
	{
		Write-Host $metadata.Name "already present" -ForegroundColor:Yellow
	} else {
		New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $SearchService -Name $metadata.Name -Category $metadata.CategoryName -PropSet $metadata.Propset -IsNameEnum:$false -VariantType $metadata.VariantType
		Write-Host $metadata.Name "added" -ForegroundColor:Yellow
	}
}
Share on TwitterShare on LinkedInSubmit to StumbleUponDigg ThisSubmit to reddit

© 2011 Docteur L – François Lessard. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.

Switch to our mobile site