Saturday, June 27, 2015

Check if Service Application is Running in SharePoint using PowerShell

Couple of times, I had to get the service application's status prior performing activities such as: Stop and Start the service, Monitoring service application's availability, etc. Here is how we can check if the service application is running / created using PowerShell.

PowerShell script to check service application's status:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Display Name of the Service Application
$DisplayName="Managed Metadata Services"

#Get the Service Application from its Name
$ServiceApp = Get-SPServiceApplication | Where { $_.DisplayName -eq $DisplayName}
			 
if($ServiceApp -ne $null)
{
	#get the Service application status
	$ServiceApp.Status
}
else
{
	Write-Host "Service application either not found or not created!"
}
This script gives the service application's current status. You can also get a service application from its type. Here is how:
#Type Name of the Service Application
$TypeName="Managed Metadata Service"

#Get the Service Application from its Type Name
$SeviceApp = Get-SPServiceApplication | Where {$_.TypeName -eq $TypeName}

Here is the Type Name of all service Applications:
Type Name
Access Services Web Service Application
Access Services 2010 Web Service Application
App Management Service Application
Application Discovery and Load Balancer Service Application
Business Data Connectivity Service Application
Excel Services Application Web Service Application
Machine Translation Service
Managed Metadata Service
PerformancePoint Service Application
PowerPoint Conversion Service Application
Search Administration Web Service Application
Search Service Application
Secure Store Service Application
Security Token Service Application
State Service
Usage and Health Data Collection Service Application
User Profile Service Application
Visio Graphics Service Application
Work Management Service Application
Word Automation Services



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, June 18, 2015

Create a Task in SharePoint Task List using Powershell

PowerShell Script to Create a New Task in SharePoint Task List:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Parameters
$WebURL="http://intranet.crescent.com"
$TaskListName="Tasks"

#Get web and List objects
$Web = Get-SPWeb $WebURL
$TaskList = $Web.Lists[$TaskListName]

$NewTaskItem = $TaskList.AddItem()

#Set value for Task list columns
$NewTaskItem["Title"] = "New Task"
$NewTaskItem["AssignedTo"]=$web.EnsureUser("Crescent\Salaudeen")
$NewTaskItem["StartDate"]= (Get-Date).ToShortDateString()
$NewTaskItem["DueDate"] =(Get-Date).AddDays(7)
$NewTaskItem["Status"]="Not Started"
$NewTaskItem["Priority"]= "(1) High"
$NewTaskItem["PercentComplete"]="0"

$NewTaskItem.Update()

Write-host "New Task Item Created Successfully!"
and here is the new task created in SharePoint 2016 task list:
create new task item in Task list of SharePoint using PowerShell


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, June 15, 2015

Configuring Audit Logs Feature in SharePoint 2013

Audit log reports in SharePoint used to track how your SharePoint site contents are being used or to meet any legal compliance requirements. Lets see how to enable auditing feature in SharePoint 2013.

Enable Audit Log Feature in Central Administration:
SharePoint 2013 audit settings needs to be enabled starting from Central Administration site.

  • From SharePoint 2013 Central Administration: Under Application Management, Click on Manage service applications.
  • Select "Secure Store Service application", and click on "Properties" from the ribbon.
  • Scroll down and Enable Audit section, and select the Audit log enabled box. Set the number of days to keep audit logs until purged.
    audit in sharepoint 2013 central admin
  • Click OK to save your changes.
Enable Auditing Feature at Site collection level
  • Go to your top level sites settings page (Site collection settings) 
  • Click on "Site collection audit settings" link under Site Collection Administration. 
  • In configure auditing page, enable relevant events such as "Editing Items", "Deleting or Restoring Items" check boxes
     sharepoint 2013 audit settings
  • Once done, Click on "OK" to save your changes.
To View Audit Log Reports
When audit functionally is enabled, All selected events on SharePoint site content will be automatically logged. Then we can filter and analyze the audit data for sites, lists & libraries, content types, list items (documents) in the site collection. To view Auditing reports, head on to:
  • Site Settings of the Root web
  • Click on Audit log reports under site collection Administration
  • Pick the relevant report. You can choose custom report as well.
sharepoint 2013 view audit log reports
You can enable auditing on: site collection, library/list, folder, content type levels.

