Showing posts with label Sharepoint. Show all posts
Showing posts with label Sharepoint. Show all posts

26 Apr 2013

How to insert multiple person/group field contents into CC portion of workflow email

Issue:  You want to be able to pull the values contained in a multiple person/group field in a SharePoint list into a workflow, and insert them into the CC portion of the send email workflow action.
A most brilliant colleague of mine was able to find a quick and easy workaround for this pesky issue.
In this scenario, the users to be CC'd are contained in a multiple person/group field in the list that the workflow is running on, called 'Assigned To Secondary'
To solve the problem:
  1. set workflow var:SecondaryAssigned to CurrentItem:Assigned To Secondary (formatted as a string)
  2. if workflow var:SecondaryAssigned is not empty
  3. set workflow var:SecondaryAssignedAddr to workflow var:SecondaryAssigned (formatted as email address, semicolon delimited)
  4. send email
  5. in the CC portion, select workflow var:SecondaryAssignedAddr (formatted as a string)
Hope that helps...!

http://geekswithblogs.net/DinoGrl/archive/2012/04/24/sharepoint-2010-how-to-insert-multiple-persongroup-field-contents-into.aspx

 

How to get SPUser or SPGroup from Person or Group field

You have person or group field in SharePoint list and you want to programmatically get the user or person.


The below code to gets SPUser from User or Group field in the list 
Multiple choice X
Groups X
 
//get SPUser
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users");
SPFieldUserValue userFieldValue = (SPFieldUserValue)userField.GetFieldValue(item["Users"].ToString());
SPUser user = userFieldValue.User;

Multiple choice Y
Groups X

//Multiple choices are allowed
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users");
SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString());
foreach (SPFieldUserValue userFieldValue in userFieldValueCollection)
{
    Console.WriteLine("     " + userFieldValue.User.LoginName);
}


Group Y


//Group or User are allowed
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users");
SPFieldUserValue userFieldValue = (SPFieldUserValue)userField.GetFieldValue(item["Users"].ToString());
//Tries to get SPUser
if (userFieldValue.User != null)
{
   SPUser user = userFieldValue.User;
}
//if the field contain group
else
{
  SPGroup group = web.SiteGroups.GetByID(userFieldValue.LookupId);
}
 
 

17 Apr 2013

Move/Migrate Sharepoint 2010 list based workflow

http://gavinmckay.wordpress.com/2011/08/29/howto-move-or-migrate-sharepoint-2010-list-based-workflows-between-sites-and-site-collections/


HOWTO Move or Migrate SharePoint 2010 List-based Workflows between Sites and Site Collections

I’ve experienced this issue a lot when trying to migrate workflows between test SharePoint 2010 farms and production farms, in particular with workflows attached to lists. When moving a workflow to another site collection or server farm, the association to the list is broken and the workflow cannot be attached to the list. You also cannot use SharePoint designer to fix this via the standard methods as the unattached workflow cannot be reattached to the list.
List-based workflows are tied to three different lists – the “main” source list where the data is held (such as a Forms library or custom list), a task list, and a workflow history list. The latter in particular is tricky, because it is a hidden list and cannot be viewed via the normal interface.
The fix for this is to modify the source workflow files to force the workflow to reattach to the list. The following method assumes that your new site/location that you are moving the workflow too does not yet have any workflows already attached to any lists on the site. When a workflow is created in a site for the first time, a Tasks list and a Workflow History list are automatically created/used by the workflow. These lists must exist before you can force your migrated workflow to attach to the list.

Step 1 – Create a Blank Workflow

  1. Using SharePoint designer, connect to your destination site
  2. Create a new list-based workflow called “test” (or whatever), attaching it to your migrated list
  3. Create one condition (i.e. if 1 = 1)
  4. Create one action (i.e. add comment “hello”)
  5. Save and publish the workflow
After this step has been completed, your site will now have a Tasks list and Workflow History list.

Step 2 – Get the list ids for your new workflow

