SharePoint 2010 Configuration Database has a huge LOG File size problem.

You detected that SharePoint 2010 configuration database has a big LOG file size and you have  a low disk space problem.

This is happening because SharePoint Configuration Database are set to full recovery mode by default. Full recovery mode does not auto shrink / truncate the log files on a full backup. In this mode System Admins are responsible to maintaining getting Transactional Log Backups and Shrinking Log files. If Simple recovery mode is selected when you get a full backup the log files will be shrinked. But Microsoft does not recommend changing to simple recovery mode in a production environment.

You can check the Recovery mode by using SQL Server Management Studio (SSMS) by selecting “SharePoint Config” database (Right Click)-> Properties -> Options.

Full recovery mode allows the SQL admins to backup the transcation logs incrementally, simple recovery mode does not allow this and only allows full or differential backups, no transaction log backups. And Full Recorvery mode has provide you to recovery at specific time manner.

For more information about SQL Server Recovery Models
http://msdn.microsoft.com/en-us/library/ms189275.aspx

SharePoint Configuration Database is the heart of a SharePoint farm and according to size of farm lots of transactions happens.Especially every Timer Job run can cause high transactions on SharePoint Configuration Database. And There are nothing to prevent or reduce this logs rate by making any changes on SharePoint Side.

So for production enviroments SQL Admin should make a recovery and maintenance plans for preventing unnecessary growth of log files. It should be done by getting frequently Transactional Log backups and shrinking transaction log files.

The frequency has changed  system by system. It could be done 30 min to 1 day frequency, according to your transaction log growth.To prevent this kind of problem, make automize or manuelly get your Transactional backups and shrink the log files for a defined period.

For Backup Transaction Log Please check fallowing artcile:
http://msdn.microsoft.com/en-us/library/ms179478.aspx

For Shrink Transaction Log file:
http://msdn.microsoft.com/en-us/library/ms190757.aspx

SharePoint 2010 and Lync Integration different email address problem.

You wish to implement a custom webpart for SharePoint that integrates with OCS(Lync) to display user information such as presence
You’ve developed a custom code or webpart that using the javascript described here
http://blogs.msdn.com/b/uksharepoint/archive/2010/05/07/office-communicator-integration-presence-in-a-custom-webpart-for-sharepoint-2010.aspx
But you have faced that presence/pawn information look incorrect. Email adress are different. Like real  bugra@sip.blog.bugrapostaci.com shown instead of real email address of bugra@blog.bugrapostaci.com .

So this is a bydesign issue. Let explain how it is working:

Inside SharePoint we have a javascript library that resposible to show “presence” information named “INIT.JS” . It is a localized javascript file you can find this file
in SharePoint hive C:\program files\common files\microsoft shared\web  server extentions\14\TEMPLATE\Layouts\<your LCID code>\INIT.JS 
If you examine inside that code you will find that we are using an Office ActiveX control named NameCtrl . At the background the assembly of C:\Program Files\Microsoft Office\Office14\Name.dll which is loaded by browsers when you install office.
This ActiveX has responsible for communication and gather “Presence” information.
Users must have Office 2010, Office 2007, or Microsoft Office 2003 with the latest service pack installed to view extended presence information on a SharePoint Server page.
To display the presence indicator and its associated contact card (in Office 2010) or menu (in Office 2007 and Office 2003), SharePoint uses the Microsoft ActiveX control name.dll. The ActiveX control makes calls directly to the Microsoft Lync 2010 API, and then Lync makes MAPI or Exchange calls to supply the requested information.” http://technet.microsoft.com/en-us/library/gg398806.aspx

Presence is enabled in SharePoint by default; there are no configuration steps for the SharePoint administrator to perform. Each SharePoint page includes Microsoft JScript® code, which enables presence for that site. JScript uses name.dll to call the Lync API and pull presence for users names who appear on the site. JScript uses the users’ SIP URI to pull presence for names that are listed on the site. The following JScript code is an example of presence being pulled for a user named Bob Kelly, whose SIP URI is bobkelly@contoso.net. The SIP URI is added by using variables to the JScript when the script is loaded and presence is being pulled.

<a href=’jscript:;’ onclick=’IMNImageOnClick(event);return false;’ class=’ms-imnlink’><img name=’imnmark’ class=’ms-imnImg’ title=” border=’0′ height=’12’ width=’12’ src=’/_layouts/images/blank.gif’ alt=’No presence information’ sip=’bobkelly@contoso.net’ id=’imn_74,type=smtp’/></a><a onclick=”GoToLink(this);return false;” </a>

Please Check Resource Kit Book: SharePoint Integration
http://go.microsoft.com/fwlink/?LinkId=210991