Enable Auditing at Library/List Level:
  • Go to your library >> Library Settings >> Under "Permissions and Management" click on "Information management policy settings"
  • Under the Content Types, Click on the relevant content type to enable auditing on the particular item (E.g. Documents)
  • Scroll down to Auditing section and choose  the events you want to add to the audit log
    sharepoint 2013 audit document library

Trim Audit Log in SharePoint 2013:
Although auditing is a nifty feature in SharePoint, enabling auditing for a site where large number of events takes place, may result with large audit logs which can affect the overall performance of the SharePoint farm. So, It's recommended to enable audit log trimming for site collections.
trim audit logs sharepoint 2013
Related post: How to Trim audit log to Improve Performance in SharePoint

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Move SharePoint Web Application's IIS Physical Path to a New Location

Requirement: Move SharePoint web application's IIS physical location from system drive (c:\) to application drive (d:\) due to new server support policies!

Solution:
SharePoint web applications, by default placed under: "C:\inetpub\wwwroot\wss\VirtualDirectories" when we create them. There is no UI/direct way to change the physical location of SharePoint IIS web sites later. However, these three steps can be utilized to move SharePoint web application's IIS physical directory to a new location:
  1. Copy all contents from the current virtual directory to new directory
  2. Change IIS website's physical path
  3. Update SharePoint web application to point to the new directory path.
Lets automate these manual steps with PowerShell.

PowerShell Script to Move IIS Web Site to New Physical Location:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Import IIS Module
Import-Module WebAdministration

#Variables
$WebAppURL="http://intranet.crescent.com/"
$NewPath="D:\IIS\VirtualDirectories\Intranet.Crescent.com"     
$IISSiteName = "Crescent Intranet" 
 
#Get Web Applications' IIS Settings
$WebApp = Get-SPWebApplication $WebAppURL
$IISSettings = $WebApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default]
$OldPath = $IISSettings.Path

#Check if destination folder exists already. If not, create the folder
if (!(Test-Path -path $NewPath))        
{            
    $DestFolder = New-Item $NewPath -type directory          
}

#***** Step 1 - Copy Current Virutal Directory to new location **** #
Copy-Item -Path $OldPath\* -Destination $NewPath -Force -Recurse 

#***** Step 2 - Change IIS Web Site's Physical path ******
Set-ItemProperty "IIS:\Sites\$($IISSiteName)" -name PhysicalPath -value $NewPath

#***** Step 3 - Update SharePoint Web Application ******
#Change the Web App path
$IISSettings.Path = $NewPath
#Update Web Application
$WebApp.Update()
Please note, You'll have to repeat steps 1 and 2 in all SharePoint web front end servers.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, June 13, 2015

Content Approval: Approve All List Items in Bulk using PowerShell

When content approval is turned-ON, approving items one by one could be hectic. To bulk approve items, We can utilize PowerShell. Here is my PowerShell script to bulk approve items pending for content approval.

This was a huge time savor for me during a migration project.

PowerShell script to approve List items in Bulk:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Site URL and List Name variables
$WebURL="https://portal.crescent.com/sites/ops/"
$ListName="Tasks"

#Get all List Items
$ListItems= (Get-SPWeb $WebURL).Lists[$ListName].Items

#Iterate through each item
foreach($Item in $ListItems)
{
    #Approve Item
    $item["_ModerationStatus"] = "0" #1 to reject
  
    #Update the item
    $item.Update()
}
write-host "Total Items Approved:"$ListItems.Count

This PowerShell script simply loops through all items in the given list and Approves them by setting the Approval Status field (Internal name is "_ModerationStatus").
approve items using powershell


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, June 10, 2015

How to Add Date Time Field to SharePoint List using PowerShell

Requirement: Add Date and Time Column to SharePoint list using PowerShell.
add date time column to sharepoint list using powershell

PowerShell Script to add Date time Column to SharePoint list:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Processing Variables
$WebURL="http://portal.crescent.com/sites/Sales"
$ListName="Vendors"
$FieldName="Date of Contract"
$RequiredField=$false

#Get Objects
$Web = Get-SPWeb $WebURL
$List= $Web.Lists[$ListName]

#Add Date and Time Column
$List.Fields.Add($FieldName,"DateTime", $RequiredField)
This Adds a new field.

Set Date Time Column Settings using PowerShell: 
While the above code adds new field to given list, there are additional settings on the column such as: Display Format, Default Value, etc can be set using PowerShell.
powershell to set date time field properties
PowerShell to Update Date Time Column Settings:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Processing Variables
$WebURL="http://portal.crescent.com/sites/Sales"
$ListName="Vendors"
$FieldName="Date of Contract"

