Open Pdf file from SharePoint to Client Application and not on Browser



PDF files which are stored in a Sharepoint document library open browser automatically.
Even if you configure the advanced settings in the document library for browser-enabled documents to open in the client application, but it still opens the pdf in the web browser.

To solve this issue, you can use the below steps.

1- Go to your web browser.
2- Click on Add-ons.
3- Select "All Add-ons" from dropdown.
4- Select Adobe Reader add on and Disable it.
5- Refresh the browser.
6- Try to open the pdf file it will ask to open it in client applciation.

Checked-Out dates for documents

Nice script from internet to check the "Checked-Out date" for checked out documents

# enter your site URL
Add-PSSnapin microsoft.sharepoint.powershell
$spWeb = Get-SPWeb "Enter your website URL"

function GetCheckedItems($spWeb)
{
Write-Host "Scanning Site: $($spWeb.Url)"
foreach ($list in ($spWeb.Lists | ? {$_ -is [Microsoft.SharePoint.SPDocumentLibrary]})) {
    Write-Host "Scanning List: $($list.RootFolder.ServerRelativeUrl)"
    foreach ($item in $list.CheckedOutFiles) {
        if (!$item.Url.EndsWith(".aspx")) { continue }
        $writeTable = @{
        "URL"=$spWeb.Site.MakeFullUrl("$($spWeb.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)");
        "Checked Out By"=$item.CheckedOutBy;
    "Author"=$item.File.CheckedOutByUser.Name;
        "Checked Out Since"=$item.CheckedOutDate.ToString();
    "File Size (KB)"=$item.File.Length/1000;
    "Email"=$item.File.CheckedOutByUser.Email;
        }
        New-Object PSObject -Property $writeTable
    }
    foreach ($item in $list.Items) {
        if ($item.File.CheckOutStatus -ne "None") {
            if (($list.CheckedOutFiles | where {$_.ListItemId -eq $item.ID}) -ne $null) { continue }
            $writeTable = @{
            "URL"=$spWeb.Site.MakeFullUrl("$($spWeb.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)");
            "Checked Out By"=$item.File.CheckedOutByUser.LoginName;
        "Author"=$item.File.CheckedOutByUser.Name;
            "Checked Out Since"=$item.File.CheckedOutDate.ToString();
        "File Size (KB)"=$item.File.Length/1000;
        "Email"=$item.File.CheckedOutByUser.Email;
            }
            New-Object PSObject -Property $writeTable
        }
    }
}
foreach($subWeb in $spWeb.Webs)
{
GetCheckedItems($subWeb)
}
$spWeb.Dispose()
}

GetCheckedItems($spWeb) | Out-GridView

# alternative output file
# GetCheckedItems($spWeb) | Out-File c:\CheckedOutItems.txt -width 300

Windows PowerShell script for reading the SharePoint Secure Store

when you assign a credential in a secure store for any target application. there is no way to check which credentials you used last time.
 
Below powershell script can be used to read the credentials inside the secure store.



Powershell to update quick launch in SharePoint 2013

Below is the powershell, which is being used to

1- update the title and URL of existing heading in left navigation.
2- add all the sibling subsites (title and URL) as a node under the heading.

#SharePoint site url
$MainSiteURL = "Site URL for which you want to change the quick launch"
$ParentSiteURL = "Site URL of the parrent site of above site as you want to add the sibling subsites"
$ParentSiteName = "Name of a parent site"

           
#Get the SPWeb object for the site url           
$MainWeb = get-spweb $MainSiteURL
$ParentWeb = get-spweb $ParentSiteURL

#Get the quick launch menu           
$ql = $MainWeb.Navigation.QuickLaunch;           

#change the heading title and URL
$qlHeading = $ql | where { $_.Title -eq "subsites" }
$qlHeading.Title = $ParentSiteName
$qlHeading.Url = $ParentSiteURL
$qlHeading.Update()

# get all subsites
if($ParentWeb.Webs -ne $null)
{
    foreach($sitesUnderParentWeb in $ParentWeb.Webs)
    {
        # to create a new node
        $newnode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode($sitesUnderParentWeb.Title, $sitesUnderParentWeb.Url, $true)
        # add this node to heading
        $qlHeading.Children.AddAsLast($newnode)
       
    }
}
$MainWeb.Update()           

SharePoint Online Backup and Restore - Nice article

I got the below nice article about SharePoint Online backup and Restore by Threewill

http://www.threewill.com/the-4-options-you-need-to-know-about-sharepoint-online-backup-and-restore/ 


  1. Use the recycle bin and version history.
  2. Use a 3rd party tool for backup and restore (there are several).
  3. Manually backup sites, lists, and libraries 
  4. Create an Office 365 support request 
