Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

Access profile pictures on SharePoint /OneDrive/Office365

I had recently been asked by one of my companies HR representative to provide the profile photo for all the users in the company.

Now there are many ways you can find these photos. Our organization uses Azure Active directory and office 365.

Found this very useful blog online which describes how these Photos are synched. https://paulryan.com.au/2016/user-photos-office-365/

After going through few more blogs, found a very easy way to get all the profile pictures. Basically, there is a hidden picture library in OneDrive called 'User Photos' where all the profile pics are stored. You can access this library by using following url:
https://<yourtenant>-my.sharepoint.com/User%20Photos/Forms/Thumbnails.aspx

For Onpremise SharePoint installation, just replace your tenant name with mysite:
https://<mysite>/User%20Photos/Forms/Thumbnails.aspx 



SharePoint workflow form blank on IE

This is one of the weird issue I faced while creating an out of the box workflow.

Business had a web application where they wanted to create simple approval workflow on a SharePoint 2013 site collection. Nothing complicated, but it turned out to be a difficult task.

After creating the workflow the workflow forms were coming as BLANK. No error on screen or in the logs, just a page with header, left nav and footer, but nothing in between :((

We did some analysis and found that none of the workflow forms were working. But the same workflow forms worked on another web application on same farm. So it was clear that nothing was wrong at farm level.

Finally opened a case with Microsoft and even they were not able to help out. There suggestion was to delete the web-application and restore it using content DB. As per them the web application was not created correctly, even though we shared the auto sp installer script used to create it.

But a little bit more analysis gave a clue. It turned out that the same forms on same web application when opened in Chrome worked.

So essentially it was an IE issue. We found that there is a security feature in IE that blocks any forms on the links that has with underscore "_". This only happens when the first you have _ in the first part of the link, like web application name or server name.

But unfortunately you wont get enough articles around it. Here is what I have found , hope it will be helpful.

And the only solution Microsoft suggests now is change the URL for the webapplication :(

Server Template IDs for SharePoint Lists

I regularly need the server template numbers to use in scripts and code. Hence creating this list.

If you can not find your list name here, open the list and select to view source of the page. In the page try to find text similar to ctx.ListTemplateType = 119

Your List ID would be the highlighted number(119 ID is for image library).

ID List template name
100 Generic list
101 Document library
102 Survey
103 Links list
104 Announcements list
105 Contacts list
106 Events list
107 Tasks list
108 Discussion board
109 Picture library
110 Data sources
111 Site template gallery
112 User Information list
113 Web Part gallery
114 List template gallery
115 XML Form library
116 Master pages gallery
117 No-Code Workflows
118 Custom Workflow Process
119 Wiki Page library
120 Custom grid for a list
130 Data Connection library
140 Workflow History
150 Gantt Tasks list
200 Meeting Series list
201 Meeting Agenda list
202 Meeting Attendees list
204 Meeting Decisions list
207 Meeting Objectives list
210 Meeting text box
211 Meeting Things To Bring list
212 Meeting Workspace Pages list
300 Portal Sites list
301 Blog Posts list
302 Blog Comments list
303 Blog Categories list
850 Page Library
1100 Issue tracking
1200 Administrator tasks list
2002 Personal document library
2003 Private document library
 

Sharepoint People picker issue

After recent migration of our farm from SharePoint 2010 to SharePoint 2013, we faced issues, where people picker on various web applications were slow / not returning users.

As the organization had multiple domains , we had to set up the People picker property to make sure it searches all the domains. Here is the sample to the script: 

STSADM.exe -o setproperty -propertynamepeoplepicker-searchadforests -propertyvalue“forest:xx.mycompanyplc.com;forest:in.sisterconcerplc.corp,uk;domain:department.department1.com -urlhttp://samplePortal  

This has not only resolved the issue where user were not returned, but also improved the speed.

Powershell to get Property bag for Farm, Web App or Site Collection

Application developers, now a days store many of the configurable properties in the Property bags. As an administrator you might frequently be asked the value of these properties.

I  used below scripts to check Properties at Farm, Web Application and Site Collection level.

#Add PS SnapIn for SharePoint

# Get all the Properties from Farm Property bag
$myFarm = Get-SPFarm;

foreach ($prop in $myFarm.Properties.GetEnumerator() | Sort-Object -Property Name) {
                     Write-Host " - " $prop.Name "->" $prop.Value
}

# Get all the Properties from Web Application Property bag
$myWebApp = Get-SPWebApplication "http://webapp"

foreach ($prop in $myWebApp.Properties.GetEnumerator() | Sort-Object -Property Name) {
                     Write-Host " - " $prop.Name "->" $prop.Value
}

# Get all the Properties from Site Collection Property bag
$myWeb = Get-SPWeb "http://sitecollection"

foreach ($prop in $myWeb.Properties.GetEnumerator() | Sort-Object -Property Name) {
                     Write-Host " - " $prop.Name "->" $prop.Value
}


Create SharePoint user profiles using powershell

I have been recently asked to create thousands of user profiles in our test environment.

Ideally importing profiles from AD or provisioning the profiles is advisable, but due to nature of our test environment it was not possible. After searching a bit, I found a script and modified it for this purpose. The script requires all the profile related data to be stored in a CSV.

#Add-PSSnapin if not added already using this link 

$portalsite = "http://spportal"
$portalcontext = Get-SPServiceContext -Site $portalsite


$upm = New-Object -TypeName Microsoft.Office.Server.UserProfiles.UserProfileManager -ArgumentList $portalcontext
$userslist = Import-Csv -Path "userprofilelist.csv"

#Loop through all the rows of csv

for($count=0; $count -lt $userslist.Count; $count++)
{

#Create new User Profile
$upm.CreateUserProfile($userslist[$count].UserName)
$profileproperty = $upm.GetUserProfile($userslist[$count].UserName)

#Custom User Profile being updated for the user
$profileproperty["property1"].Value = $userslist[$count].Property1
$profileproperty["property2"].Value = $userslist[$count].Property2
$profileproperty["property3"].Value = $userslist[$count].Property3
$profileproperty.Commit()

}

Hope this helps. Please see my other scripts to export the data to CSV.

Site and Site Collections

Users are often encountered with questions or statements like:

1.       Do you want a site or a site collection?
    2.       The functionality has to be enabled at Site collection level
    3.       This feature is not available at site level

Site collection and Sites are both containers that store your data. The major difference is Sites can only be created under a Site collection. So in a way Site Collections are parent to Sites.
Due to the above relationship, Sites can and do inherit a lot of features from Site collections but at the same time there are a lot of differences between the two. Web application are one level above site collections. The figure below shows the relationship.


 
 
 
There are many differences between Sites and Site collections like:

·         You can apply quota to Site Collection but can not do it for site
    ·         Search settings can be better managed at Site collections
    ·         URL for Site collections can be more flexible using managed path

You can also create subsites under the sites. Sites are generally used for grouping the content within Site collection and same way subsites can be used to group the content within Sites.
You should consider following scenarios while choosing between site and site collection :

1.       Size – If your data is going to grow large, consider having a site collection. Sites sometimes compete with other sites within its parent site collection.

2.       Branding – If you want to brand your content similar to other Sites/ Site collection, it is a good option to create a Site or sub-site. This way you can easily inherit the branding of your parent site without much effort

3.       Look up list – You can not create look up lists when the data is in different site collection.

4.       Back up  - You can easily back up data if you have stored it in different DB which can be done using different site collection

5.       Security inheritance – You can easily inherit the security permission in a site , but can not be done across site collections

6.       Navigation – Navigation is consistent if you create multiple sites under same site collection.

List of features deprecated in SharePoint 2013


A lot of discussion is carried out to highlight the remarkable features added to SharePoint 2013. However there are many features in SharePoint 2010 which are not present or deprecated in SharePoint 2013. Although Microsoft has tried to provide alternatives for these, if you are migrating from older versions of SharePoint to 2013, you should be aware of these. Here is a list of such feature / functionalities:
 
1.       Web Analytics is not available – SharePoint 2013 has got new analytics processing component and your SharePoint 2010 web analytics will not be migrated to 2013

2.       Visual Upgrade – This option is not present as a part of 2013 migration. But you have an option to defer your site collection upgrade

3.       Discontinued templates/solutions

a.       Document workspace – This functionality is now part of teamsite site template
                  b.      Personalization site – Discontinued due to less use of this template
                  c.       Meeting workspace – Other features provide similar functionality
                  d.      Group work site – Discontinued due to less use of this template
                  e.      Visio Process Repository – Discontinued due to less use of this template

 
4.       Sandbox solution – This functionality is not available in 2013. However if you migrate sites with Sandbox solution they will still work (may go away in next version)
 
5.       Organization profile - This functionality is not available in 2013. But any existing solutions using Organization Profile will work on 2013. Although this will be removed in next major release.
 
6.       Insert Barcode – This command is no longer available in the ribbon.
 
7.       PowerPoint Broadcast – SharePoint expects users to leverage Lync 2013 for similar feature
 
8.       Slide libraries – This has been removed due to design limitation of SharePoint
 
9.       Windows classic mode authentication – Microsoft recommends using Clams Based authentication and does not provide Classic mode by default. Although you can enable this mode using powershell script
 
10.   Refreshing connected workbooks using Windows authentication through Office Web Apps Server
 
11.   Mysite Features – Following mysite features have been removed

a.       Recent activities webpart
                  b.      Colleagues functionality
 
12.   Search of RSS feeds – RSS feeds are no longer available as part of search result
 
13.   Custom Help - Help content added via the Custom Site Collection Help feature or HCINSTAL.EXE will no longer display in SharePoint Online.
 
14.   Chart Webpart – This webpart is not avaialbe any longer. Any migrated webpart will work in 2013 however it will be removed in next major release
 
15.   Deprecated search features

a.       Modifying the search topology using web interface – You can still do it using Powershell
                  b.      Diacritic sensitivity element in the thesaurus
                  c.       Replacement mode within the thesaurus
                  d.      Search Query web service
                  e.      Search RSS and search from Windows
                  f.        Custom word breaker dictionaries
                  g.       Configuration of stemming in the registry
                  h.      SharePoint Search SQL syntax
                  i.         Shallow search refiners
 
16.   Upload multiple documents – this has been replaced with drag and drop features
 
I will keep adding to this. Please provide your valuable comments.

Find Orphaned SharePoint Items using PowerShell script

The script below helps you find the orphaned items from SharePoint content databases

if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{Add-PSSnapin Microsoft.SharePoint.Powershell}


$CntDBs = Get-SPContentDatabase

ForEach ($CntDB in $CntDBs)
{   

      Write-Host "Detecting Orphans for " $CntDB.Name    $CntDB.Repair($false)
}


The above script will only list down the Orphaned items. You  can also repair these by changing

$CntDB.Repair($false) to $CntDB.Repair($true)

However before doing any such repair, you should be taking a back up of your DB.

Powershell scripts to Extract, import and deploy SharePoint farm solutions

When you are maintaining SharePoint Farm, you might often want to be able to extract all SharePoint solution in the farm, import it back and deploy it.

I have seen such requirements during the migration, creation or maintenance of various environments like Pre-Prod, production etc.
After searching it on Internet, here are the 3 powershell scripts I have found:

Extract all the farm solutions:

(Get-SPFarm).Solutions | ForEach-Object{$var = "C:\<LocationUWantToStoreWSP>\" + $_.Name; $_.SolutionFile.SaveAs($var)}

 
Import all the farm solutions:

Get-ChildItem | ForEach-Object{Add-SPSolution -LiteralPath $_.Fullname}

Deploy all solutions to farm:

Get-SPSolution | ForEach-Object {If ($_.ContainsWebApplicationResource -eq $False) {Install-SPSolution -Identity $_ -GACDeployment} else {Install-SPSolution -Identity $_ -AllWebApplications -GACDeployment}}



 





 

Email enable SharePoint list/Library

Users in SharePoint 2010 can enable the lists to recieve emails and update list items accordingly. This is a very good feature where you can easily pick up mails and track them in SharePoint.

For example, if you have a team that supports a system and you want to make sure that users can email your group, instead of setting a common DL or mailbox, you can now direct mails to your list. Your team can now look at the issue and update the list item. If some other team member wants to check the issue, he/she simply needs check the SharePoint list to get the current status.

Such lists are much better to monitor and report. Given below are the steps to enable your lists incoming email settings:


Once you have enabled incoming emails, test the setting by sending email to the mail ID(in this case TestUser@Intranet.com).

Please note that this is not a real email address, hence it might not be accessible from outside your network.

Copying SharePoint forms using Network location

I have recently come across this requirement where I had to copy some infopath forms from one SharePoint list to another.

Before going through the steps to copy the forms, it would be worth noting that, both the source and destination lists had same columns. If your source and destination does not have same columns, you might need to modify the infopath form at destination after copying.

Given below are steps to create a network location:



Once you have created the network location, you can use it as normal windows explorer window and copy forms as shown below.


Please be extra careful while using these Network locations as you might break the complete sharepoint site with it which will be difficult to recover from.

If possible, don't use the network location for copying content, as you can use the windows explorer view given in the Library ribbon

 

Managing alerts for other users

As a SharePoint site administrator or editor, you might want to create or delete alerts for other users. The steps given below can help you manage other user's alerts.

To delete the alert you can follow the steps below



For creating an alert for other user, you just need to follow the steps to create a new alert as given in the article SharePoint Alert Basics.

Once the alert window is open, in the Send Alert to section(Circled below), delete your name and add the other users name.





 

Open dialog/modal pop up on Image Click - Content editor webpart

I recently was trying to open a dialog/modal pop up window for a SharePoint page using an image link on Content editor webpart.

You can use the HTML below in your Content Eitor webpart and replace the links in with your page link.

<a onclick="NewItem2(event,”www.targetsiteforyou.com”); return false;" href="www.targetsiteforyou.com"><img width="45" height="40" alt="YourImage" src="www.yourimagelink.com " border="0"/></a>


This is very simple to implement and can give a very good navigation for your pages on SharePoint.

If you are using SharePoint Designer, you can also check the following post which uses HTML image button for similar functionality.Using image button with Modal pop up on SharePoint page

Error - One or more field types not installed properly - SharePoint Lookup Column

Recently, I was trying to move a list from one site collection to another. I created a list template in the source Site collection and uploaded the same in the destination.

Once the template was uploaded, I have created a list with it, however when the list was opened it threw the error: "One or more field types are not installed properly. Go to the list settings page to delete these fields.".

On analysis I found that this was caused because the newly created list (and the old one) contained a lookup column/field from another list. And the lookup list was not moved or present in my destination site collection. I tried deleting the look up columns from the new list, but got an error that I don't have access to the list. I further followed these steps to fix the problem:


  1. Created dummy list in my new site collection with the same name as required by lookup column/field. Since my source site collection was not available, I could not move the lookup list from there. If you have it available, please copy it to your destination. 
  2. Created a dummy lookup column/filed.
  3. Now the original lookup column which I could not delete was available for delete. I deleted it.
  4. Changed the name of the dummy lookup column/field created in step 2 to original look up column. If you don't require the lookup column/field, you can delete the dummy column also.
You can also avoid running into the issue, by just checking if you have a lookup column in the source list, and make sure that corresponding lookup lists are moved beforehand.

Document Sets


With SharePoint 2010, Microsoft has introduced the Document set which is a great new feature to manage documents. Document sets can be viewed as improved version of folder. It is a group of documents which can be considered as a single entity.
The most relatable example of usage of Document set is maintaining project documents. If you have a library to store documents related to project, you can create document set for project and store documents related to it. Few benefit of using document set is that:

  1. You can set property for the document set rather than individual documents
  2. You can configure documents to be automatically created for a document sets based on the template you provide. So if a project needs Estimation, Requirements, Design documents etc. you can configure the Document set to create them for you as soon as document set is created
  3. You can apply workflow etc. to all the documents in the document set together
  4. Document set can have its own customized welcome page
  5. You can version document set
  6. You will get additional settings in SharePoint designer with document sets
Technically, Document set is a content type and has to be enabled first at site collection level. You can follow the steps below to enable document sets if you have site collection administrator permission. If you don't, please contact your administrator to follow these steps.



Once the document set is activated, you need to activate the content type for your library and then add the content type for your library as shown below.



You can now start using Document set.  When you click on the document set under content type section on library, you can modify its property. Below is an example of how to create a Project content type exploring some of the features:

 
You can also modify the Document set content type to add more functionalities to it. http://office.microsoft.com/en-in/sharepoint-server-help/redir/HA101782461.aspx?CTT=5&origin=HA101782466