#Get Objects
$Web = Get-SPWeb $WebURL
$List= $Web.Lists[$ListName]

#Set Column Settings
$List.Fields[$FieldName].Description = "Enter Date of Join”

#Enforce unique
$List.Fields[$FieldName].EnforceUniqueValues = $false

#Required
$List.Fields[$FieldName].Required = $true

#Date Time Display Format 
$List.Fields[$FieldName].DisplayFormat = "DateOnly"

#Default Value
#$List.Fields[$FieldName].DefaultValue="[today]

#Formula
$List.Fields[$FieldName].DefaultFormula = "=[Today]+7"

#Friendly Display Format
$List.Fields[$FieldName].FriendlyDisplayFormat="Disabled"

$List.Fields[$FieldName].update()

Refer this MSDN link for the complete field properties reference: SPFieldDateTime properties

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Send HTML Format E-Mails with Send-MailMessage in PowerShell

Requirement: Send E-mail from PowerShell script with HTML formatted body.

Solution: Here is an example for sending E-mail as HTML from PowerShell script with Send-MailMessge cmdlet:
#Get Date
$ReportDate = Get-Date -format "MM-dd-yyyy"

#Configuration Variables for E-mail
$SmtpServer = "smtp.crescent.com" #or IP Address such as "10.125.150.250"
$EmailFrom = "Site Delete Script <SiteDeleteScript@Crescent.com>"
$EmailTo = "SharePointSupport@Crescent.com.com"
$EmailSubject = "Site Delete Script - Daily Report on: "+$ReportDate

#HTML Template
$EmailBody = @"

<table style="width: 68%" style="border-collapse: collapse; border: 1px solid #008080;">
 <tr>
    <td colspan="2" bgcolor="#008080" style="color: #FFFFFF; font-size: large; height: 35px;"> 
        Site Delete Script - Daily Report on VarReportDate  
    </td>
 </tr>
 <tr style="border-bottom-style: solid; border-bottom-width: 1px; padding-bottom: 1px">
    <td style="width: 201px; height: 35px">&nbsp; Number of requests Approved</td>
    <td style="text-align: center; height: 35px; width: 233px;">
    <b>VarApproved</b></td>
 </tr>
  <tr style="height: 39px; border: 1px solid #008080">
  <td style="width: 201px; height: 39px">&nbsp; Number of requests Rejected</td>
 <td style="text-align: center; height: 39px; width: 233px;">
  <b>VarRejected</b></td>
 </tr>
</table>

"@

#Get Values for Approved & Rejected variables
$ApprovedCount= Get-ApprovedReq()
$RejectedCount= Get-RejectedReq()

#Replace the Variables VarApproved, VarRejected and VarReportDate
$EmailBody= $EmailBody.Replace("VarApproved",$ApprovedCount)
$EmailBody= $EmailBody.Replace("VarRejected",$RejectedCount)
$EmailBody= $EmailBody.Replace("VarReportDate",$ReportDate)
 
#Send E-mail from PowerShell script
Send-MailMessage -To $EmailTo -From $EmailFrom -Subject $EmailSubject -Body $EmailBody -BodyAsHtml -SmtpServer $SmtpServer

and the output:
powershell send mailmessage body as html
Instead of directly embedding the HTML into the script, you can also store it in an external file and retrieve the HTML format/template with Get-Content cmdlet in the script.

Tail: 
Send-mailmessage in PowerShell with attachments:
Just specify the -attachments parameter in Send-Mailmessage cmdlet. Here is an example:
#send-mailmessage in powershell with attachment
$attachment = "D:\Reports\SiteDeleteRpt.csv"
 
#send-mailmessage in powershell multiple attachments
$attachment = "D:\Reports\SiteDeleteRpt1.csv","D:\Reports\SiteDeleteRpt2.csv"
 
Send-MailMessage -To $EmailTo -From $EmailFrom -Subject $EmailSubject -Body $EmailBody -BodyAsHTML -Attachments $attachment -SmtpServer $SmtpServer 

Send-mailmessage in PowerShell to multiple recipients:
It Just needs an array!
$EmailTo = "marcm@crescent.com", "victor <victor@crescent.com>"
#or use:
$recipients = @("Marc M <marcm@crescent.com>", "victor <victor@crescent.com>")
How to Get Outgoing E-mail Server? Use this code:
$SPGlobalAdmin = New-Object Microsoft.SharePoint.Administration.SPGlobalAdmin
$SMTPServer = $SPGlobalAdmin.OutboundSmtpServer


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, June 8, 2015

