Collaboration, Technology, and New York

The blog for SharePoint, InfoPath, and Designer, along with business and technology insight….. plus a little NYC

10 things a SharePoint Architect should know before they go contracting

Written by Peter Ward on September 11, 2016 – 12:20 pm -

This was a presentation that I did at SharePoint Saturday Boston 2016

SharePoint – How to go contracting from Peter Ward

 

Add a comment

Add Trusted site in Google Chrome

Written by Peter Ward on May 29, 2016 – 5:53 pm -

  1. Click the 3 horizontal lines icon on the far right of the Address bar.
  2. Click on Settings, scroll to the bottom and click the Show Advanced Settings link.
  3. Click on Change proxy settings.
  4. Click the Security tab > Trusted Sites icon, then click Sites.
  5. Enter the URL of your Trusted Site, then click Add.

Add a comment

Bit of Powershell to upload photos to users profile

Written by Peter Ward on May 29, 2016 – 2:29 pm -

Firstly-  Need to run as an Admin user. Or if it’s your own account, add SP Shell Admin  using:  Add-SPShellAdmin -UserName Domain\user

It takes a bit of time to proper gate.

Instructions to run the upload profile photos Power Shell script

1. Login as sp.admin user or any other farm administratoruserto any of the SharePoint Server and copy and paste the script files to any folder on the server. The script files are already uploaded to  server at location “c:\scripts”

2. Open SharePoint Management Shell (run as administrator)

3. Copy the path of the folder where script resides

<#
.SYNOPSIS
   Upload-ProfilePhotos
.DESCRIPTION
   Bulk upload of profile pictures for SharePoint 2013. The script do not require property mapping and do not rewrites the PictureURL.
   Supports BMP, GIF, JPEG, PNG, TIFF, and WMF picture formats. Script should run in elevated process under the farm account! A nice feature is that if the pictures are uploaded with this script the profile picture of the user will be with the largest thumbnail possible so you will have better picture resolution compared to the AD import.
   First you will need to run the script with GenerateCSV parameter. A CSV file will be generated where you can fill the path to the picture for the specific profile(using Excel or your editor of choice).
   Paths to the photos can be local or network. 
   After you fill all the photo paths that you want. Run the script with UpdatePhotos parameter. The script will upload the photos and will run the native command Update-SPProfilePhotoStore to generate thumbnails and update the PictureURL.
   The script do not support multiple User Profile Service applications in single farm or partitioned User Profile Service application!

   If you are running the script in a fresh SharePoint installation, make sure that User Photos library exist in your My Sites host and also that there is a folder in it called Profile Pictures. If no user has a profile picture most probably the folder is missing. You can create it manually or by uploading a profile picture for some account and the folder will be created.
   If you are using SharePoint installation with language different than English.Please edit the Upload-ToUserPhotos according, there you will find the name of the library, the folder and the upload method.

   v1.1 - Parameter typo fixed, enhanced error handling. Supported doble quoted picture path(Example "C:\SomePic") You will see the actual exception message in order to find what is wrong. Thanks to jlai79

   Author: Ivan Yankulov [ SharePoint Administrator @ BulPros Consulting]
   Contact: http://spyankulov.blogspot.com
   About this script: http://spyankulov.blogspot.com/2014/08/bulk-upload-and-update-user-profile.html

.PARAMETER GenerateCSV
   Use this switch to generate CSV
.PARAMETER UpdatePhotos
   Use this switch to Upload and Update the photos
.PARAMETER CSVPath
   Path to the CSV file that contains the account data
.PARAMETER MySiteHost
   My Site host for your User Profile Service Application
.EXAMPLE
   .\Upload-ProfilePhotos.ps1 -GenerateCSV -MySiteHost http://mysite.auto.l:8080/

 Description
 -----------
 This will generate CSV file UserPhotoCSV.csv in the script execution directory
 .EXAMPLE
    .\Upload-ProfilePhotos.ps1 -UpdatePhotos -MySiteHost http://mysite.auto.l:8080/

 Description
 -----------
 This will use the default CSV file UserPhotoCSV.csv to upload and update the profile photos
.EXAMPLE
   .\Upload-ProfilePhotos.ps1 -GenerateCSV -CSVPath C:\ProfilePhotos.csv -MySiteHost http://mysite.auto.l:8080/

 Description
 -----------
 This will generate CSV file in custom location C:\ProfilePhotos.csv
 .EXAMPLE
    .\Upload-ProfilePhotos.ps1 -UpdatePhotos -CSVPath C:\ProfilePhotos.csv -MySiteHost http://mysite.auto.l:8080/

 Description
 -----------
 This will use CSV file in custom location C:\ProfilePhotos.csv to upload and update the profile photos
