Showing posts with label SharePoint 2010;. Show all posts
Showing posts with label SharePoint 2010;. Show all posts

Wednesday, September 25, 2013

SharePoint 2010 - Object Cache: The super user account utilized by the cache is not configured.

Following error is appearing as warning on Web front ends 

Object Cache: The super user account utilized by the cache is not configured. This can increase the number of cache misses, which causes the page requests to consume unneccesary system resources.
 To configure the account use the following command 'stsadm -o setproperty -propertyname portalsuperuseraccount -propertyvalue account -url webappurl'. The account should be any account that has Full Control access to the SharePoint databases but is not an application pool account.
 Additional Data:
 Current default super user account: SHAREPOINT\system

If you think that having object caching isn't going to cause an issue with content use the following to resolve

1. Verify that you have the following administrative credentials:
To create the user accounts in Central Administration, you must be a member of the Farm Administrators group on the computer that is running the SharePoint Central Administration Web site.
2. On the Central Administration Web site, in the Application Management section, click Manage web applications.
3. Click the name of the Web application that you want to configure.
4. On the Web Applications tab, in the Policy group, click User Policy.
5. In the Policy for Web Application window, click Add Users.
6. From the Zones list, select All zones, and then click Next.
7. In the Users box, type the user name for the Portal Super User account. - domain\spsuperuser
8. Click the Check Names icon to ensure that the account name can be resolved by the authentication providers on the application server.
9. In the Choose Permissions section, check the Full Control - Has full control box.
10. Click Finish.
11. Repeat Steps 5 through 8 for the Portal Super Reader account.
12. In the Choose Permissions section, check the Full Read - Has full read-only access box. - domain\spsuperreader
13. Click Finish.
14. Make note of how the names for the Object Cache Super Reader and Object Cache Super User accounts are displayed in the User Name column. The displayed strings will be different depending on whether you are using claims authentication for the Web application.

Powershell to run 

$wa = Get-SPWebApplication -Identity "<App Identity from IIS>"
$wa.Properties["portalsuperuseraccount"] = "domain\spsuperuser"
$wa.Properties["portalsuperreaderaccount"] = "doamin\spsuperreader"

$wa.Update()

And to rollback ....

$wa = Get-SPWebApplication “http://urlofthewebapplication”
$wa.Properties.Remove("portalsuperuseraccount")
$wa.Properties.Remove("portalsuperreaderaccount")

$wa.Update()





Friday, March 2, 2012

SharePoint 2010 - Powershell Installation Script

Following is a script I used for install 2010 onto farm - really simple - installs SharePoint 2010 , goes thorough initial wizard sets up CA on port 2222, installs basic features and services and then disables loopback.
Before running update the parameters in red




# Execute setup.exe with the setupfarmsilent xml to install SharePoint
#Write-Host "Installing SharePoint 2010 Quietly"
#& ‘C:\install\sp2010i\setup.exe’ ‘/config’ ‘C:\install\config.xml’ | out-null
# Include the SharePoint cmdlets
Write-Host "Loading SharePoint 2010 PowerShell cmdlets"
Add-PsSnapin Microsoft.SharePoint.PowerShell
# Set the farm variables
Write-Host "Setting SharePoint 2010 Farm variables"
$sp_cfdatabasename = "SP2010_Config"
$sp_cadatabasename = "SP2010_Admin_Content"
$sp_databaseserver = "<add databaseserver>"
$sp_passphrase = (ConvertTo-SecureString "<add passphrase>" -AsPlainText -force)
$sp_password = (ConvertTo-SecureString "<add password>" -AsPlainText -force)
$sp_username = "<add username>"


# Clean up the credentials
$sp_credentials = New-Object System.Management.Automation.PsCredential $sp_username,$sp_password
# Execute the config wizard
Write-Host "Add configuration and administration databases"
New-SPConfigurationDatabase -DatabaseName $sp_cfdatabasename -DatabaseServer $sp_databaseserver -AdministrationContentDatabaseName $sp_cadatabasename -Passphrase $sp_passphrase -FarmCredentials $sp_credentials
# Provision a Central Administration Site
Write-Host "Add Central Administration"
New-SPCentralAdministration -Port 2222 -WindowsAuthProvider "NTLM"
# Install all of the help files within Central Admin
Write-Host "Installation of Help files"
Install-SPApplicationContent
# Secure the files and registry entries on the server 
Write-Host "Resource security"
Initialize-SPResourceSecurity
# to install the features on the server. 
Write-Host "Installation of features"
Install-SPFeature -AllExistingFeatures
# to install and and then provision the services onto the farm.
Install-SPService
# Disable the loopback check, run this command from PowerShell.
Write-Host "DisableLoopbackCheck registry key"
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck"  -value "1" -PropertyType dword
Write-Host "Installation script is complete"

Wednesday, February 22, 2012

SharePoint 2010 - DEV box increase available space by shrinking SQL data

On a 2010 development server space can become short especially with large profile imports and search indexes - one way to assist in gaining some space is to adjust a few settings on SQL Server - please note this should only be done on DEV/Test as can cause index fragmentation and therefore slow performance and also can impact backup recovery.

Follow these steps within SQL  - Firstly amend recovery mode (this reduces log files)

  1. Find the databases that are large and taking up the space - in my case this is on my my DEV server.
  2. Connect to SQL Object explorer and connect to instance
  3. Right click on the database that is large - in my case ProfileDB - click Properties and Options and ensure the Recovery mode is set to "Simple" - see screenshot



The 2nd step is too Shrink databases - this will  recover space by moving data from the end of a file to unoccupied space closer to the front of the file.

  1. Use the steps in the following link to carry out this simple task - http://msdn.microsoft.com/en-us/library/ms189035.aspx - 



Tuesday, January 31, 2012

Sharepoint 2010 Emails

Worried that lots of emails will be flooding out to all users when launched from the default emails settings in SharePoint 2010 Profiles.  Well don’t below is a script to turn off the default settings.  This is not our script but found on another site which we tested successfully.

Email Notifications:



The problems are that a new user to your organisation will still get all three options selected.  This can only be used on current profiles.

Change the value "Value = 110;"  to 1 or 0 for on or off


#Load the SharePoint snap-in
Add-PsSnapin Microsoft.SharePoint.PowerShell;
#Load the SharePoint assemblies
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Office.Server”);[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Office.Server.UserProfiles”);if (($args -ne “Enable”) -and ($args -ne “Disable”)){
Write-Output “Unrecognized Argument: $args”;
exit;
}

#Specify the MySite URL
$MySiteUrl = “<MY Site URL>“;

#Get the server context for the profile manager
$site = Get-SPSite $MySiteUrl;
$ServerContext = Get-SPServiceContext $site;
$UPManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext);

#Count variables
$ucount = 0;
$enumProfiles = $UPManager.GetEnumerator();
“Total User Profiles available:” + $UPManager.Count
$count=0;

#Loop through the profile entries and update the property
#SharePoint Notification emails – SPS-EmailOptin (int)
#This field has 3 values one for each email type

foreach ($oUser in $enumProfiles)
{
$count = $count + 1;
$u = $oUser.Item(“Accountname”);
if ($args -eq “Enable”){
Write-Output “($count): $args Setting values for $u”;
$oUser["SPS-EmailOptin"].Value = 000;
$oUser.Commit();
}
else{
Write-Output “($count): $args Setting values for $u”;
$oUser["SPS-EmailOptin"].Value = 110;
$oUser.Commit();
}
}
#Dispose of site object
$site.Dispose();