Skip to content

Update display name and email address via PowerShell

You can set username and email using this command from PowerShell

Set-SPUser -Identity ‘yourmachine\UserName’ -DisplayName ‘User Name’ -Email‘username@yourmachine.com’ -Web http://yourmachine

Advertisements

SSRS: The request failed with “HTTP status 401: Unauthorized”.

I’ve tested this solution on a server with on SharePoint 2010.

First solution

Configure the Reporting Services integration in Central Administration to use a Trusted Account rather than Windows authentication. Here’s the steps needed to accomplish that:

  1. Open Central Administration and click General Application Settings.
  2. Select Reporting Services Integration
  3.  Change the Authentication mode from Windows Authentication to Trusted Account.
  4. Enter credentials of an account that is an administrator.

 

 

Second solution

  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
  3. Right-click MSV1_0, point to New, and then click Multi-String Value.
  4. Type BackConnectionHostNames, and then press ENTER.
  5. Right-click BackConnectionHostNames, and then click Modify.
  6. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
  7. Quit Registry Editor, and then restart the server.

SSRS Export Action does not work in web pages (how to fix)

When having a Reporting Services report on a SharePoint web page the export option does not list the available options. In order to get it working, you need to configure the report viewer auto generated axd files[Reserved.ReportViewerWebControl.axd] in the IIS.

  1. Open the IIS Manager.
  2. Go to the site where you have the report .
  3. In the Features view area click “Handler Mappings”.
  4. Find the ReportViewerWebPart and double click on it
  5. Copy the Type.
  6. Click Cancel
  7. On the right side panel, select the option “Add Managed Handler”.
  8. A new window will open and add the text below
    Request Path: Reserved.ReportViewerWebControl.axd
    Type: this is the text copied on step 5
    Name: Reserved.ReportViewerWebControl.axd
  9. Click OK and do an IISReset

NOTE
For the Type on step 8 you can add this:
Microsoft.ReportingServices.SharePoint.UI.WebParts.WebPartHttpHandler, Microsoft.ReportingServices.SharePoint.UI.WebParts, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91

Create a SharePoint Web Application from a SQL database backup

To set a new environment from a database backup there are some step that are necessary to follow. The first step is restoring the SQL database backup.

  1. Verify that the user account performing this procedure is a member of the sysadmin fixed server role.
  2. If the Windows SharePoint Services Timer service is running, stop the service and wait for several minutes for any currently running stored procedures to finish. Do not restart the service until after you restore the content databases.
  3. Start SQL Server Management Studio and connect to the database server. Expand Object Explorer, right click on Databases and select Restore Database.
  4. On the Destination for restore add To database name, e.g., WSS_Content_80.
  5. On the Source for restore select From device and point to the backup file.
  6. Click on the restore check box.
  7. Click OK to complete the recovery operation..
  8. Start the Windows SharePoint Services Timer service.

The next step in the process is creating your Web Application, if you haven’t any yet, to host our Site Collections.

Note: The Web Application must be empty, with no Site Collections added, otherwise this will not work as it should!

  1. Open the Central Administration.
  2. Under Application Management, click Manage web applications.
  3. On the Web Applications tab, click New.
  4. Set the IIS Web Site Port
  5. On the Database Name and Authentication group set append the selected Port to the end of the Database Name.
  6. Select OK to initiate the creation process.
  7. Click OK.

Our new Web Application will now be listed alongside our SharePoint Central Administration V4 Web Application under Central Administration/ Application Management / Manage web applications.

Open the SharePoint 2010 Management Shell with administration privileges and execute the following command to test the content database.

  1. Execute the script:
    Test-SPContentDatabase –name [SPContentDatabase] –WebApplication http://[server]:[port]/
     [SPContentDatabase] – in this example I’ll use WSS_Content_80
  2. This is what you will see after executing the command line.You’ll see that you get an error, but this is more like a warning and does not affect anything on the site.
  3. Change the above command line to Mount-SPContentDatabase –name [SPContentDatabase] –WebApplication http://[server]:[port]/.

Note: you can have more information about Test-SPContentDatabase and Mount-SPContentDatabase here and here.

The content database was successfully attached to our Web Application and before accessing the site we only need two more steps.

  1. Go back to the Central Administration.
  2. On the left menu click Application Management.
  3. Under Service Collections group, click on Change site collection administrator.
  4. Change the Primary and Secondary Site Collection Administrator for users from your network.
  5. Click OK.

Now it is time to open your browser and you’re good to start using it.

Database is in compatibility range and upgrade is recommended

After installing a new update for SharePoint 2010, you will, and most likely, need to upgrade the databases.

In order to update the databases you have two choices:

  1. SharePoint 2010 Products Configuration Wizard (which is the easier way)
  2. Through SharePoint 2010 Management Shell

If you choose the Management Shell you need to execute the following code:

PSConfig.exe -cmd upgrade -inplace b2b -wait
or
PSConfig.exe -cmd upgrade -inplace b2b -force

 

Script to clear User Information List

A simple SharePoint PowerShell script to clear the user information list, just keep in mind that doing so, you will lose all users credentials previously set.

$url = “http://sitecollection”
$web = get-spweb $url
$list = $web.Lists["User Information List"]
$listItems = $list.Items
$listItemsTotal = $listItems.Count
for ($x=$listItemsTotal-1;$x -ge 0; $x–-)
{
Write-Host(“DELETED: ” + $listItems[$x].name)
remove-spuser $listItems[$x]["Account"] -web $url -confirm:$false
}
$web.dispose()

SharePoint publishing sites don’t appear on Google and Bing search results

I’ve been working with SharePoint 2010 since the beta release and I’ve done several SharePoint Publishing Site for many clients websites. It’s really fast to build a new website with custom look & feel, but last month I realized that SharePoint site are not indexed by Google and Bing crawlers. Because of this I’ve lost one major client because he was not happy with this SharePoint “feature”. I’ve been searching for a solution since then and I haven’t found it yet, if someone has any info about this, please reply back to me.

I’ll update this post with my findings – if I find anything! – and I’ll try to contact Microsoft to see if they have any solution for this.

One quick test you can do: try to google or bing the word ferrari. It will not return any content from the inside pages.