.LINK

http://spyankulov.blogspot.com


http://spyankulov.blogspot.com/2014/08/bulk-upload-and-update-user-profile.html

#>

[CmdletBinding(DefaultParameterSetName="GenerateCSV")]
Param(
    [parameter(ParameterSetName="GenerateCSV")]
    [switch]$GenerateCSV =$false,
    [parameter(ParameterSetName="UpdatePhotos")]
    [switch]$UpdatePhotos =$false,
    [parameter(Mandatory=$false)]
    [string]$CSVPath = ($PSScriptRoot + "\UserPhotoCSV.csv"),
    [parameter(Mandatory=$true)]
    [string]$MySiteHost
)
PROCESS{
Add-PSSnapin Microsoft.SharePoint.PowerShell
### Function region
Function Generate-CSV{
[CmdletBinding()]
param(
 [parameter(Mandatory=$true)]
    [string]$URL,
    [parameter(Mandatory=$true)]
    [string]$Path
)
Process{
    $Site = Get-SPSite -Identity $URL
    $context = Get-SPServiceContext -Site $site
    Try{
        $upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context) -ErrorAction Stop
    }Catch [System.Exception]{
        Write-Host "Unable to get the User Profiles !!! Folowing exception occurred: $($_.Exception.Message)" -ForegroundColor Red
        Break
    }
    $AllProfiles = $upm.GetEnumerator()
    $accounts = @()
    Clear-Content -Path $Path -ErrorAction SilentlyContinue
    Try{
        Add-Content -Value "RecordID,LoginName,PhotoPath" -Force -Path $Path -ErrorAction Stop
    }Catch [System.Exception]{
        Write-Host "Unable to generate CSV file to Path: `"$Path`", folowing exception occurred: $($_.Exception.Message)" -ForegroundColor Red
        Break
    }
    ForEach($profile in $AllProfiles)
    {
        Add-Content -Path $Path -Value "$($profile.RecordId.ToString()),$($profile.AccountName.ToString())"
    }
    Write-Host "A CSV file with Profile Information was generated: `"$Path`"" -ForegroundColor Green
    Write-Host "Fill the 'PhotoPath' column with the path to the users photo and run again the script with 'UpdatePhotos' parameter. " -ForegroundColor Green
}
}
Function Upload-ToUserPhotos{
 [CmdletBinding()]
 Param(
     [parameter(Mandatory=$true)]
    [string]$URL,
    [parameter(Mandatory=$true)]
    [string]$Path,
    [parameter(Mandatory=$true)]
    [string]$ID
 )
 Process{
    $docLibraryName = "User Photos"
    $docLibraryUrlName = "Profile%20Pictures"
    $web = Get-SPWeb $URL
    $docLibrary = $web.Lists[$docLibraryName]
    $file = Get-Item $Path
    #Open file
    $fileStream = ([System.IO.FileInfo] (Get-Item $file.FullName)).OpenRead()
    #Add file
    $folder =  $web.GetFolder($docLibraryUrlName)
    $spFile = $folder.Files.Add("/" + "User%20Photos" + "/" + $folder.Url + "/" + "0c37852b-34d0-418e-91c6-2ac25af4be5b_" + $ID + ".jpg", [System.IO.Stream]$fileStream, $true)
    #Close file stream
    $fileStream.Close();
    }
}
Function Update-Photos{
 [CmdletBinding()]
 Param(
     [parameter(Mandatory=$true)]
    [string]$URL,
    [parameter(Mandatory=$true)]
    [string]$Path
 )
Process{
    Try{
        $accountData = Import-Csv $Path -ErrorAction Stop
    }Catch [System.Exception]{
        Write-Host "Unable to load the CSV file from path: `"$Path`", folowing exception occurred: $($_.Exception.Message)" -ForegroundColor Red
        Break
    }
    ForEach ($acc in ($accountData | Where {$_.PhotoPath.Length -ge 2} ))
    {
        $photoPath = $acc.PhotoPath.Replace('"', "")
        If(Test-Path $photoPath -ErrorAction SilentlyContinue)
        {
            If((Get-Item -Path $photoPath).Extension -eq ".jpg")
            {    
                Copy-Item -Path $photoPath -Destination ($PSScriptRoot + "\tempPicture.jpg")
                Try{
                    Upload-ToUserPhotos -ID $acc.RecordID -Path ($PSScriptRoot + "\tempPicture.jpg") -URL $URL -ErrorAction Stop
                    Write-Host "Uploading picture for account: `"$($acc.LoginName)`"" -ForegroundColor Green
                }Catch [System.Exception]{
                    Write-Host "Unable to upload the picture for account: `"$($acc.LoginName)`", folowing exception occurred: $($_.Exception.Message)" -ForegroundColor Red
                }
                Remove-Item -LiteralPath ($PSScriptRoot + "\tempPicture.jpg") -ErrorAction SilentlyContinue
            }
            Else
            {
                Copy-Item -Path $photoPath -Destination ($PSScriptRoot + "\tempPicture.jpg")
                $convertedFile = ($PSScriptRoot + "\convertedPicture.jpg")
                Add-Type -AssemblyName system.drawing
                $image = [drawing.image]::FromFile(($PSScriptRoot + "\tempPicture.jpg"))
                $image.Save($convertedFile, [System.Drawing.Imaging.ImageFormat]::jpeg)
                $image.Dispose()
                Try{
                    Write-Host "Uploading picture for account: `"$($acc.LoginName)`"" -ForegroundColor Green
                    Upload-ToUserPhotos -ID $acc.RecordID -Path $convertedFile -URL $URL -ErrorAction Stop
                }Catch [System.Exception]{
                    Write-Host "Unable to upload the picture for account: `"$($acc.LoginName)`", folowing exception occurred: $($_.Exception.Message)" -ForegroundColor Red
                }
                Remove-Item $convertedFile -Force -ErrorAction SilentlyContinue
                Remove-Item -LiteralPath ($PSScriptRoot + "\tempPicture.jpg") -ErrorAction SilentlyContinue
            }
        }
        Else{
            Write-Host "Unable to get the picture for Account: $($acc.LoginName)" -ForegroundColor Red
        }
    }
        Try{
            Write-Host "Updating Profile Photo Store...." -ForegroundColor Green
            Update-SPProfilePhotoStore -MySiteHostLocation $URL -CreateThumbnailsForImportedPhotos:$true -ErrorAction Stop
        }Catch [System.Exception]{
            Write-Host "Unable to updating Profile Photo Store ! Folowing exception occurred: $($_.Exception.Message)"
        }
}
}

### Function region
switch ($PsCmdlet.ParameterSetName) 
{
    "GenerateCSV" { Generate-CSV -URL $MySiteHost -Path $CSVPath} 
    "UpdatePhotos" { Update-Photos -URL $MySiteHost -Path $CSVPath} 
}
}

Run following command to generate the CSV file:.\Upload-ProfilePhotos.ps1 -GenerateCSV -MySiteHost http://my.site:80/Following message should be displayed after running this command

A CSV file should have been generate at the location where the script file resides. Fill  PhotoPath column with the path to the users photo

Run following command to upload the photos.\Upload-ProfilePhotos.ps1 -UpdatePhotos -MySiteHost http://my.site.com:80/

8.Let the script complete, it should show message like above screen shot for the users for whom PhotoPath column is filled with correct location of the profile photo.

Add a comment

So you want to learn Sharepoint?

Written by Peter Ward on April 25, 2016 – 12:52 am -

I often get have conversations with people, who are looking for a collaborative technical solution to a problem, don’t know SharePoint and think SharePoint should be a good fit.

The first question they often ask is “Can you show me what SharePoint is?”

This is a problem, as it’s a large product.

But these videos help.

SharePoint in Plain English

What is SharePoint and Why We Use It

What is SharePoint | lynda.com

 

Add a comment

Thoughts in AgilePoint

Written by Peter Ward on March 7, 2016 – 12:05 am -

With the death nail on InfoPath, there’s a lot of talk on workflow and forms engines in SharePoint….We choose AgilePoint

Formotus is another option and they have a completely independent white paper that you can download from their web site.  Oh course it’ll be totally independent, given that it’s from their web site.  :)

The Good:- What’s really cool about the product

  1. 1.      UI:

-        User friendly development.

-        Easy to deploy and use.

-        Neat Mobile friendly forms available

-        Parallel process of two applications possible using sub process using no code.

-        SharePoint workflows in Agilepoint solve most purposes for which event receivers are needed.

-        Wide variety of controls available for various functionalities.

-        Different process models available for different uses. I.e. E-forms, Sharepoint Forms, System  Integration etc.

-        Can add Jquery/ CSS to controls easily through shared/ individual files.

  1. 2.      Runtime:

-        Detailed information about variables/fields used available at runtime.

-        Multiple data sources can be used at various events.

-        Running applications will continue to run when a new change is published, as a result of which the system doesn’t have to be brought down to deploy changes.

-        Can use APIs to access any kind of data from other resources.

  1. 3.      Product features:

-        SharePoint version independent will work with future versions.

-        Easy to be integrated into different systems because SharePoint, Sales force have AgilePoint Dashboards available.

-        Log in using various Authorization method possible. (OAuth2 covers a lot of authorization methods)

-        Very easy to export applications to other tenants and reuse them.

-        Globally reusable tokens can be created and exported to multiple application increasing reusability.

-        Individual forms also can be exported and re-used across multiple applications and tenants.

 

  1. 4.      On Premise /Private Cloud

-        Multiple tenants possible on a private cloud

-        Can access data stored in xml and create various reports based on the data

 

 

The Bad:

  1. UI:

-        Canvas designed in a way that plain text cannot be placed on a form. It has to be in controls.

-        Controls take up a specific size which cannot be changed in height. This does give a neater look but desired look is difficult (I may be biased as this is easily possible in MS word/ Infopath).

-        Nesting controls is difficult except put in subforms which in turn do not support a lot of controls

-        Custom HTML controls rendering is difficult.

-        Autosave doesn’t happen and the UI becomes unresponsive at time causing loss of data

  1. Runtime:

-        Lookups take a while to load.

-        Page submit actions can’t be modified.

-        Poor integration with IE

-        Offline modification of forms not possible

  1. Product Features:

-        Look and feel can’t be modified to look like SharePoint to maintain consistency

-        Difficult to integrate in SP if not using Agilepoint dashboards as a physical location of forms/tasks is not available

 

 

The Ugly:- What totally sucks

  1. UI:

-        Very poor support for multiple controls in design time and runtime. Hence not suitable for larger forms.

  1. Runtime:

-        Cant access forms from a physical location as forms are available as tasks. This is usually a major requirement by the client.

-        Cant access data on the forms anywhere hence can’t be put in reports easily.

 

Add a comment

SharePoint Professionals Must Embrace Modern APIs

Written by Peter Ward on February 28, 2016 – 11:14 am -

An extract from an article I wrote for Redmond Magazine.

For the straight hardcore SharePoint developer who only knows SQL, ASP.NET and MVC, the rapid shift by enterprises to SaaS-based Office 365 SharePoint Online is sure to reduce your work hours at the very least and quite possibly eliminate the need for your job at some point. This transition has been going on for some time as GitHub libraries for JavaScript, HTML5, and CSS are now in the mix when it comes to building SharePoint apps.

Click here to read full article

Add a comment

Microsoft SharePoint 2013 Disaster Recovery Guide- Special Offer

Written by Peter Ward on February 14, 2016 – 9:00 pm -

With this code:  MSPDRG50      before March 5th

 

Click here

 

 

Add a comment

Will SaaS Kill the SharePoint Server Team?

Written by Peter Ward on February 4, 2016 – 4:40 am -

This is an article I wrote for Redmond Magazine.  Why SharePoint professionals need to embrace SharePoint’s new API model of development and deployment.

SharePoint is often touted as the Swiss Army knife of enterprise collaboration and productivity. But like most blades on a Swiss Army knife, each separate tool isn’t always that sharp or practical as the user would like them to be. For that reason, I predict that SharePoint developers, like other developers, will become mostly APIs or API plumbers.

See full article- Part I

 

Add a comment

Sharepoint branding.. No quick fix

Written by Peter Ward on January 24, 2016 – 11:39 am -

I’ve looking at the product bindtuning for a straight forward approach to SharePoint branding.

One of the biggest complaints with customers on branding is that it’s always a science project to get anything done that makes the site pop out.  The Bindtuning approach gives the user a WordPress feel of point, click and color, ‘Without the let me get back to you in 2 days’ SharePoint consultant’s response.

Solutions like this do heavy customization and uses master to customize the look and feel of the site…. All good….  Well not quite.

The guidelines of SharePoint online branding suggested in below reference links recommends you should not customize the master page otherwise it would require more maintenance to apply upgrades

https://msdn.microsoft.com/en-us/library/office/dn985871.aspx

Use the SharePoint page model and composed looks, the SharePoint 2013 theming engine, and CSS to brand your SharePoint site and pages.

http://www.degdigital.com/blog/dos-and-donts-for-custom-sharepoint-online-designs

http://www.microsofttrends.com/2015/05/07/latest-advice-on-office-365-branding/

So it’s back to the manual approach.

  1. Use SharePoint Themes to change color throughout the sites
  2. Use JavaScript to inject UI components
  3. Use alternate CSS file to give responsive look and feel to the site

In the end there is no substitute for UI design capabilities on a team, the only question is how do you attract, and retain the talent.

One observation of Bindtuning, is that they aren’t exclusively SharePoint, which is unusual as a SharePoint vendor, so this would suggest they that SharePoint can only provide them breakfast, rather than lunch and dinner.

Add a comment

Happy halloween

Written by Peter Ward on November 2, 2015 – 10:41 am -

Add a comment