Thursday, February 28, 2013

BlobCache Script


Hi,

In SharePoint 2010,we have facility to manage the SharePoint Cache through BlobCache script.

So I am posting the Blob Cache script as below

# Enable-SPBlobCache Function
function Enable-SPBlobCache {
param(
                [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]
                [Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]
                $WebApplication,
                [Parameter(Mandatory=$false, ValueFromPipeline=$true, Position=1)]
                $BlobCacheLocation="E:\BlobCache"
)

process {
    $WebApp = $WebApplication.Read()
    # SPWebConfigModification to enable BlobCache
    $configMod1 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification
    $configMod1.Path = "configuration/SharePoint/BlobCache"
    $configMod1.Name = "enabled"
    $configMod1.Sequence = 0
    $configMod1.Owner = "BlobCacheMod"
    ## SPWebConfigModificationType.EnsureChildNode -> 0
    ## SPWebConfigModificationType.EnsureAttribute -> 1
    ## SPWebConfigModificationType.EnsureSection -> 2
    $configMod1.Type = 1
    $configMod1.Value = "true"
                                
    ######################################################################
               
                # SPWebConfigModification to enable client-side Blob caching (max-age)
    $configMod2 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification
    $configMod2.Path = "configuration/SharePoint/BlobCache"
    $configMod2.Name = "max-age"
    $configMod2.Sequence = 0
    $configMod2.Owner = "BlobCacheMod"
    ## SPWebConfigModificationType.EnsureChildNode -> 0
    ## SPWebConfigModificationType.EnsureAttribute -> 1
    ## SPWebConfigModificationType.EnsureSection -> 2
    $configMod2.Type = 1
    $configMod2.Value = "86400"
               
                ######################################################################
               
                # SPWebConfigModification to change the default location for the Blob Cache files
                $configMod3 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification
                $configMod3.Path = "configuration/SharePoint/BlobCache"
                $configMod3.Name = "location"
                $configMod3.Sequence = "0"
                $configMod3.Owner = "BlobCacheMod"
                ## SPWebConfigModificationType.EnsureChildNode -> 0
    ## SPWebConfigModificationType.EnsureAttribute -> 1
    ## SPWebConfigModificationType.EnsureSection -> 2
                $configMod3.Type = 1
                $configMod3.Value = $BlobCacheLocation
    # Add mods, update, and apply
    $WebApp.WebConfigModifications.Add( $configMod1 )
    $WebApp.WebConfigModifications.Add( $configMod2 )
                $WebApp.WebConfigModifications.Add( $configMod3 )
    $WebApp.Update()
    $WebApp.Parent.ApplyWebConfigModifications()
}
}

Monday, February 18, 2013

Central Admin Load Balance Procedure


Step 1: AAM Configuration:

·         Login to APP1 server

·         Launch Central admin > Alternate Access Mappings (AAM)

·         Change AAM collection to Central Administration and Click on “Edit Public URLs”
Change the Public URLs as

Default: (Central Admin URL of APP1 server)

Intranet: (Central Admin URL of APP2 server)

Internet: (Central Admin URL of APP3 server)
Custom: (NLB URL)

If applicable:
Extranet: (Central Admin URL of APP4 server)


Click save once modified.
Step 2: IIS Binding Configuration:

·         Login to APP 1 server
·         Open IIS:  Start > Run > Inetmgr
·         Click on Central Administration Site
·         Click on Bindings under Edit Site in Right pane


In Site Bindings, Click Add to make a new Binding settings

·         Under IP address: Give the LB member IP (*.*.12.*) of APP 1 server (refer Emerald NLB – SharePoint HCL excel sheet for LB member IP)
·         Under Port give 80
·         Under Host name give Central Admin NLB URL
·         Click Ok and Close Site Bindings
Step 3: Registry Modification

Backup Registry

·         Start > Run > Regedit
·         Goto:  HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS
·         Right Click on WSS > Export and save the file.
Central Admin URL Modification:

·         Click on WSS, on right pane edit CentralAdminstrationURL and replace existing APP1 URL with NLB URL
·         Click Ok
·         Close Registry
·         Backup WSS Registry

Repeat Step 2 and Step 3 in all other Application servers that host Central Admin.

Repeat only Step 3 on all WFE servers


Verification 1:

·         Launch Central Admin from Short Cut from Start menu
·         Verify in all WFE and Application servers
Verification 2:

·         Open Internet Explorer and browse with actual Central Admin URL.
·         Verify in all Application servers with respective URL.
While configuring CA Load Balancer, have the default zone with NLB URL itself. Please refer below. This will help to ignore registry changes (step 3) above.











Sunday, February 17, 2013

People Directory Import Job


Hi,

Below is the People Directory Import Job that has been executed
Ensure the share folder is created and have access with respect to your farm as below

\\ServerName\PeopleDirectoryFeed

This file has all the required inputs to run the People Directory Import job. This file resides in 14 hives\Template\Xml.

<FileLocation>\\servername\PeopleDirectoryFeed\</FileLocation>
    <ErrorFileLocation>\\ servername \PeopleDirectoryFeed\ErrorLogs\</ErrorFileLocation>
    <ArchiveLocation>\\ servername \PeopleDirectoryFeed\Archive\</ArchiveLocation>
    <WebAppURL>http://servername:portno/</WebAppURL>

When a file is made available after the scheduled time, the User Profile will not be updated with People Directory data till the next day.
Solution
Navigate to Central Administration-> Monitoring->Review Job Definitions. Click on People Directory Import job.
Click on Run Now as below.


Tuesday, February 12, 2013

Edit My Profile was not working


Hi,

In the SharePoint 2010 site, after clicking on ‘My Site’ which would be right corner it directs to my site of that user.
After clicking My Profile->Edit my profile hyperlink, generally user will be able to edit his account name, upload his picture.

But in our case, it was not happening like that i.e. it was just going to My Site home page after clicking ‘Edit my profile’.

It was redirecting to

instead of

After doing RnD, finally our Technology Lead has found the solution i.e.

Default.aspx was added in the suffix of My Site Host Location and hence it was not redirecting properly

After doing this,user was able to edit the profile as below

No Warning message after adding All Authenticated Users


Hi,

After launching the site collection, if we go to Site Actions->Site Permissions, add All Authenticated Users as a visitor.
Generally warning message to be displayed. But it was not getting displayed. Finally our teammate has found the fix as below

Basically we took existing ENTITYEDITOR.js the below path and written below script under updateControlValue
Path : C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
//Fix

if(ChkModalDlg != -1) {

    var txtVal = document.getElementById(a).innerText.toLowerCase();
    if (txtVal.indexOf('<span') > -1) {
        txtVal = txtVal.substring(0, txtVal.indexOf('<span'));
    }
    if (txtVal.indexOf('all authenticated users') > -1) {
        if (AllAuthenticatedUserCheck != 1) {
           
            AllAuthenticatedUserCheck = 1;      
alert('Warning - Adding \"All Authenticated Users\" directly into the site can present a security risk by unintentionally allowing access to external groups and 3rd parties.  Use the \"User Provisioning Process\" to request the required access and discuss with your SharePoint Business Owner.');
        }
    }
    else {

        AllAuthenticatedUserCheck = 0;
    }

}

Now take backup of the file ENTITYEDITOR.js from the following location in ALL the SharePoint servers.

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS and replace with new ENTITYEDITOR.js.

Once this is done Restart timer job in all the servers where you copied the file and then restart the servers as well.
Finally after applying the fix as above I was able to see the warning message after adding ‘All Authenticated Users’ as below