The list ids are required to configure your migrated workflow.
  1. Using SharePoint Designer, connect to your destination site
  2. in the left-hand side, in Site Objects, select All Files
  3. in the All Files list, select Workflows
  4. Select your new workflow that you just created (in this example, “test”)
  5. You should see (at least) four files:
    text.xoml
    test.xoml.rules
    test.xoml.wfconfig.xml
    test.xsn
  6. Right-click on test.xoml.wfconfig.xml and select Open With, Notepad
  7. Look for the tag in the xml:
  8. Record the Guid entries for ListID, TaskListID, and HistoryListID

Step 3 – Update the migrated workflow

  1. Still using SharePoint Designer, All Files, Workflows, this time select your migrated workflow
  2. You should again see (at least) four files. Right-click on “your-workflow.xoml.wfconfig.xml” and select Open with SharePoint Designer (As XML)
  3. Find the Association tag and very carefully change the Guids so that your migrated List IDs are the same as the “test” workflow List IDs.
  4. Save the file
  5. Close SharePoint Designer
  6. Open SharePoint Designer again and open your site
  7. Instead of All Files, this time click on Workflows
  8. Select your workflow
  9. Save the workflow
  10. Publish the workflow
Your workflow should now be reassociated with your list on your new site.



16 Apr 2013

Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker' issue in eventlog

http://support.microsoft.com/kb/2481844



9 Apr 2013

Using a date column in a sharepoint online web chart web part

I added a "web chart" web part to a sharepoint online page from the browser interface.

Next, I decided to run the Data connection wizard to connect my chart to an excel services. In the step 3 of the wizard (Retrieve and filter data), I can preview the Data.

There comes the problem: my Date column display five-digit integers instead of dates. I've tried to change the format of the column in the source excel book to YYYY-MM-DD, is does not solve my issue.

Go into page edit mode for the web part and select Advanced Properties. Click on the link for Series and scroll down to the Data section. Set either the XValueType or YValueType from Auto to Date and click Finish.

Chart web part with Excel services

http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/09/02/how-to-use-the-chart-web-part-with-excel-services.aspx

Using the Excel Services 2010 REST API


Discover Items in a Workbook
http://myserver/mywebsite/_vti_bin/ExcelRest.aspx/Shared%20Documents/Sales_Report.xlsx/Model

Retrieve Various Items in Different Formats
http://myserver/mywebsite/_vti_bin/ExcelRest.aspx/Shared%20Documents/Sales_Report.xlsx/Model/Range




http://msdn.microsoft.com/en-us/library/ff961897(v=office.14).aspx

14 Feb 2013

Least Privileged for SharePoint


1. SQL Server Service Account (sp_sql): run mssql server, mssql agent svc
- Standard Domain User Account

2. SharePoint Setup User (sp_admin): run as logon account when install SP or configure SP
- Standard Domain User Account
- Local admin group of every sp server of the farm
- SQL role: db server security, db creator, db admin

3. Server Farm/DB Access Account (sp_farm) 
- Standard Domain User Account

Create account for every services
-App Pool Account
-App Pool Account for BDC service app, excel app, ..






21 Jan 2013

web part export

Export list from working site
Import list to site. Create custom view and make it as default.
Add web part and select imported list. Select custom view as in step 2.


14 Aug 2012

Resume Content DB upgrade

I’m going to start this post with a couple of little issues when upgrading your SharePoint environment, but there are several great references for you


If your SharePoint 2010 upgrade is stuck and you get the following in Central Administration “database is up to date, but some sites are not completely upgraded”. Note, there is a whole lot of misinformation out there about performing/reinitializing an upgrade by using the psconfig -cmd upgrade -inplace v2v (or b2b) commands. However, this is for upgrading your Farm and if it is failing on the content databases, it will continue to fail. The below is all about resuming the content database upgrade.
 The first thing you will need to do is get the Site ID for the Database that is problematic
Get-SPContentDatabase -Identity Name_of_Database
 That should return something that looks like this…



Once you have the ID, you’ll want to execute the Update-SPContentDatabase command
upgrade-spcontentdatabase -id f7f9907c-71e8-494d-8f2b-4ce6a5b934ea


References:
 http://www.shareesblog.com/?p=560



Diagnose MissingWebPart and MissingAssembly issues from the SharePoint Health Analyzer using PowerShell


