June 23, 2011

SharePoint: Organization browser not showing Manager when Manager is set using PowerShell

Problem:
You are using PowerShell to set value for user’s Manager and you use email address when setting the value of the UserProfile[“Manager”].Value.

Looking at user profile, the Manager property looks correct, it even resolves domain account properly.

userprofile

However, Organization browser is not showing Managers for users.

Solution:
Don’t use e-mail when setting Manager value:

$userProfile["Manager"].Value = $managerEmail

instead use manager’s account name:

$managerProfile = $profileMgr.GetUserProfile($managerEmail)   
$userProfile["Manager"].Value = $managerProfile["AccountName"]

PS. CSV file we use for importing profiles doesn’t contain AD account name, that’s why I’m using email in the first place.

SharePoint: Changing user’s Manager is not reflected to Organization browser

Problem:
You update user’s Manager in User Profile Properties, then you go to My Site and refresh Organization browser but change is not there.

Thoughts:
Running search incremental crawl didn’t help, nor running the various SharePoint jobs.

Solution:
Surprisingly solution was to recycle My Site application pool from IIS, and no other action was required.

June 16, 2011

SharePoint: SPUpgradeSession errors in ULS log every 8 hours

Problem:
SharePoint 2010 ULS logs get bunch of error messages at around 2:00, 10:00 and 18:00. If there are more than one WFE in the farm, you will probably have the error related to every WFE.

Errors look like this:

[powershell] [SPUpgradeSession] [ERROR] [6.6.2011 9:59:01]: CanUpgrade [SPConfigurationDatabase] failed.[powershell] [SPUpgradeSession] [ERROR] [6.6.2011 9:59:01]: Exception: Login failed for user 'AD\WFESERVERNAME$'.
[powershell] [SPUpgradeSession] [ERROR] [6.6.2011 9:59:01]:   
     at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)    
     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)    
     at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)    
     at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)    
     at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)    
     at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)    
     at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)    
     at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)    
     at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)    
     at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)    
     at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)    
     at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)    
     at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)    
     at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)    
     at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)    
     at System.Data.SqlClient.SqlConnection.Open()    
     at Microsoft.SharePoint.Utilities.SqlSession.OpenConnection()    
     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)    
     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, Boolean retryForDeadLock)    
     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command)    
     at Microsoft.SharePoint.Upgrade.SPDatabaseSequence.GetVersion(SPDatabase database, Guid id, Version defaultVersion, SqlSession session, SPDatabaseSequence sequence)    
     at Microsoft.SharePoint.Upgrade.SPDatabaseWssSequence.get_BuildVersion()    
     at Microsoft.SharePoint.Upgrade.SPSequence.get_CanUpgrade()    
     at Microsoft.SharePoint.Upgrade.SPUpgradeSession.CanUpgrade(Object o)
   

Workaround:
Add 'AD\WFESERVERNAME$‘ (and other WFEs if there are several) to users in SQL, but with no additional permissions (so that they’re in public role).

I will call this a workaround as I haven’t found information that would point this to be best solution mainly in terms of security. Also the actual job/task causing these errors is not yet known.