Let's SharePoint

May 2017

  1. HOME
  2. Monthly Archives: May 2017
May 27, 2017 / Last updated : May 27, 2017 Sethu PowerShell

How to Create a document set using JSOM in SharePoint online/Office 365?

Hello SharePointers, Here is the JSOM code to create a document set using JSOM.   docSetName = “RequirementDocset; var context = new SP.ClientContext(_spPageContextInfo.webServerRelativeUrl); var list = context.get_web().get_lists().getById(‘GUID of List’); context.load(list); var itemCreateInfo = new SP.ListItemCreationInformation(); itemCreateInfo.set_underlyingObjectType(SP.FileSystemObjectType.folder); itemCreateInfo.set_leafName(docSetName); var listitem listitem= list.addItem(itemCreateInfo); listitem.set_item(“ContentTypeId”, “GUID”); listitem.set_item(‘Title’, docSetName); listitem.set_item(‘DocumentSetDescription’, “This is Req set Document Set”); listitem.set_item(‘ChartIdlookup’, itemid); listitem.update(); […]

May 27, 2017 / Last updated : May 27, 2017 Sethu PowerShell

How to remove permission for a group from SharePoint 2010/2013 using Powershell?

Hello SharePointers, Here are the powershell script to remove the Full Control permission from owners group. $web = get-spweb http://mysharepoint $group = $web.SiteGroups[“Owners”] $role = $group.ParentWeb.RoleAssignments.GetAssignmentByPrincipal($group) $roledef= $group.ParentWeb.RoleDefinitions[“Full Control”] $role .RoleDefinitionBindings.Remove($roledef) $role .Update() $group.Update() $web.Dispose() Happy SharePointing 🙂

May 25, 2017 / Last updated : May 25, 2017 Sethu Client Side Object Model

How to Set People Picker value in SharePoint using CSOM and Powershell?

Hello SharePointers, Below are the CSOM script to set/populate People Picker value in a SharePoint list . $userName = “domain\username” $spuser = EnsureUser $context $userName $lookupValue = @() if($spuser -ne $null){ $spuserValue = New-Object Microsoft.SharePoint.Client.FieldUserValue $spuserValue.LookupId = $spuser.id $lookupValue += $spuserValue } $userValue = [Microsoft.SharePoint.Client.FieldUserValue[]]$lookupValue $listItem[“Your People Picker FieldColumn name”] = $userValue $listItem.Update() Happy SharePointing […]

May 25, 2017 / Last updated : May 25, 2017 Sethu Customization

How to get SharePoint list item counts using REST API?

Hello SharePointers Below is REST API code to get the sharepoint list item counts using REST API. var ListUrl = _spPageContextInfo.webServerRelativeUrl + “/_api/web/lists/getbytitle(‘yourlistname’)/items”; getJsonFormat(ListUrl) .done(function(data) { var itemsCount = data.d.results.length;  }) .fail( function(error){ console.log(JSON.stringify(error)); }); function getJsonFormat(ListUrl) { return $.ajax({ url: ListUrl, type: “GET”, contentType: “application/json;odata=verbose”, headers: { “Accept”: “application/json;odata=verbose” } }); } Happy SharePointing […]

May 24, 2017 / Last updated : May 24, 2017 Sethu Office 365

How to get the list of running Timer Jobs in SharePoint 2010/2013/2016?

Hello SharePointers, Below is the Powershell Script to find the list of timer jobs in SharePoint 2010/2013/2016. # Get current date $date = Get-Date # Show current date Write-Host “Looking for running Timer jobs with a Last Run Time to” $date # Get all Timer jobs and iterate Get-SPTimerJob | ForEach-Object { # Get last run […]

May 24, 2017 / Last updated : May 24, 2017 Sethu Client Object Model

How to OverCome limitations of uploading 2 MB File limit in SharePoint Using CSOM?