In this article I am going to focus on MissingWebPart and MissingAssembly errors. As stated in previous articles, there is no silver bullet to solving these errors in all cases, but the scripts offered here will allow you troubleshoot the errors further to find exactly where they are happening in the content database. Once you know this, you have a fighting chance of being able to solve the problem.
MissingWebPart Error
In this example, I have received the following error whilst running a Test-SPContentDatabase operation after a content database migration from SharePoint 2007 to 2010. It also appears in the SharePoint Health Analyzer under the “Configuration” category with the title “Missing server side dependencies”:
Category        : MissingWebPart
Error           : True
UpgradeBlocking : False
Message         : WebPart class [4575ceaf-0d5e-4174-a3a1-1a623faa919a] is referenced [2] times in the database [SP2010_Content], but is not installed on the current farm. Please install any feature/solution which contains this web part.
Remedy          : One or more web parts are referenced in the database [SP2010_Content], but are not installed on the current farm. Please install any feature or solution which contains these web  parts.

As you can see, the error gives you a “WebPart class” GUID, the name of the content database, and how many times it is referenced in the database, but little else. What we need to find out here is either the name of the web part or on which pages it is referenced in the database.
For this I am going to reuse the Run-SQLQuery PowerShell script that I introduced in my article on MissingSetupFile errors:
function Run-SQLQuery ($SqlServer, $SqlDatabase, $SqlQuery)
{
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Server =" + $SqlServer + "; Database =" + $SqlDatabase + "; Integrated Security = True"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $SqlQuery
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$SqlConnection.Close()
$DataSet.Tables[0]
}
Once you have loaded the function in a PowerShell console, you can run it by using the Run-SQLQuery command with the options relevant to your deployment. For [MissingWebPart] errors, you need to run a SQL SELECT query on the “AllDocs” table in the content database exhibiting the problem, joining to the “AllWebParts” table in order to find details about the missing web part. For example, you would type the following command to find details of the web part with the class ID “4575ceaf-0d5e-4174-a3a1-1a623faa919a”, as reported in the error above:
Run-SQLQuery -SqlServer "SQLSERVER" -SqlDatabase "SP2010_Content" -SqlQuery "SELECT * from AllDocs inner join AllWebParts on AllDocs.Id = AllWebParts.tp_PageUrlID where AllWebParts.tp_WebPartTypeID = '4575ceaf-0d5e-4174-a3a1-1a623faa919a'" | select Id, SiteId, DirName, LeafName, WebId, ListId, tp_ZoneID, tp_DisplayName | Format-List
Yes, it is a pretty long command, but it will produce a very useful output, as shown in this example:
Id             : 6ab5e70b-60d8-4ddf-93cb-6a93fbc410be
SiteId         : 337c5721-5050-46ce-b112-083ac52f7f26
DirName        : News/Pages
LeafName       : ArticleList.aspx
WebId          : dcc93f3e-437a-4fae-acea-bb15d5c4ea7d
ListId         : 7e13fe6c-3670-4d46-9601-832e3eb6a1e4
tp_ZoneID      : Body
tp_DisplayName :

Id             : b3fcfcd2-2f02-4fe9-93e4-9c9b5ecddf5b
SiteId         : 337c5721-5050-46ce-b112-083ac52f7f26
DirName        : Pages
LeafName       : Welcome.aspx
WebId          : 2ae0de59-a008-4244-aa66-d8f76c79f1ad
ListId         : d8f083f0-16b9-43d0-9aaf-4e9fffecd6cc
tp_ZoneID      : RightColumnZone
tp_DisplayName :