it is not only bordered by SharePoint. You can easely develop a small ASP.Net application and can able to show Presence information.
Look for belowed code.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestIM._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">

var sipUri = "bugra@blog.bugrapostaci.com";
var nameCtrl = new ActiveXObject('Name.NameCtrl.1');
if (nameCtrl.PresenceEnabled)
{
  nameCtrl.OnStatusChange = onStatusChange;
  nameCtrl.GetStatus(sipUri, "1");
}

function onStatusChange(name, status, id)
{ 
   alert(name + ", " + status + ", " + id);
}
function ShowOOUI()
{
   nameCtrl.ShowOOUI(sipUri, 0, 15, 15);
}
function HideOOUI()
{
   nameCtrl.HideOOUI();
}
</script>
</head>
<body>
 <form id="form1" runat="server">
   <div>
    <span onmouseover="ShowOOUI()" onmouseout="HideOOUI()" style="border-style:solid">Here is the contact info</span>
   </div>
 </form>
</body>
</html>

Also within the blog mentioned in the issue description http://blogs.msdn.com/b/uksharepoint/archive/2010/05/07/office-communicator-integration-presence-in-a-custom-webpart-for-sharepoint-2010.aspx

The key piece of information to make the presence work is the user’s SIP Address which is basically their IM address (This is not always the same as email address). When a users is either added to a site in SharePoint or has their profile imported, the SIP Address will be drawn from Active Directory which is where OCS stores it and placed into the SIP address field in either the user’s profile which will in turn synchronise down to the site’s local ‘User Information’ page.”

The problem is if your SIP address and default email address are different that you will see sip address on presence information by design:
So you can do:

1. To be sure for preventing other problems by Installing latest office pathces. For Today it is SP1 for Office 2010 + the hotfix 2553112 2553112 Description of the Office 2010 hotfix package (name-x-none.msp): August 30, 2011 http://support.microsoft.com/kb/2553112/EN-US

2. If a user’s SIP proxy address and the user’s default e-mail address are different the presence information cannot be shown.Make sure the user’s SIP proxy address and the user’s default e-mail address are the same.Make them same.
http://support.microsoft.com/kb/2006610

Next Cumulative Update (August 2012) can only be install with SP1 installed farms/server.

If you don’t install SP1 on your SharePoint 2010 farm yet ,  Please read the fallowing post
http://blogs.technet.com/b/stefan_gossner/archive/2012/07/11/is-sp1-installed-on-your-sharepoint-2010-farm.aspx

After restoring SharePoint profile databases some of users pictures are not shown.

Ok this is a very specific issue and it could happen rarely. So the problem is somehow your SharePoint User Profile Application (UPA) has corrupted and you had to restore an old database back and see that some of user pictures are not shown. While you check the Photo Store (MySite->User Photos->Profile Pictures) all users pictures are present but when you check one of the problematic user’s profile from UPA the pictureURL attribute is not set. You can mannually fix it by using UPA Manage User Profile page but what happen if you have hundreds of users.

So fixing this issue.

1)      Copy the fallowing script in to your c: drive and save the file name as  “UpdateMissingPictures.ps1

2)      Check the picture folder name in Mysite-> User Photos library because it is diffrent depend on installed language.For example in Turkish it is “Profil Resimleri” not “Profile Pictures.Change the bold field belowed script and correct according to your envoriment.

3)      Run SharePoint PowerShell Consol.

4)      For confirming and detecting which profile pictures link are broken run script with fallowing parameters.

5)      C:\> .\UpdateMissingPictures.ps1  <MYSITE Sitesi root url>  | out-file c:\results.txt
Example:
.\UpdateMissingPictures.ps1  http://mysite.bugrapostaci.com:4444  | out-file c:\results.txt
(With this paremeters the script can not change anything (yet 🙂 )

6)     If you see open the  Results.txt file you can find information listed as
i) No change needed profiles as
OK!
DOMAIN\User URL
ii) Profile picture broken Link accounts
Updatable !!! DOMAIN\User
iii) Profile picture is never exists ones:
            Missing !!! DOMAIN\User

7)   This script can able to updates only marked accounts as “Updatable” . For fixing picture url run script like:

C:\> .\UpdateMissingPictures.ps1  <MYSITE Sitesi root url>  -Update | out-file c:\results.txt
example:
.\UpdateMissingPictures.ps1  http://mysite.bugrapostaci.com:4444  -Update| out-file c:\results.txt

8)    What about the Missings !!! The missing ones should be uploaded by manually or used another script for Upload profile pictures by bulk upload.
This is out of our article’s scope.

9)     You can check the  Results.txt file and confirm that  Updated !!! profiles .

If everything is ok The missing user pictures will shown after refreshing caches.
For Search  you have to run a full crawl.

Here is the Script:

Param (
[parameter(Mandatory=$true)][string]$MySiteUrl, 
 [parameter(Mandatory=$false)][Switch]$Update
)

$mySiteHostSite = Get-SPSite $MySiteUrl
$mySiteHostWeb = $mySiteHostSite.OpenWeb()
$context = Get-SPServiceContext $mySiteHostSite
$spPhotosFolder = $mySiteHostWeb.GetFolder("User Photos")

$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

$AllProfiles = $ProfileManager.GetEnumerator()

foreach($profile in $AllProfiles)
{
$AccountName= $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::AccountName].Value
   if($profile["PictureURL"].Value -eq $null -or $profile["PictureURL"].Value -eq $null )
{
  $checkUrl =$spPhotosFolder.url +"/" + "Profile Pictures" + "/" + $AccountName.Replace("\","_") + "_MThumb.jpg"

  if($mySiteHostWeb.GetFile($checkURL).Exists)
  {
   if($Update)
   { 
    $profile["PictureURL"].Value = $mySiteHostWeb.Url + "/" + $checkurl
    $profile.Commit()
    "Updated!!! " + $AccountName  
    $mySiteHostWeb.Url + "/" + $checkurl
   }
   else
   {
    "Updatable!!! " + $AccountName 
   }
 }
  else
  {
   "Missing !!! " + $AccountName 
  }
}
else
{
  "OK! " + $AccountName + " " + $profile["PictureURL"].Value
}
}

$mySiteHostWeb.Dispose()
$mySiteHostSite.Dispose()

CBA FBA wilt LDAP problem when using connection between SUN LDAP 5.2

If you have a problem with between SPS2010 and CBA FBA with LDAP problem when using connection with SUN LDAP 5.2 (our  build 2007.093.1546)
You may getting fallowing error.
System.Runtime.InteropServices.COMException (0x80005000): Unknown error (0x80005000)     at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)     at System.DirectoryServices.DirectoryEntry.Bind()     at System.DirectoryServices.DirectoryEntry.get_AdsObject()     at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)     at System.DirectoryServices.DirectorySearcher.FindOne()     at Microsoft.Office.Server.Security.LDAP.FindOneObject(DirectoryEntry searchRoot, String filter, SearchScope scope, String[] propertiesToLoad, ResultPropertyCollection& entryProperties)     at Microsoft.Office.Server.Security.LdapMembershipProvider.GetUserAttributeBySearchProperty(String searchValue, String searchProperty, String returnAttribute)
04/10/2012 17:52:51.57  w3wp.exe (0x2420)                        0x3F18 SharePoint Foundation          Claims Authentication          0000 Unexpected Password check on ‘<USER>‘generated exception: ‘System.ServiceModel.FaultException`1[Microsoft.IdentityModel.Tokens.FailedAuthenticationException]: The security token username and password could not be validated. (Fault Detail is equal to Microsoft.IdentityModel.Tokens.FailedAuthenticationException: The security token username and password could not be validated.).’.
04/10/2012 17:52:51.61  w3wp.exe (0x2420)                        0x3F18 SharePoint Foundation          Claims Authentication          fo1t Monitorable SPSecurityTokenService.Issue() failed: System.ServiceModel.FaultException`1[Microsoft.IdentityModel.Tokens.FailedAuthenticationException]: The security token username and password could not be validated. (Fault Detail is equal to Microsoft.IdentityModel.Tokens.FailedAuthenticationException: The security token username and password could not be validated.).

For fixing the issue you may change your web.config files below and watch out for highlighted attributes and correct them according your envoriment.

1. In the web.config of the different part CA, Web App and STS you have:

<membership>       <providers>
<add name=”LdapConnection” type=”Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”
server=”Your Server IP” port=”389″ useSSL=”false”
useDNAttribute=”false”
userNameAttribute=”uid”
userContainer=”ou=MyCustomOu,o=contoso,dc=contoso,dc=ldap
userObjectClass=”Inetorgperson”
userFilter=”(ObjectClass=Inetorgperson)”
scope=”Subtree”
otherRequiredUserAttributes=”sn,givenname,cn”
connectionUsername=”uid=postman22,ou=MyCustomOu,o=contoso,dc=contoso,dc=ldap
connectionPassword=”blog.bugrapostaci.com” />
</providers>     </membership>

3. After those changes you have been able to logon in the site collection using FBA.

For SUN LDAP 5.2
useDNAttribute should set to false and userNameAttribute must be uid
connectionUsername
attribute defines that which user account be used in binding . ( Thats not  prevents to other users logins.They can login sharepoint with their passwords)
important issue here defining the connectionUsername attribute like “uid:postman22” is not enough you may need to add full path like “uid=postman22,ou=MyCustomOu,o=contoso,dc=contoso,dc=ldap