Fix "The form cannot be rendered. This may be due to a Misconfiguration of the Microsoft SharePoint Server state service" Error in SharePoint 2013

Problem: InfoPath form based list form in a migrated SharePoint 2013 environment from SharePoint 2010 gave this error message:
"The form cannot be rendered. This may be due to a Misconfiguration of the Microsoft SharePoint Server state service"
The form cannot be rendered. This may be due to a Misconfiguration of the Microsoft SharePoint Server state service
Solution: Create a State Service Application as in: How to Create State Service Application in SharePoint 2013

It could also happen if your State service database goes corrupted. Use these cmdlets to recreate State service application database.
  • Remove-SPStateServiceDatabase
  • New-SPStateServiceDatabase
  • Mount-SPStateServiceDatabase

Related post: SharePoint 2010 InfoPath Form Error- The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, June 7, 2015

Set Default Value for Hyperlink or Picture Column in SharePoint

Problem:
There is no provision for specifying default value in Hyperlink or Picture type columns in SharePoint! In some scenarios, we may want to specify SharePoint 2010/2013 hyperlink column default value. But there is no option in SharePoint web UI to enter hyperlink field default value!
sharepoint 2010 hyperlink field default value

Solution: Set SharePoint hyperlink column default value with PowerShell! Use this PowerShell script to specify default value for hyperlink or picture type fields.

Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Variables
$WebURL="http://intranet.crescent.com"
$ListName="Proposal Documents"
$ColumnName="Reference URL"
$DefaultValue="http://externalsites.crescent.com" 

#Get the Web
$web = Get-SPWeb $WebURL
 
#Get the List
$list = $web.Lists.TryGetList($ListName)
 
If($list -ne $null)
{
 #Get the column
 $column = $list.Fields[$ColumnName]

 if($column -ne $null)
 {
     #Set Default Value
     $column.DefaultValue = $DefaultValue
  $column.Update()
     $list.Update()
  Write-Host " Default value set for the column!" 
 }
 }
$web.Dispose() 

Here is the output for SharePoint 2013 list hyperlink default value specified programmatically:
 sharepoint 2013 hyperlink column default value

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, June 6, 2015

Remove Hyperlink from Lookup Columns in SharePoint

Problem:
When we add lookup column to any SharePoint list, it appears with the link to parent item in SharePoint list views. Quite often, end-user clicks on the lookup link and edits parent lookup item by mistake - People  get confused which link to click. So we wanted to remove hyperlink from lookup columns in SharePoint 2013 list views.
remove lookup hyperlink from sharepoint list view
SharePoint 2013 remove hyperlink from lookup column - No code solution:
Here is how you can remove hyperlink from lookup fields out-of-the-box without any coding and customization efforts.
  • Go to your list settings, Pick the lookup column. In my case its "Parent Project". In "Edit Column" page, Select "Title" field under "Add a column to show each of these additional fields" Section as highlighted below.
    sharepoint remove hyperlink lookup field
  • Now, Edit your list view, Unselect "Parent Project" field and select "Parent Project: Title" field. (You can rename this Title - BTW!)
    remove hyperlink from lookup column
  • Click "OK" to save the view. That's all! This removes the link from hyperlink columns.
    sharepoint 2010 remove hyperlink from lookup
However, in Display form of the list, it still shows link in hyperlink fields, isn't it? Proceed with the below method to remove hyperlink from lookup column. Although lookup field links can be removed using SharePoint designer-XSLT methods, I prefer this jQuery as its relatively simpler.

Using JQuery to remove hyperlink from lookup column:
Lookup columns are pointing to.link something like "http://Site/***&RootFolder=*". So, lets find all Anchor elements of the page with href attributes "&RootFolder=*". and remove remove link of the lookup.

To remove lookup hyperlink from SharePoint list view using jQuery, Follow these steps:
  1. Go to your List view page, E.g. http://portal.crescent.com/Lists/ProjectMilestones/AllItems.aspx
  2. Click on Site Settings gear, Click on "Edit Page" Menu item
  3. Click on Add a Web Part link shown on the page, Under "Media and Content" choose "Script Editor" and Click on "Add" Button
  4. Click on "Edit Snippet" link on the Script Editor Web part and place the below code in it.
    sharepoint 2013 remove hyperlink from lookup column
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.2.6.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $('a[href*="RootFolder=*"]').each(function(index) {
                var link = $(this);
                $(this).after("<span>" + link.text() + "</span>");
                $(this).remove();
            });
        });
    </script>
  5. Save and Close the page!