This tells us that the web part has been found on two pages (the references mentioned in the MissingWebPart error). SiteId tells us the site collection and WebId the site where the pages are located. We also have a DirName showing the relative path and the page name itself against the LeafName property. If you’re lucky, you might get the display name of the web part against the tp_DisplayName property, but if not, you should at least be able to tell which zone the web part has been added to by looking at the tp_ZoneID property.
Easily the best way of resolving these issues is to do as the error suggests and install the missing feature or solution containing the web part, but if this is not possible or feasible to do in your scenario, we can discover the site collection URL from the GUIDs using PowerShell and then remove the offending web parts from the pages specified.
To find the site collection URL using the information output from the query, type the following command:
$site = Get-SPSite -Limit all | where {$_.Id -eq "337c5721-5050-46ce-b112-083ac52f7f26"}
$site.Url
One you have the site collection URL, you can use the relative path specified by the DirName property to find the location of the file. To remove the web part from the page, type the page URL in the browser and add ?contents=1 to the end of it. For example, to open the web part maintenance page for the ArticleList.aspx page specified in the output, type the following URL in the browser:
http://portal/news/pages/articlelist.aspx?contents=1
You can then highlight the offending web part (normally called ErrorWebPart for MissingWebPart errors) by ticking the box and clicking Delete. The screenshot below shows a web part maintenance page to give you an idea of the UI, but not an example of an ErrorWebPart as I had already removed them!
image
Note: If you remove an ErrorWebPart from a publishing page with versioning switched on, you may have to delete all earlier versions of the page before the error disappears from the SharePoint Health Analyzer or Test-SPContentDatabase report. This is because the web part will still be referenced from these versions, even though you removed it from the currently published page.
MissingAssembly Error
MissingAssembly errors look similar to this one:
Category        : MissingAssembly
Error           : True
UpgradeBlocking : False
Message         : Assembly [PAC.SharePoint.Tagging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b504d4b6c1e1a6e5] is referenced in the database [SP2010_Content], but is not installed on the current farm. Please install any feature/solution which contains this assembly.
Remedy          : One or more assemblies are referenced in the database [SP2010_Content], but are not installed on the current farm. Please install any feature or solution which contains these assemblies.

I normally find MissingAssembly errors appear as the result of an event receiver, which is still registered on a list or library but part of a feature/solution no longer present on the farm.
In most cases, you may be able to look at the assembly name reported in this error and know what the problem is straight away. As before, the best way of resolving this is to reinstall the missing solution file. However, if you are not able to install the solution (e.g., maybe it only works in SharePoint 2007 and not 2010), then you may want to find the lists where the event receiver is installed and either remove the event receiver from the lists or delete the lists themselves.
To troubleshoot this issue we can re-use the Run-SQLQuery function used to help find missing web parts above. The table we need to look at this time though is called “EventReceivers”. For example, you would type the following command to find details of the assembly called “PAC.SharePoint.Tagging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b504d4b6c1e1a6e5”, as reported in the error above:
Run-SQLQuery -SqlServer "SQLSERVER" -SqlDatabase "SP2010_Content" -SqlQuery "SELECT * from EventReceivers where Assembly = ‘PAC.SharePoint.Tagging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b504d4b6c1e1a6e5'" | select Id, Name, SiteId, WebId, HostId, HostType | Format-List
This will produce an output similar to the following:
Id       : 657a472f-e51d-428c-ab98-502358d87612
Name     :
SiteId   : 337c5721-5050-46ce-b112-083ac52f7f26
WebId    : 2ae0de59-a008-4244-aa66-d8f76c79f1ad
HostId   : 09308020-45a8-41e4-bbc0-7c8d8cd54132
HostType : 2

Id       : 0f660612-6be0-401e-aa1d-0ede7a9af8da
Name     :
SiteId   : 337c5721-5050-46ce-b112-083ac52f7f26
WebId    : 2ae0de59-a008-4244-aa66-d8f76c79f1ad
HostId   : 09308020-45a8-41e4-bbc0-7c8d8cd54132
HostType : 2

As with the MissingWebPart error before, we can use these GUIDs to get the site collection and site hosting the list with the missing event receiver, as follows:
$site = Get-SPSite -Limit all | where {$_.Id -eq "337c5721-5050-46ce-b112-083ac52f7f26"}
$web = $site | Get-SPWeb -Limit all | where {$_.Id -eq "2ae0de59-a008-4244-aa66-d8f76c79f1ad"}
$web.Url
The HostId property is the GUID of the object containing the event receiver. The HostType is the object type – in this case, HostType “2” means the event receiver host is a list. You can look at the other host types by checking this article on MSDN: http://msdn.microsoft.com/en-us/library/ee394866(v=prot.13).aspx.
Now we know the GUID refers to a list, we can get it using PowerShell with this command:
$list = $web.Lists | where {$_.Id -eq "09308020-45a8-41e4-bbc0-7c8d8cd54132"}
To remove the list completely, type the following command:
$list.Delete()
To keep the list intact and just remove the offending event receiver, copy the Id property from the Run-SQLQuery output into this command:
$er = $list.EventReceivers | where {$_.Id -eq "657a472f-e51d-428c-ab98-502358d87612"}
$er.Delete()
If you do decide to delete the list completely, ensure you also remove it from the site Recycle Bin and Site Collection Recycle Bin to ensure the file is removed from the content database. If not, the error may not disappear from the Health Analyzer or Test-SPContentDatabase operation.