Hello SharePointers, In SharePoint Online, 2013, 2016 environments , we can  use CSOM to upload files into document library. While uploading Large files, there is a limitation of 2 MB . To overcome this, we can use the below CSOM script. The below method will allows you to upload upto 10 MB. public void UploadDocumentusingContentStream(ClientContext cc, […]

May 24, 2017 / Last updated : May 24, 2017 Sethu Customization

The User Does Not Exist or is Not Unique occurs in People Picker in SharePoint 2010/2013?

Hello Sharepointers, When you are using people picker in your sharepoint project/app, if you add two or more users in the people picker. You will face this issue”The User Does Not Exist or is Not Unique”. To resolve it , we need to change the People picker field schema in the following fashion. By Default […]

May 23, 2017 / Last updated : May 23, 2017 Sethu Client Side Object Model

How to query User Information List using Powershell?

Hello SharePointers, Below is the Powershell script to query User Information List for a particular sharepoint group. $List = $web.Lists.GetByTitle(‘User Information List’) $userItem = $List.GetItemById(‘GROUP NAME’); $ctx.Load($userItem) $ctx.ExecuteQuery() $obj = New-Object PSObject $obj | Add-Member -type NoteProperty -Name Title -Value $userItem[‘Title’] $obj | Add-Member -type NoteProperty -Name UserName -Value $userItem[‘UserName’] $obj | Add-Member -type NoteProperty -Name […]

May 23, 2017 / Last updated : May 23, 2017 Sethu Customization

How to calculate total size of a Document library using Powershell in SharePoint 2013/2010/2016?`

Hello SharePointers, Below are the script to find the actual size of documents in document library using Powershell. foreach ($web in $site.AllWebs) { $DocLibSize=0 $count=0 foreach ($list in $web.Lists) { if($list.BaseTemplate -eq “DocumentLibrary”) { $itemSize = 0 foreach ($item in $list.items) { $itemSize += ($item.file).length } $itemSize= [Math]::Round(($itemSize/1MB),2) Write-Host $itemSize “MB ” $DocLibSize+=$itemSize } } […]

May 20, 2017 / Last updated : May 20, 2017 Sethu REST API's

How to Get List of folders and files in SharePoint Document library using REST API in SharePoint online/Office 365?

Hello SharePointers, Below is the REST API snippet to find folders and files inside the folder url of a sharepoint document library. var folderUrl = ‘myfolder/2016’; var url = _spPageContextInfo.webServerRelativeUrl + “/_api/Web/GetFolderByServerRelativeUrl(‘” + folderUrl + “‘)?$expand=Folders,Files”; $.getJSON(url,function(data,status,xhr){ for(var i = 0; i < data.Files.length;i++){ console.log(data.Files[i].Name); } for(var i = 0; i < data.Folders.length;i++){ console.log(data.Folders[i].Name); } […]

Posts navigation

  • Page 1
  • Page 2
  • »

Recent posts

How to insert table in Modern Pages using PnP Powershell in Office 365/Sharepoint Online?

June 7, 2019

How to set up Access Requests in SharePoint online using Powershell?

May 11, 2019

How to change the default SharePoint suite logo in SharePoint 2013/2016/2019?

April 30, 2019

How to add metadata to Document libraries in SharePoint online using powershell.

April 27, 2019

How to get Sharepoint site details using Powershell in Office 365?

April 17, 2019

How to get alerts for a specific policy in Cloud app security using Powershell

April 16, 2019

How to get the list of custom apps in App catalog using Powershell?

April 9, 2019

How to get the list of policies in Microsoft Cloud app security using window powershell?

April 4, 2019

How to get the list of List and Document library item counts in SharePoint online using Pnp Powershell ?

April 4, 2019

How to restore subsite in a Sharepoint online site collection using Pnp Powershell

April 2, 2019

Category

  • Anonymous access
  • Client Object Model
  • Client Side Object Model
  • Customization
    • Customization
  • Designer Workflows
  • Errors & Resolutions
  • Features
  • Google Analytics
  • InfoPath
  • Item Scheduling
  • JSOM
  • Nintex worflows
  • Office 365
  • Office 365 Groups
  • PnP JS Library
  • PowerShell
  • Powershell Online
  • REST API
  • REST API's
  • Server Side Object Model
  • SharePoint 2010
  • SharePoint 2010 Search
  • SharePoint 2013
  • SharePoint 2013 Search
  • SharePoint 2013 Workflows
  • SharePoint 2016
  • SharePoint 2019
  • SharePoint Designer
  • SharePoint Framework
  • SharePoint Online
  • SharePoint Pnp
  • SharePoint Usage Analytics
  • Unique values
  • User Profile Services
  • Windows Powershell
  • Workflow Manager

Archive

  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • January 2016
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • May 2015
  • April 2015
  • March 2015

Copyright © Let's SharePoint All Rights Reserved.

Powered by WordPress & Lightning Theme by Vektor,Inc. technology.