To remove Hyperlink from Person or group fields using jQuery, Just replace the Line#4 with:
$('a[href*="userdisp.aspx?ID="]').each(function(index) { 


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, June 5, 2015

How to Delete Site Collection using PowerShell in SharePoint

To delete any SharePoint site collection, You have use SharePoint Central Administration site. Navigate to :
  • SharePoint 2013 Central Administration >> Application Management 
  • Click on Delete a site collection link under Site Collections group
    how to delete site collection powershell
  • Select the site collection to delete
    delete site collection powershell sharepoint 2013
  • Click on Delete button to delete a site collection in SharePoint.
    powershell script to delete a site collection
Delete host named site collection with PowerShell
Host named site collections can be managed only through PowerShell! Central Admin doesn't offer the provision to delete Host named site collections as it offers for Path-based sites. Following are some examples of deleting SharePoint 2013/2010 site collections using PowerShell.

Delete site collection using PowerShell
To delete site collection through PowerShell, use Remove-SPSite cmdlet.
Remove-SPSite -Identity "<Site-Collection-URL>" 
E.g.
Remove-SPSite -Identity "http://sharepoint.crescent.com/sites/operations" 

Force delete SharePoint site collection PowerShell
If you face any difficulty in deleting SharePoint site collection either from Central Admin or with PowerShell, you can force delete as:
#Get the site collection to delete
$Site = Get-SPSite http://site-collection-url

#Get the content database of the site collection
$SiteContentDB = $site.ContentDatabase 

#Force delete site collection
$SiteContentDB.ForceDeleteSite($Site.Id, $false, $false)
If you delete a site collection Remove-SPDeletedSite cmdlet or force delete a site collection with $GradualDelete parameter to $True, Then you'll not be able to recover it using Restore-SPDeletedSite cmdlet! (You need content database backup instead!)

Bulk delete site collections with PowerShell in SharePoint 2013 
How about bulk deleting multiple site collections? Say, You want to delete all site collections under the given managed path: /Sites?
Get-SPSite "http://sharepoint.crescent.com/sites*" -Limit ALL | Remove-SPSite -Confirm:$false

PowerShell to delete all site collections under a web application:
If you don't want to send your SharePoint sites to recycle bin and would like to remove them permanently, use:
#Web Application URL
$WebAppURL="http://SharePoint.crescent.com"

#Get Each site collection and delete
Get-SPWebApplication $WebAppURL | Get-SPSite -Limit ALL | Remove-SPSite -Confirm:$false

Related posts:


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Tuesday, June 2, 2015

Exclude SharePoint Site or List from Search Results

SharePoint search results are already security trimmed. Meaning, If an user doesn't has access to a SharePoint site, He/She doesn't see any search results from the particular site collection. Same applies to SharePoint lists even. But in some cases, you may want to prevent certain artifacts from appearing on the search results. E.g. You may want to exclude "Site Assets" library to exclude all images and supported scripts appearing in search!

Exclude site from search SharePoint 2013:
To exclude a SharePoint site from search results,
  • Click on "Search and offline availability" under Search group in Site settings page.
  • Choose "No" for Allow this site to appear in search results option.
  • Click on "OK" to save your changes.
SharePoint search exclude site collection
Set SharePoint Site collection to Exclude from Search Results using PowerShell:
Lets do it with PowerShell, instead of setting each subsites search visibility property manually.
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

#Site collection URL
$SiteCollURL="http://mgmt.crescent.com/sites/reports"

#Get All sites under the given site collection
Get-SPSite $SiteCollURL | Get-SPWeb -Limit all | ForEach-Object {
    Write-Host "Processing Web: $($_.ServerRelativeUrl)" 
    
    #Set Search visibility property to exclude the site from search
    $_.NoCrawl = $true     
    $_.Update()

    Write-Host "Updated Search Visibility on Web:" $_.Title -ForegroundColor Green
 }
Please note, content from the given site collection and all of its sub-sites will not appear in search results after a search crawl (incremental or full) completed successfully!

Exclude list from SharePoint 2013 search:
Similarly on SharePoint lists and libraries, under Advanced settings, you have the search visibility option. To exclude all the items in the document library or list from appearing in to search results:
  • Navigate to the List or document library settings
  • Go to advanced settings
  • Set Search option to "No" to exclude document library or list from search in SharePoint, as seen below.
sharepoint 2013 search exclude list
PowerShell script to exclude list from SharePoint search To exclude list items from SharePoint search results, you can set the NoCrawl Property!
$List.NoCrawl = $true
How about excluding aspx pages like AllItems.aspx, dispform.aspx, etc? Go for: SharePoint Search Crawl Rules


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, June 1, 2015

"Connect to Outlook" in SharePoint 2013 Greyed out?

Problem: SharePoint users unable to connect to any SharePoint 2013 list or calendar to Outlook 2013.  The "Connect to Outlook" Ribbon button is always greyed out!
connect to outlook disabled sharepoint 2013 online

Troubleshooting Checklist:
  1. Connect to outlook feature is available only to these type of lists:  Calendar, Tasks, Project Tasks, Contacts, Document Library and Discussion Boards.
  2. Prior to Service pack 1:  If your SharePoint site has Minimal Download Strategy feature enabled, simply press "F5" to reload the current page. You'll get connect to outlook button enabled! Disabling MDS feature is not a good idea IMHO!!
  3. Make sure that "SharePoint Stssync Handler" is enabled in browser add-ons. (IE >> Tools >> Manage Add-ons)
  4. Check the client-integration option of web application settings
  5. This feature works only when you have 32 bit version of office installed in your client machine!
  6. The "WebClient" Service must be running in services console of the client machine!
  7. Try adding your SharePoint site to "Trusted sites zone", Also uncheck "Enhanced Protected Mode" for the zone.
  8. Logged user must have at least "Read" permissions to SharePoint . "View Only" doesn't work!
     


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Restrict Office Web Apps Edit License within a AD Group

Requirement: SharePoint 2013 Office Web Apps "Edit in Browser" feature needs to be limited to users who has Microsoft Office Volume license.

Solution: License Enforcement in Office Web Apps 2013
The overall idea for the solution is: Create a new security group in AD, Add users to it - who are allowed to use edit option in Office web Apps. From SharePoint, Enable user licensing and map this AD group with the "Office Web Apps Edit" license.

Step 1: Create a AD Security Group
Login to your domain controller, Create new security group to hold users who are allowed to use Edit feature in office Web Apps. Add members to it. Here is mine: OWA Editors!
office web apps edit in browser

Step 2: Configure OWA and SharePoint to Enforce Licensing:
Login to your Office Web Apps Server, Create a new Office Web Apps Farm with "EditingEnabled" Switch.
New-OfficeWebAppsFarm -InternalUrl "http://was.crescent.com" -ExternalUrl "https://was.crescent.com" -CertificateName "Crescent Hosting Certificate" -AllowHTTP -SSLOffLoaded -EditingEnabled

For Existing OWA Farms, Set Editing Enabled Switch:
Set-OfficeWebAppsFarm -EditingEnabled

From SharePoint Server, Enable User licensing Enforcement and Add new Mapping: 
Check whether the licensing enforcement is enabled with the cmdlet: Get-SPUserLicensing , If its false, Enable it with:
Enable-SPUserLicensing
Once its enabled, verify the licenses created:
Get-SPUserLicense
This should return user licenses:Enterprise, Standard, Project, OfficeWebAppsEdit, etc.
 office web apps edit license

Now, you can map the AD security group with the Office Web Apps Edit license:
$LicenseMapping = New-SPUserLicenseMapping -SecurityGroup "OWA Editors" –License OfficeWebAppsEdit
$LicenseMapping | Add-SPUserLicenseMapping

Result: 
Users who are member of the AD group "OWA Editors" will get "Edit" options from Office Web Apps. Rest gets only "View" option.

Office Web Apps with View Option:
 office web apps 2013 edit in browser

Office Web Apps with Editing Option enabled:
sharepoint 2013 office web apps edit in browser
Important: Adding users to AD Security group will not take effect immediately!
This is by design! When you add/remove users to the dedicated AD group, it doesn't take effect immediately, because SharePoint does this sync in every 10 hours! To overcome, you can change these time intervals as in : SharePoint - Active Directory Security Group Membership Sync Problem and Solution
Same approach applies when you want to restrict users from using SharePoint 2013 Enterprise license!


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...