http://get-spscripts.com/2011/08/diagnose-missingwebpart-and.html

Removing features from a content database in SharePoint 2010 using PowerShell

The great thing about the Health Analyzer in SharePoint 2010 is that it will report on a number of potential issues with the server farm, which may cause a problem later whilst applying a cumulative update or service pack. Resolving these issues in advance will help to prevent an update failing when you run the SharePoint Configuration Wizard.
One of these problems may occur when a solution is removed from the farm before the corresponding features were deactivated from site collections and sites. The Health Analyzer will place this issue in the “Configuration” category with the title “Missing server side dependencies”.
Missing server side dependencies
The error message reported will look similar to this one:
[MissingFeature] Database [SharePoint_Content_Portal] has reference(s) to a missing feature: Id = [8096285f-1463-42c7-82b7-f745e5bacf29], Name = [My Feature], Description = [], Install Location = [Test-MyFeature]. The feature with Id 8096285f-1463-42c7-82b7-f745e5bacf29 is referenced in the database [SharePoint_Content_Portal], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary.
As shown above, this message reports a content database name (SharePoint_Content_Portal) and feature ID (8096285f-1463-42c7-82b7-f745e5bacf29), but not the sites or site collections where the feature exists. In addition to this, even if you did know where the feature was activated, it will not appear anywhere in the UI for you to deactivate because the solution has been removed from the farm.
The following PowerShell script will interrogate a specified content database and feature ID and do two things:
  1. Produce a report in the PowerShell console showing which sites or site collections contain the offending feature.
  2. Forcibly deactivate the feature from the applicable sites or site collections.
Note: Whilst this article applies specifically to the scenario of deactivating features from removed solutions reported by the Health Analyzer, I have decided to write the script so that it deactivates any specified feature from sites and site collections – not just those missing from the farm. This allows the script to be used in other scenarios, too.
To use the script, run these functions in a PowerShell console with the SharePoint 2010 add-ons loaded:
function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly)
{
    $db = Get-SPDatabase | where { $_.Name -eq $ContentDb }
    [bool]$report = $false
    if ($ReportOnly) { $report = $true }
   
    $db.Sites | ForEach-Object {
       
        Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report
               
        $_ | Get-SPWeb -Limit all | ForEach-Object {
           
            Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report
        }
    }
}
function Remove-SPFeature($obj, $objName, $featId, [bool]$report)
{
    $feature = $obj.Features[$featId]
   
    if ($feature -ne $null) {
        if ($report) {
            write-host "Feature found in" $objName ":" $obj.Url -foregroundcolor Red
        }
        else
        {
            try {
                $obj.Features.Remove($feature.DefinitionId, $true)
                write-host "Feature successfully removed from" $objName ":" $obj.Url -foregroundcolor Red
            }
            catch {
                write-host "There has been an error trying to remove the feature:" $_
            }
        }
    }
    else {
        #write-host "Feature ID specified does not exist in" $objName ":" $obj.Url
    }
}
You now have two options for using these functions. If you just want to produce a report in the console showing which sites and site collections contain the feature, type the following (note the ReportOnly switch on the end):
Remove-SPFeatureFromContentDB -ContentDB "SharePoint_Content_Portal" -FeatureId "8096285f-1463-42c7-82b7-f745e5bacf29" –ReportOnly
This command will step through all sites and site collections and display the following message whenever it finds the feature specified:
Feature found in site : http://portal/site
If you want to go ahead and remove the feature from all sites and site collections in the content database, type the same command without the ReportOnly switch on the end:
Remove-SPFeatureFromContentDB -ContentDB "SharePoint_Content_Portal" -FeatureId "8096285f-1463-42c7-82b7-f745e5bacf29"
Running this command will step through all sites and site collections, remove the feature specified, and display the following output:
Feature successfully removed from site : http://portal/site
You should now be able to reanalyse the “Missing server side dependencies” issue in the Health Analyzer to clear the problem (providing there are no other issues reported under that title, of course!).
http://get-spscripts.com/2011/06/removing-features-from-content-database.html.

