Sharing the experience search
Showing posts with label Simple concept. Show all posts
Showing posts with label Simple concept. Show all posts
Tuesday, May 6, 2014
Wednesday, March 12, 2014
Simple Concept: List View How to add a link to the column other than Title?
Question: I have a column that is not a default Title. I need to have this column rendered with a link to display form in the list view. How can I do it?
Answer:
You have several options, the old ones are described in Simple Concept: List View How to add context menu to the column?
A new versatile approach - JSLink. It works as a charm on prem , as well as on SharePoint Online.
1. Create a js file to render template for the field
var ebt = ebt || {};
// shows link to list item display form
ebt.displayLinkTemplate = function (ctx) {
if (ctx == null)
return '';
var value = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
var url = ctx.displayFormUrl + "&ID=" + ctx.CurrentItem.ID + "&ContentTypeID=" + ctx.CurrentItem.ContentTypeId;
return "<a href='" + url + "'>" + value.Label + "</a>";
};
(function () {
var context = {};
context.Templates = {};
context.Templates.Fields = {
"Project": { "View": ebt.displayLinkTemplate }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(context);
})();
2. Upload the js file into Asset Library and then update the view.JSLink.
I use PowerShell for SharePoint Online By Gary Lapointe
$PrjLst= Get-SPOList -Web "/" -identity "Projects List"
$PrjViews=$PrjLst.GetViews()
$prjDefaultView = $PrjViews|Where-Object {$_.Title -eq "ProjectView"}
$prjDefaultView.JSLink="~site/SiteAssets/ebt.root.projectlistview.js"
$prjDefaultView.Update()
$PrjLst.Update()
Answer:
You have several options, the old ones are described in Simple Concept: List View How to add context menu to the column?
A new versatile approach - JSLink. It works as a charm on prem , as well as on SharePoint Online.
1. Create a js file to render template for the field
var ebt = ebt || {};
// shows link to list item display form
ebt.displayLinkTemplate = function (ctx) {
if (ctx == null)
return '';
var value = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
var url = ctx.displayFormUrl + "&ID=" + ctx.CurrentItem.ID + "&ContentTypeID=" + ctx.CurrentItem.ContentTypeId;
return "<a href='" + url + "'>" + value.Label + "</a>";
};
(function () {
var context = {};
context.Templates = {};
context.Templates.Fields = {
"Project": { "View": ebt.displayLinkTemplate }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(context);
})();
2. Upload the js file into Asset Library and then update the view.JSLink.
I use PowerShell for SharePoint Online By Gary Lapointe
$PrjLst= Get-SPOList -Web "/" -identity "Projects List"
$PrjViews=$PrjLst.GetViews()
$prjDefaultView = $PrjViews|Where-Object {$_.Title -eq "ProjectView"}
$prjDefaultView.JSLink="~site/SiteAssets/ebt.root.projectlistview.js"
$prjDefaultView.Update()
$PrjLst.Update()
Tuesday, March 11, 2014
Simple Concept: How to delete Drop Off library in SharePoint Online?
[Question]: In SharePoint Online I have accidentally turned the feature "Content Organizer" on.
Then I have turned it off. But Drop Off library wasn't deleted. There is no "Delete this document library" in Drop Off library settings.
The various blogs suggest to set "AllowDeletion" property to True.
Since it's SharePoint online, I can't use Microsoft.SharePoint.dll
How can I remove Drop Off library in SharePoint Online?
[Answer]: To keep it short: you can't. Please let me know if were able to.
The only way to manipulate with SharePoint Online objects is through CSOM, the property "AllowDeletion" is not exposed in Client.List
At this moment, what I do is to set Drop Off library Hidden.
I use Gary Lapointe module - Lapointe.SharePointOnline.PowerShell.msi to get Microsoft.SharePoint.Client.List and set Hidden=True
Import-Module -Name Lapointe.SharePointOnline.PowerShell
Connect-SPOSite -Url $siteCollectionUrl -Credential $spOnlineCredentials
$dropofflib= Get-SPOList -Web "/" -identity $fullUrlToDropOffLibrary
$dropofflib.Hidden=$true
$dropofflib.Update()
Then I have turned it off. But Drop Off library wasn't deleted. There is no "Delete this document library" in Drop Off library settings.
The various blogs suggest to set "AllowDeletion" property to True.
Since it's SharePoint online, I can't use Microsoft.SharePoint.dll
How can I remove Drop Off library in SharePoint Online?
[Answer]: To keep it short: you can't. Please let me know if were able to.
The only way to manipulate with SharePoint Online objects is through CSOM, the property "AllowDeletion" is not exposed in Client.List
At this moment, what I do is to set Drop Off library Hidden.
I use Gary Lapointe module - Lapointe.SharePointOnline.PowerShell.msi to get Microsoft.SharePoint.Client.List and set Hidden=True
Import-Module -Name Lapointe.SharePointOnline.PowerShell
Connect-SPOSite -Url $siteCollectionUrl -Credential $spOnlineCredentials
$dropofflib= Get-SPOList -Web "/" -identity $fullUrlToDropOffLibrary
$dropofflib.Hidden=$true
$dropofflib.Update()
Monday, July 22, 2013
Simple concept: Project Server - The Web site specified is already linked to another project. Select another Web site, and then try again
[Question]:
I have Project Server 2010. On the page /_layouts/PWA/Admin/ManageWSS.aspx I see none of the project workspaces are linked, a column Site Address is empty.
When I try to edit Site Address and add existed project workspace to one of the project, I have got an error: The Web site specified is already linked to another project. Select another Web site, and then try again.
How can I determine to which project the project workspace is linked? And why Site Address is empty?
[Answer]:
You can determine the linked project for workspace with 2 following steps:
1. Run powershell :
$web = get-spweb {workspace url}
$web.AllProperties["MSPWAPROJUID"]
You will get Project Id to which the workspace is linked to.
2. Go to SQL Management studio and query:
SELECT *
FROM [ProjectServer_Published].[dbo].[MSP_PROJECTS]
where Proj_UID = {MSPWAPROJUID value}
That will bring to you project to which the workspace is linked.
And the second question: Why Site Address is empty on /_layouts/PWA/Admin/ManageWSS.aspx even though the workspace is linked to the project
I don't know the reason., but I know you can easily re-establish the value.
Thursday, July 18, 2013
Simple concept: Jump start for developers of SharePoint 2013 App
[Question]:
I want to try SharePoint 2013 App Development.
Where to start?
[Answer]:
I am flattered if you are reading this post, even though MSDN is full of articles about this topic.
Here are following preparations steps before the development:
If you have limited time, focus on the Module 5 SharePoint 2013 app model for developers
Developing apps for SharePoint on a remote system
I want to try SharePoint 2013 App Development.
Where to start?
[Answer]:
I am flattered if you are reading this post, even though MSDN is full of articles about this topic.
Here are following preparations steps before the development:
1. View "Developer training | Apps for Office and SharePoint"
http://msdn.microsoft.com/en-us/office/apps/fp123626If you have limited time, focus on the Module 5 SharePoint 2013 app model for developers
2. Setup the env
To install VS 2012
You need to install Microsoft Office Developer Tools for Visual Studio 2012 from
You need yo create your own Office 365 Developer site.
Developing apps for SharePoint on a remote system
Friday, May 24, 2013
Is SharePoint rubbish? Trash talk on SharePoint architecture
I have recently bought a book by one of the favorite knowledgeable guy in the SharePoint world - Todd Klindt - Professional SharePoint 2013 Administration
The book is hilarious and very descent to have on the shelf if you are a SharePoint Administrator, Developer or Architect.
Here is my favorite paragraph so far, which is very metaphorical and easy memorize for someone who is new in this big and messy SharePoint World.
"Try this analogy to understand how [all] pieces work together: Web applications are the landfill. Content databases are giant dumpsters. A site collection is a big, black 50-gallon garbage bag. Webs, lists, and items are pieces of trash. Your users spend all week creating garbage, continuously stuffing it in the garbage bags, with each piece of trash occupying only one garbage bag at a time. Each garbage bag can hold only 50 gallons of trash (quotas) before it is full, after which the user has to either ask for a new garbage bag or get a bigger garbage bag. That full garbage bag is placed in a dumpster, and it is not possible to put a garbage bag in more than one dumpster without destroying it. Dumpsters are serviced only by one landfill but that landfill can handle thousands of dumpsters without issue. "
Thursday, May 2, 2013
Simple Concept: List View How to add context menu to the column?
[Question]: I want to add a context menu and a link in the list view on the column that is NOT a default "Title" column. How can I do it?
[Answer]:
You can either
1. implement xsltviewwebpart (which is tedious task);
2. or you can using PowerShell set up special attributes to the field that you want to add a context menu and a link.
I personally prefer the second approach. It allows a user to create a view over and over again and he\she will get the same behavior - a context menu and link to a specific , not a default title column.
Here is a simple magic:
You have to add a following attributes to a desired <Field :
Using PowerShell it will look like this:
[Answer]:
You can either
1. implement xsltviewwebpart (which is tedious task);
2. or you can using PowerShell set up special attributes to the field that you want to add a context menu and a link.
I personally prefer the second approach. It allows a user to create a view over and over again and he\she will get the same behavior - a context menu and link to a specific , not a default title column.
Here is a simple magic:
You have to add a following attributes to a desired <Field :
LinkToItem="TRUE"
LinkToItemAllowed="Required"
ListItemMenu="TRUE
Using PowerShell it will look like this:
$Lst =
get-Splist "{full url}"
$prolFld = $Lst.Fields;
$Fld = $projFld.getField("{field static name}")
#Save original Schema for backup purposes
$Fld.SchemaXml >> fldbkp.txt
#open fldbkp.txt. Copy the content over to the notepad.
#Add attributes LinkToItem="TRUE" LinkToItemAllowed="Required" ListItemMenu="TRUE".
#Replace '"' with '''.Copy content
$Fld.SchemaXml ="{your copied edited field caml}"
$Fld.Update()
$Lst.Update()
P.S. It turned out that PowerShell SharePoint 2013 Snap-in
doesn't have a command sp-list!
So, here is an PS code for SP2013:
$web = Get-SPWeb{"{Url of spweb}"}
$list = $web.Lists['{List name}']
$Flds = $list.Fields;
$Fld = $Flds.getField("{Static Field name}")
3. For those who in SharePoint Online with limited PowerShell possibilities , you can add the context menu via SharePoint designer
Select the view, edit in Advanced mode.
Locate <ViewFields><FieldRef
Find you column that should have context menu.
And add the following:
ListItemMenu="TRUE"
So, it should like this:
<FieldRef Name="YourColumn" ListItemMenu="TRUE"/>
$prolFld = $Lst.Fields;
$Fld = $projFld.getField("{field static name}")
#Save original Schema for backup purposes
$Fld.SchemaXml >> fldbkp.txt
#open fldbkp.txt. Copy the content over to the notepad.
#Add attributes LinkToItem="TRUE" LinkToItemAllowed="Required" ListItemMenu="TRUE".
#Replace '"' with '''.Copy content
$Fld.SchemaXml ="{your copied edited field caml}"
$Fld.Update()
$Lst.Update()
P.S. It turned out that PowerShell SharePoint 2013 Snap-in
doesn't have a command sp-list!
So, here is an PS code for SP2013:
$web = Get-SPWeb{"{Url of spweb}"}
$list = $web.Lists['{List name}']
$Flds = $list.Fields;
$Fld = $Flds.getField("{Static Field name}")
3. For those who in SharePoint Online with limited PowerShell possibilities , you can add the context menu via SharePoint designer
Select the view, edit in Advanced mode.
Locate <ViewFields><FieldRef
Find you column that should have context menu.
And add the following:
ListItemMenu="TRUE"
So, it should like this:
<FieldRef Name="YourColumn" ListItemMenu="TRUE"/>
Monday, February 11, 2013
Simple concept: Property bag VS Hierarchical Object Store
[Question]: Ever wondered what the difference between Property bag and Hierarchical Object Store in SharePoint?
[Answer]: A nice and short (that how I like) article on that here - Where Should You Store Your SharePoint Solution’s Configuration Data?
The big discovery for me was that:
Property bag is store in the content database;
Hierarchical Object Store in the config database.
More on Managing Custom Configuration Options for a SharePoint Application
[Answer]: A nice and short (that how I like) article on that here - Where Should You Store Your SharePoint Solution’s Configuration Data?
The big discovery for me was that:
Property bag is store in the content database;
Hierarchical Object Store in the config database.
More on Managing Custom Configuration Options for a SharePoint Application
Thursday, September 13, 2012
Simple Concept: How to search by managed metadata field or term?
[Question]: I have created a term and used it in managed metadata column. How can I search by term value to find any place where such term has been used?
For an example,
I have a managed metadata column "Project Tags" in the library.
I have an item in the library with value "eReview" in the Project Tags column.
I want to be able to search by eReview to find that item
[Answer]:
Once you have created a managed metadata column, you have to run a crawl.
Crawl will automatically create a crawled property and managed property that look at the managed metadata column.
What you have to do is to check "Include values for this property in the search index". It will give ability to search by term title in the search.
In case you need to search byTerm id, use a managed property value like this:
Where owsTaxIdProject is a managed property and term id - the actual term of id (in this case - eReview).
You may ask 2 questions at this time:
1 . Why I need to search by Term id?
- You may want to build a custom webpart to show all related content based on the select term.
2. How do I know Term id?
One way to find a term id is to go to the site collection hidden list Lists/TaxonomyHiddenList
Other popular option is to use seach refiner with the term that is interesting for you:
Select the value in the refiner and then look at the url of the search page:
Easy way to decode this - URL Decoder/Encoder

ATTENTION:
If you have several metadata columns in the several lists that look at the the same term set, but you call them differently (internal names in the different lists are not the same), the crawler will create several managed properties.
You want them unite. Find all crawled properties that have been created based on your managed metadata.
Hint: name of crawled property has a pattern. ows prefix means - custom metadata, taxId - refers to the type of column- Managed metadata. Hence you can find your all crawled managed metadata columns by searching withing crawled properties by name taxId.
And then map the crawled properties to the one Managed property.
Good luck with Taxonomy!
Monday, August 20, 2012
Simple Concept: Where to start in SharePoint development?
[Question]: I am a complete newbie in SharePoint development. Where should I start?
[Answer]:
Here is what I recommend to read to build a solid understanding of SharePoint architecture and development. I would recommend to read highlighted pages and then dive into development.
I suppose the whole highlighted pages reading will take up to 2 days.:
Understanding and troubleshooting SharePoint 2010 technology features and services - pages from 6 to 14
Understandingsharepoint journal issue "Introducing SharepPoint 2010" by Bjørn Furuknap - pages from 99 to 152
SharePoint 2010 Development with Visual Studio 2010 (Microsoft Windows Development Series) - Chapter 1: Introduction into SharePoint pages 1-130
What about 2013?
here we are go: Simple concept: Jump start for developers of SharePoint 2013 App
Beginner's luck is on your side!
And full-blown collection of the SP book to get lost)
Need some a bird view on SharePoint main job types - Developer, Administrator, Architect? - Become a SharePoint professional
Wednesday, June 13, 2012
Simple Concept: How to export wsp file?
[Question]: How can I export wsp file from farm solution?
[Answer]:
User PowerShell script:
PowerShell Script for SP2010 to export farm solution file
[Answer]:
User PowerShell script:
PowerShell Script for SP2010 to export farm solution file
Tuesday, March 27, 2012
Simple concept: SharePoint 2010 Visual Upgrade Powershell
[Question]:
How do I visual upgrade 2010 my all 2007 web sites using PowerShell?
[Answer]:
Get-Spsite -Limit All | % { $_.VisualUpgradeWebs() }
In case you need to revert changes:
$web = Get-SPWeb "{your spweb url}"
$web.UIVersion=3
$web.Update()
Further reading:
Simple concept: How to use SharePoint cmdlets in PowerShell ISE [Question]:
The source on inspiration: Automating SharePoint 2010 with Windows PowerShell 2.0
How do I visual upgrade 2010 my all 2007 web sites using PowerShell?
[Answer]:
Get-Spsite -Limit All | % { $_.VisualUpgradeWebs() }
In case you need to revert changes:
$web = Get-SPWeb "{your spweb url}"
$web.UIVersion=3
$web.Update()
Further reading:
Simple concept: How to use SharePoint cmdlets in PowerShell ISE [Question]:
The source on inspiration: Automating SharePoint 2010 with Windows PowerShell 2.0
Thursday, March 22, 2012
Simple concept: when to use Reporting Services (SSRS) and when to use PerformancePoint Services 2010
[Question]:
When to use SQL Server Reporting Services (SSRS) and when to use PerformancePoint Services 2010"?
[Answer]:
PerformancePoint Services excels in the creation of KPIs and scorecards. If you need other type of reports (tabular, interactive, visual, or freeform), you will need SQL Server Reporting Services (SSRS).
When to use SQL Server Reporting Services (SSRS) and when to use PerformancePoint Services 2010"?
[Answer]:
PerformancePoint Services excels in the creation of KPIs and scorecards. If you need other type of reports (tabular, interactive, visual, or freeform), you will need SQL Server Reporting Services (SSRS).
Friday, March 9, 2012
Simple concept: How to create site collection with different content database?
[Question]:
How to create a site collection that uses new content database?
[Answer]:
Here is a PowerShell script how to do it:
For further reading:
1. Here is my favorite Russian blogger who shares his wisdom on "Tips to create a Site Collection in new Content Database"
2. My post on Failover option in SharePoint 2010
3. New-spsite without parameter Template will create a root web for the site collection. The url of site collection will give you a blank page, and you are free to create any sites (spwebs) under the site collection.
A small tip for newbie: you can get to the root web site collection properties through url : {your new site collection created without template}/_layouts/settings.aspx
How to create a site collection that uses new content database?
[Answer]:
Here is a PowerShell script how to do it:
$webAppUrl = "{your web app url}"
$contentDBName="{new content db name}"
new-spcontentdatabase -name
$contentDBName -webapplication $webAppUrl -DatabaseServer "{your sql server for content Dbs}"
$db = get-spdatabase | where
{$_.Name -eq $contentDBName}
$db.AddFailoverServiceInstance("{your failover server}");
$db.Update()
new-spsite -name "{site collection anme}" -ContentDatabase $contentDBName -url "{site collection url}"
-OwnerAlias "{domain\user to be a primary site collection administrator}"
For further reading:
1. Here is my favorite Russian blogger who shares his wisdom on "Tips to create a Site Collection in new Content Database"
2. My post on Failover option in SharePoint 2010
3. New-spsite without parameter Template will create a root web for the site collection. The url of site collection will give you a blank page, and you are free to create any sites (spwebs) under the site collection.
A small tip for newbie: you can get to the root web site collection properties through url : {your new site collection created without template}/_layouts/settings.aspx
Friday, February 17, 2012
Simple concept: Does WSP deployment(retraction) resets IIS?
[Question]:
Does WSP deployment triggers IISRESET?
[Answer]:
Depends on type of deployment. There are 2 kinds: Local and Timer Service deployments
(Deploying a Solution). BE AWARE that WSP solution retractions causes IISRESET too.
Local WSP deployment - stsadm -o deploysolution -local .Deploys the solution synchronously on the local computer only. The timer service is not used. . It will call IISRESET but locally on the WFE, not in all WFEs in the farm.
Farm solution deployment with no downtime. Update-SPSolution -local
Timer Service Deployment - stsadm -o deploysolution -immeidate (or -time)
(Deploysolution: Stsadm operation) . Uses a timer job and triggers IISRESET.
The deployment step for a farm solution creates a timer job. This timer job is used by the timer service on each web server in the server farm. The timer job also uses the SharePoint Foundation Administrative web service to access appropriate privileges to deploy solution files to each computer, so both services must be running on all servers for the deployment to succeed.
Initially, the package manifest is parsed to find assemblies, application pages, JavaScript, and other files that are not part of a Feature. These are copied to the locations specified in the manifest. All files contained within a Feature are copied to the Feature directory, a subdirectory of %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES. After solution files are copied to the target computers, a configuration reset is scheduled for all front-end web servers; the reset then deploys the files and restarts Internet Information Services (IIS). Farm administrators can specify when this occurs.
More detail coverage on the topic: SharePoint Solution Deploy, retract, upgrade – What causes your SharePoint farm to go offline IISRESET (web server outage).
Tuesday, January 31, 2012
Simple Concept: Central Administration Url: Where it stores and how to change
[Question]:
On SharePoint server when I click on "Central Administration" it goes nowhere...
How do I change the Url for 'Central Administration" shortcut?
[Answer]:
When "central administration" goes nowhere, first check if shortcut goes to the right url.
Url for this shortcut is kept in registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\CentralAdministrationURL
Please backup the key first, and then safely set you desired url for CA.
It actually changes automatically when you setup default public url in Alternate Access Mapping.
P.S. For some reason a new url won't work locally on the server?
Please read about some tweaks that you wan't to do on the web server:
Disable the loopback or specify HostName
P.S. For some reason a new url won't work locally on the server?
Please read about some tweaks that you wan't to do on the web server:
Disable the loopback or specify HostName
Wednesday, January 25, 2012
Simple Concept: _layouts/userdisp.aspx shows 404 not found
[Question]:
P.S. More details from SharePoint User Information Userdisp.aspx Error by Melonie Poole
How to fix 404 not found on SharePoint 2007/2010 browsing User Profile page _layouts/userdisp.aspx ?
[Answer]:
The userdisp.aspx page code needs to be changed on any servers providing web application services for the site (the web front ends, for example). On the servers, navigate to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS. Make a copy of the userdisp.aspx file – just in case, so you'll have something to revert back to! Open the original using Notepad. Look for Scope="Farm" and change Farm to Web so that it reads Scope="Web". Save and close. Repeat on all web servers
P.S. More details from SharePoint User Information Userdisp.aspx Error by Melonie Poole
Monday, January 9, 2012
Simple Concept : visionapp Remote Desktop 2011: how to restore configuration file?
[Question]: I want to use my configuration for visionapp Remote Desktop 2011 under a different account logged into machine. I don't have .vre (export) or .vrb (backup) file with my configuration.How can I transfer my connection configuration?
[Answer]:
Run visionapp, add file
Browse and find you original settings.xml file with connections and credentials under C:\Documents and Settings\{User}\Application Data\visionapp\vRd2010\settings.xml
Select the file, finish the process.
Note: stored credentials in setting.xml won't be decrypted, so you need to retype password for them.
[Answer]:
Run visionapp, add file
Browse and find you original settings.xml file with connections and credentials under C:\Documents and Settings\{User}\Application Data\visionapp\vRd2010\settings.xml
Select the file, finish the process.
Note: stored credentials in setting.xml won't be decrypted, so you need to retype password for them.
Friday, December 9, 2011
Simple Concept: PowerShell: The local farm is not accessible.
[Question]: What permissions should I have to run PowerShell against SharePoint 2010?
How can I fix following issues:
- The local farm is not accessible. Cmdlets with FeatureDepedencyId are not registered
- Cannot access the local farm
- Object reference not set to an instance of an object?
[Answer]:
Remember, when using the SharePoint 2010 Management Shell and its Windows PowerShell cmdlets, you need both:
the rights granted via the Add-SPShellAdmin cmdlet and
local administrator rights on the server on which you’re running the management shell
(From Hey, Scripting Guy! Tell Me About Permissions and Using Windows PowerShell 2.0 Cmdlets with SharePoint 2010)
P.S. Do you need a fast tour on PowerShell And SharePoint 2010?
PowerShell and SharePoint: What, Why and How - gives you an overview what's PowerShell and how to use it for SharePoint 2010
SharePoint 2010: PowerShell and Stsadm - explains why you want to use PowerShell instead of stsadm in SharePoint 2010
Simple concept: How to use SharePoint cmdlets in PowerShell ISE - shows you how to user PowerShell in SharePoint 2010
PowerShell: Add-SPSolution -force when wsp is already deployed - a PowerShell replacement for stsadm -o addsolution and deploysolution
How can I fix following issues:
- The local farm is not accessible. Cmdlets with FeatureDepedencyId are not registered
- Cannot access the local farm
- Object reference not set to an instance of an object?
[Answer]:
Remember, when using the SharePoint 2010 Management Shell and its Windows PowerShell cmdlets, you need both:
the rights granted via the Add-SPShellAdmin cmdlet and
local administrator rights on the server on which you’re running the management shell
(From Hey, Scripting Guy! Tell Me About Permissions and Using Windows PowerShell 2.0 Cmdlets with SharePoint 2010)
P.S. Do you need a fast tour on PowerShell And SharePoint 2010?
PowerShell and SharePoint: What, Why and How - gives you an overview what's PowerShell and how to use it for SharePoint 2010
SharePoint 2010: PowerShell and Stsadm - explains why you want to use PowerShell instead of stsadm in SharePoint 2010
Simple concept: How to use SharePoint cmdlets in PowerShell ISE - shows you how to user PowerShell in SharePoint 2010
PowerShell: Add-SPSolution -force when wsp is already deployed - a PowerShell replacement for stsadm -o addsolution and deploysolution
Wednesday, December 7, 2011
Simple Concept: How to change database SQL server name in SharePoint
[Question]:
How do I change the SQL Server name in SharePoint 2010\2007?
[Answer]:
Golden rule: "User SQL Alias instead of the SQL server name"
In any case, whether you need replace the SQL instance name or SQL alias, you can do it:
For 2007: Make use of the stsadm command: stsadm -o renameserver
For 2010: Make use of the PowerShell command: Rename-SPServer
You want to run the command on every server in the farm.
Real example:
I had the SQL alias soa-db01-prod, which it is not what I want now.
I want to replace SQL alias to soa-db05-prod.
Steps to successful SQL server name renaming on ever server that is included in the Farm (except SQL servers):
1. Add a new SQL alias "soa-db05-prod"
2. Run the command
Rename-SPServer –Identity "soa-db01-prod" –Name "soa-db05-prod"
3. Delete alias "soa-db01-prod"
4. iisreset
ATTENTION: I have discovered that after running Rename-SPServer 2 services still were referencing to the old SQL name:
1. User Profile Service Synchronization.
To fix it - I have restarted the User Profile Synchronization Service
( to know more about How to deal with User Profile Service - How to start User Profile Synchronization service)
2. Web Analytics Service Application
To fix it - I have stopped the services Web Analytics Data Processing Service,Web Analytics Web Service and re-created the service.
How do I change the SQL Server name in SharePoint 2010\2007?
[Answer]:
Golden rule: "User SQL Alias instead of the SQL server name"
In any case, whether you need replace the SQL instance name or SQL alias, you can do it:
For 2007: Make use of the stsadm command: stsadm -o renameserver
For 2010: Make use of the PowerShell command: Rename-SPServer
You want to run the command on every server in the farm.
Real example:
I had the SQL alias soa-db01-prod, which it is not what I want now.
I want to replace SQL alias to soa-db05-prod.
Steps to successful SQL server name renaming on ever server that is included in the Farm (except SQL servers):
1. Add a new SQL alias "soa-db05-prod"
2. Run the command
Rename-SPServer –Identity "soa-db01-prod" –Name "soa-db05-prod"
3. Delete alias "soa-db01-prod"
4. iisreset
ATTENTION: I have discovered that after running Rename-SPServer 2 services still were referencing to the old SQL name:
1. User Profile Service Synchronization.
To fix it - I have restarted the User Profile Synchronization Service
( to know more about How to deal with User Profile Service - How to start User Profile Synchronization service)
2. Web Analytics Service Application
To fix it - I have stopped the services Web Analytics Data Processing Service,Web Analytics Web Service and re-created the service.
Subscribe to:
Posts (Atom)