Few more pieces of information:
  • Site collection backups are performed every 12 hours and are kept for 14 days.
  • If you want to restore a backup, you need to create a support ticket and specify the earliest backup time, latest backup time, and optimal backup time.  Say your site collection was messed up during the day on Tuesday.  You could state the earliest backup time as close of business Monday (e.g., 6 PM), the latest backup time as open of business on Tuesday (e.g., 6 AM), and the optimal backup time as Tuesday at 4 AM.  The support team will get you the best backup based on this information.  You should have at least 12 hours between the earliest and latest times.
  • The restoration is done to a site collection.  The entire site collection will be replaced and any changes made after the backup time will be lost (must be re-done after the restore).
  • Once a restore is requested, it may take 2 or more days for the restore to be performed.  This is done based on O365 support’s triage process and the perceived priority of the request.  The tenant license or overall number of users for the tenant does not change the priority.

Check if your DNS is working properly - Online solution

Below is the URL to verify if the DNS is working correctly.

http://dnscheck.pingdom.com/

Provision Service using Powershell


Below is the command to provision or un-provision any service


Add-PSSnapin microsoft.sharepoint.powershell
Get-SPServiceInstance | Where-Object {$_.Server.Name -eq "NameofServer"} | Sort-Object TypeName | Format-Table -AutoSize
$si = Get-SPServiceInstance | Where-Object {($_.TypeName -match "NameOfServiceApplication") -and ($_.Server.Name -eq "NameOfServer")}
$si | fl
$si.Unprovision()
$si.Provision()
$si.Status
While ($si.Status -eq "Provisioning")
{
    Start-Sleep 3
    Write-Host "." -NoNewline
    $si = Get-SPServiceInstance | Where-Object {($_.TypeName -match "NameOfServiceApplication") -and ($_.Server.Name -eq "NameOfServer")}
}

Create Site collection using Powershell - Including Default groups

The below command is used to create a hosted Site collection under any web application using power-shell.



Add-PSSnapin "Microsoft.sharepoint.powershell"

$url = "Name of your Hosted Site collection"
$hostHeaderWA = "Name of your web application"
$SCollectionTitle = "Title of your site collection"
$SCollDescription = "Description of your site collection"

New-SPSite $url -HostHeaderWebApplication $hostHeaderWA `
                -Name $SCollectionTitle `
                -Description $SCollDescription `
                -OwnerAlias 'DomainName\AccountName' `
                -language 1033 `
                -Template 'STS#0'

The when you create your site collection (OR hosted site collection), you will see the default Owners/Members/Visitors groups are missing.
To create those groups, use the below Power-Shell command

$web = Get-SPWeb $url
$PrimaryLogin = $web.EnsureUser("DomainName\AccountName")
$web.CreateDefaultAssociatedGroups($PrimaryLogin,"","")

you can run the entire Power-Shell command together as well.



SQL Standard OR Enterprise Version of RS (Reporting services) for SharePoint 2013

I got a nice finding about using either a MSSQL Standard OR Enterprise version of RS for SharePoint 2013.

1- if you use the SQL Standard 2012 for RS in SharePoint 2013, you will not be able to activate the SQL Server Reporting Services on more than one application Servers of SharePoint.

2- If you use Enterprise version of SQL 2012, the SQL Server Reporting Service can be started on multiple application servers.

Here is more details about it.

http://netwovenblogs.com/2013/08/04/reporting-services-in-sharepoint-2013-integrated-mode-cannot-support-scale-out-mode/

SQL Server Reporting Services Scale-out mode is supported by following SQL Server editions: Enterprise, Business Intelligence. (Refer MSDN: Features Supported by the Editions of SQL Server 2012)
With your SQL Server 2012 Enterprise or Business Intelligence editions, under your SharePoint 2013 (2010) you could always scale out to more than one SharePoint server. (Refer MSDN Add an Additional Report Server to a Farm (SSRS Scale-out) )
While you have SQL Server 2012 Standard edition, under the SharePoint 2013 Farm, you can have only one instance of SQL Server Reporting Services in the SharePoint Integrated mode. While you try to start another instance of Reporting Service in the farm on different server within the Farm, you will receive the above message.
If you intend to start the SQL Server Reporting Services on a different server than the service is currently running, you should first stop the service on the current running service and then start on your desired server. But also be aware other installation and configuration requirements for hosting the SSRS Service on the Server before you try to start the SSRS Service on a new server

Configure Custom Access Denied Page - SP 2013

I found a really nice article for creating custom access denied page from Danish.

http://a2zdinesh.blogspot.in/2014/05/configure-custom-access-denied-page-bug.html


Danish also explained the step by step configuration (Development and deployment) for creating custom access denied page.