7 Aug 2012

Permissions to make User Profile Synchronization "Start"?

http://social.technet.microsoft.com/Forums/en-AU/sharepoint2010setup/thread/aa36b4a1-6d06-45af-9d31-612ef69855f9

http://www.harbar.net/articles/sp2010ups2.aspx#ups14

http://blogs.msdn.com/b/opal/archive/2009/11/19/user-profile-sync-setup-in-sharepoint-server-2010-beta.aspx

SharePoint displays users as Domain\Username instead of Display Name

Login to sharepoint by farm account and launch powershell
1. If the problem only appears with a single user, you can update a single account like so:

Set-SPUser -Identity ‘domain\Username’ –Web http:// –SyncFromAD

2. If all (or a lot) of the uesrs you can do it by the following:

Get-SPUser –Web http:// | Set-SPUser –SyncFromADS

13 Jul 2012

Configure SQL Server 2008 for Sharepoint 2010 and Project Server 2010 installation

Configure SQL Network Settings for SQL Server 2008
To configure the network settings for SQL Server 2008 complete the following steps:
1. From the computer console click the Start button  >> All Programs  >> Microsoft SQL Server 2008 2.  2. Expand Configuration Tools and select SQL Server Configuration
The system displays the SQL Server Configuration Manager.
3. In the left pane, expand SQL Server Network Configuration, and then select the target SQL Server instance for your Project Server databases.
4. Verify that the TCP/IP option is enabled in the right frame.

Add a SQL Server Login for the Farm Administrator Account
 Project Server 2010 requires that the Farm Administrator Role Account have a SQL Server login with public, dbcerator, securityadmin and sysadmin roles in SQL Server. To create a SQL Server login and add the roles for the login, complete the following steps:
1.       Open SQL Server Management Studio.
2.         Connect to the database engine for your Project Server 2010 target instance
3.         Expand the Security node, then right-click on Logins and select the New Login option



4. The system displays the New Login dialog
5. Enter the domain account you created for the Farm Administrator in the Login Name field. From the Select a page list on the left, select Server Roles.

6. In the Server roles list, select the dbcreator, securityadmin, and sysadmin check boxes. The public roles checkbox is selected by default. Leave this setting selected.
7. Click the OK button to continue.


Enable the Common Language Runtime 
Enabling the Common Language Runtime (CLR) for SQL Server improves Project Server 2010 performance by 30% on average, according to Microsoft. To enable the common language runtime, click on the New Query button in the SQL Server Management Studio window and copy the following query into the SQL Query pane

sp_configure ‘clr enabled’, 1; 
go 
reconfigure; 
go





Click the Execute button to execute the query and enable the CLR. After executing the query the output section should report a success message like the one shown in Code Sample below. Note that the Query includes the RECONFIGURE statement, and it is not necessary to run this again.  

Configuration option 'clr enabled' changed from 0 to 1. Run the RECONFIGURE statement to install.  

Set SQL Server Database Collation 
Your SQL Server collation must be configured for case-insensitive. In a default English language version, the default collation (SQL_Latin1_General_CP1_CI_AS) is compliant with this requirement. If you are not working with a default English SQL Server installation, you may need to change your SQL Server database collation to case-insensitive, accent-sensitive, Kana-sensitive, and width-sensitive.

Prepare SQL Server Analysis Services for Project Server
You must complete two simple configuration steps to prepare your instance of SQL Server Analysis Services for Project Server 2010:
1) Add the Farm Administrator Role account to the OLAP Users Local Group on the server, and
2) Configure the Farm Administrator Role account permissions in SQL Server Analysis services. To add the Farm Administrator account to the OLAP Users Local Group, complete the following steps:  1. Log in to the computer running Analysis Services and select
Administrative Tools from the Start menu and select Computer Management from the submenu.
2. On the Computer Management page, in the left pane under System Tools, expand the Local Users and Groups item. Click to expand the Groups folder and locate the OLAP Users Local Group for your Analysis Services instance as shown for SQL Analysis Services 2008
3. Double-click on the group name to open the group Properties dialog

4. In the Properties dialog, click the Add button. The system displays the Select Users, Computers, or Groups dialog
5. In the Select Users, Computers, or Groups dialog, enter the name of your Farm Administrator account. You may click the Check Names button to verify your entry, or click the OK button to accept your entry. The account now appears in the Members section of the Group Properties dialog shown previously. Click the OK button to close the Group Properties dialog and then close the Computer Management page to continue.

To add the Farm Administrator as an Analysis Services server administrator complete the following steps: 
1. Open SQL Server Management Studio. In the Connect to Server window, select or browse to connect to the SQL Server Analysis Services instance for your Project Sever 2010 deployment.
2. In Microsoft SQL Server Management Studio Object Explorer, right-click on your SQL Server 2005 Analysis Services instance name, and then click Properties from the pop-up menu. The system displays the Analysis Services Properties dialog. From the Select a page pane, click the Security item. Your Analysis Server Properties dialog should look like the
3. Click the Add button. The system displays the Select Users or Groups dialog
4. On the Select Users or Groups dialog, type the name of the Farm Administrator account.
5. Click the OK button to add the Farm Administrator account to the Server Administrators list
6. Click the OK button on the Analysis Server Properties page to exit the operation.

20 Dec 2011

Extend 10MB limitation of sharepoint template file

Extend template file size to 50MB

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 5000000

Operation completed successfully.

16 Nov 2010

How to Hide “Open in Windows Explorer” option from List or Document Library in SharePoint 2007

Recently someone on one of the forums ran into some issue and he wanted to hide the “Open in Windows Explorer” option from the Actions menu in a document library.
So here’s how you can hide the “Open in Windows Explorer” option from the Actions menu.
Note: After successfully completing all the steps mentioned below only Site Owners will be able to see the “Open with Windows Explorer” option.



1. Make a copy of the DefaultTemplate.ascx located in the X:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\.
2. Rename the copy to CustomDefaultTemplate.ascx

3.  Open the CustomDefaultTemplate.ascx in any text editor and Find the line ID=”OpenInExplorer “ (usually line 1812 ).

4. Change PermissionsString=”UseClientIntegration to PermissionsString=”ManageWeb and save the file.

5. Do an IISRESET
6. Now if any user, other than the Site Owner Logins into the SharePoint Site they will not be able to see the “Open with Windows Explorer” option.





http://thecommunicator.co.cc/2010/04/25/how-to-hide-%E2%80%9Copen-in-windows-explorer%E2%80%9D-option-from-list-or-document-library-in-sharepoint-2007/


http://slingeronline.wordpress.com/2008/02/11/hiding-open-with-windows-explorer-from-the-actions-menu/

Remove the Explorer View from a Document Library Template


If you are building a custom document library solution, there may be a time where you don't want users to use the Explorer View of the document library.  I am talking about the VIEW itself and not the Open with Windows Explorer action in this case.  The correct way to do is of course is to create your own custom document library template (I'll be covering that in a future post) and then modify the schema.xml file.  If you want to go crazy and unsupported, you can also modify the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\DocumentLibrary\DocLib\schema.xml of the built-in DocumentLibrary feature and accomplish the same result for the out-out-the-box document library.  Removing it is just a matter of removing the appropriate View element in the schema.xml file.  In this case, you are looking for an element similar to the one below.

<View BaseViewID="3" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,Explorer_View;" Url="Forms/WebFldr.aspx" SetupPath="pages\webfldr.aspx" RequiresClientIntegration="TRUE" ReadOnly="TRUE">

It will have a BaseViewId of 3 and a Display Name indicating that it is the explorer view.  Just delete this entire View element and reactivate the feature and this view will not be present on any new document libraries you create.  Again, I recommend creating your own document library template instead of modifying the built-in one.

It will only remove it on new document libraries created.  Any existing ones you would have to remove manually from each library.



http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/05/29/how-to-remove-the-explorer-view-from-a-document-library-template.aspx

15 Oct 2010

Move WSS3.0 from one to another server

Move WSS3.0 from one to another server

Configuration:

Source: SQL 2000 Std Server SP4+Win 2003 Server SP+WSS3.0
Destination: SQL 2005 Std Server+Win 2003 Server SP2 +WSS3.0

STEP1: BACKUP:

1. On Source SQL Server: Backup SharePoint Content databases.
  • Open SQL Server Enterprise manger
  • Right Click a database (For ex: WSS_Content)->All Tasks->;Backup Database->Database Complete->Backup to disk->Add->Filename->Provide a path &; filename->Ok->Ok
  • Repeat above procedure for all SharePoint databases (Sharepoint_AdminContent_xxx, Sharepoint_Config) however we will not restore all of them.
  • (Do not restore database Sharepoint_AdminContent_xxx, Sharepoint_Config on new SQL Server)

How to find name of Content databases:
Central Admin->Application Management->Content databases->Select web application from Right Hand Side Top drop down list. Database name will be displayed

-------------

2. On SharePoint Server: Take screenshots of all configured setting on Central administration page

  • Central Admin->Operations->Global Configuration->Alternate access mappings
  • Central Admin->Operations->Outgoing email settings
  • Central admin->Application management->Define managed paths
  • etc.

--------------

STEP 2: PREPARE DESTINATION SQL SERVER
  • We must install either same or later version than source SQL Server
  • Open SQL Server Enterprise manger
  • Security->Logins->Right Click->New Login
  • Add SharePoint Service Account in Domain\user format
  • This account must be either Domain admin or Domain user with Local admin rights on SharePoint server.
  • Security->Logins->Right Click Service Account->Properties->Server Roles Tab
  • Check Security Administrators & Database Creators
  • Click Ok

STEP 3: RESTORE CONTENT DATABASE TO DESTINATION SERVER
  • Copy backup Content database files to Destination SQL Server
  • Open SQL Server Enterprise manger
  • Databases->Right Click->All Tasks->Restore database->Restore as Database->Type name of Content Database->From device->Select device->disk->Add->Browse to backup files->Ok->Ok
  • Similarly restore all Content databases from backup
  • Security->Logins->Service Account->Database Access Tab->In upper pane select Content database->In lower pane check DB_OWNER checkbox->Click Ok
Pls noted that the restore process may take hours to complete depends on database size and how powerful your SQL server is. Mine is Proliant ML370G5 Quad Core Xeon, 4GB RAM takes 4 hours to restore 10GB database :-(

    STEP 4: INSTALL WSS ON NEW SERVER
    Install WSS3.0 on new server

    STEP 5: CONNECT TO NEW SQL SERVER
    • Run SharePoint Products and Technologies Configuration (PSCONFIG ) Wizard
    • Select No, I want to create a new server farm

    • Database Server: Give Destination SQL Server name (same sql server name or instance as in step 2)
    • Database Name: Type new Config Database Name
    • Username: Use same Service account as used in existing old server
    • Password: Password for that account

    • We should get configuration successful message.
    • After PSCONFIG finishes successfully Central admin page will open automatically.

    STEP 6: RESTORING SITES FROM DATABASES

    Create a new web application http://app on port 80 with content database name WSS_Content_TEST
    • Go to V3 Central Administration Page->Application Management->Create or extend Web Application
    • Click on Create a new web application
    • Choose any unused port number
    • Enter Database Server Name and enter Database name as WSS_Content_TEST
    • Wait for operation to complete
    • After application is created create a site collection
    • Fill the details and select Team site template click Ok
    • Browse to test site http://app
    • Check if it is working

    To remove dummy_content_db (WSS_Content_TEST) from a web application

    • Click on Content Databases
    • On right hand side select the newly created web application if not already present
    • Click on Database name WSS_Content_TEST
    • Check remove content database checkbox and click OK

    To attach restored content database to a new web application:
    • Go to V3 Central Administration Page->Application Management->Sharepoint Web Application management->Content Databases->Add a content database->Enter database server and database name (WSS_Content)-> Click OK


    Now browse to http://app and check if it is working
    Similarly add content databases for other web applications.


    NOTE:
    =====
    Do NOT discard Source SQL Server and Databases until the functionality of New SQL Server and WSS3.0 is tested and confirmed.

    Total Pageviews