Add Yes/No (Check Box) Field to SharePoint List using PowerShell

March 31, 2017    , , ,
Requirement: Add Yes/No (Check box) field to SharePoint List How to Create Yes/No Check box column in SharePoint List? Follow these steps to add a Yes/No field to SharePoint List. Browse to your SharePoint site and Navigate to the target list in which you want to add Yes/No column. Under the List tab, click on "Create Column" button in the ribbon. Provide the Name to your new column, specify the type as "Yes/No Check box"  Fill other optional values such as field description, Default Value and Click on "OK" to create Yes/No check box field in SharePoint list. SharePoint PowerShell to Create Yes/No Field in List or Library: Use this PowerShell script to add Yes/No column to SharePoint list. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Function to add Field to list Function Add-YesNoFieldToList() { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Parameter(Mandatory=$true)] [
Add Yes/No (Check Box) Field to SharePoint List using PowerShell Add Yes/No (Check Box) Field to SharePoint List using PowerShell Reviewed by Salaudeen Rajack on March 31, 2017 Rating: 5

Find and Replace User ID in SharePoint InfoPath Forms using PowerShell

March 30, 2017    , , , ,
Requirement: Replace User IDs in InfoPath Forms. Little background: A particular user's User account changed in Active directory and in SharePoint we ran Move-SPUser cmdlet to accommodate the user's SAM account name change. However, There are many InfoPath form libraries with bunch of InfoPath forms in it - with old user id. Of course, Move-SPUser has no effect on InfoPath Forms! PowerShell script to search and replace user id in InfoPath XML Forms: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Configuration Parameters $SiteCollURL="http://intranet.crescent.com" #Old and New User IDs - CASE SENSITIVE! $OldUserID="<pc:AccountId>i:0#.w|Crescent\JohnA</pc:AccountId>" $NewUserID="<pc:AccountId>i:0#.w|Crescent\JonhAbraham</pc:AccountId>" #Get all webs in the site collection $WebsColl = Get-SPSite $SiteCollURL | Get-SPWeb -Limit All #Iterate through each web foreach($web in $WebsColl) {
Find and Replace User ID in SharePoint InfoPath Forms using PowerShell Find and Replace User ID in SharePoint InfoPath Forms using PowerShell Reviewed by Salaudeen Rajack on March 30, 2017 Rating: 5

Get All List and Libraries Inventory of a SharePoint Site Collection using PowerShell

March 30, 2017    , , , ,
Requirement: Get All Lists and Libraries Inventory of a SharePoint Site Collection PowerShell to Get Site Collection Inventory: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Site collection Variable $SiteURL="http://intranet.crescent.com" $ReportOutput="C:\SiteInventory.csv" #Get the site collection $Site = Get-SPSite $SiteURL $ResultData = @() #Ge All Sites of the Site collection Foreach($web in $Site.AllWebs) { Write-host -f Yellow "Processing Site: "$Web.URL #Get all lists - Exclude Hidden System lists $ListCollection = $web.lists | Where-Object { ($_.hidden -eq $false) -and ($_.IsSiteAssetsLibrary -eq $false)} #Iterate through All lists and Libraries ForEach ($List in $ListCollection) { $ResultData+= New-Object PSObject -Property @{ 'Site Title' = $Web.Title 'Site URL' = $Web.URL 'List-Library Name' = $List.Title
Get All List and Libraries Inventory of a SharePoint Site Collection using PowerShell Get All List and Libraries Inventory of a SharePoint Site Collection using PowerShell Reviewed by Salaudeen Rajack on March 30, 2017 Rating: 5

SharePoint Online: PowerShell to Download All Files from a Document Library

March 29, 2017    , , ,
Requirement: PowerShell to download all files from a SharePoint Online document library.   SharePoint Online: Download All Files from a Library using PowerShell CSOM Why PowerShell? Because, Explorer view didn't work! #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Function Download-FilesFromLibrary() { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Parameter(Mandatory=$true)] [string] $LibraryName, [Parameter(Mandatory=$true)] [string] $TargetFolder ) Try { #Setup Credentials to connect $Cred= Get-Credential $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Setup the
SharePoint Online: PowerShell to Download All Files from a Document Library SharePoint Online: PowerShell to Download All Files from a Document Library Reviewed by Salaudeen Rajack on March 29, 2017 Rating: 5

SharePoint Online: Get Content Type Inventory Report using PowerShell

March 28, 2017    , , ,
Requirement: SharePoint Online PowerShell to get content types report. SharePoint Online: Get Content Types using PowerShell Lets get all content types of a SharePoint Online site using PowerShell and export them to a CSV file #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Config Parameters $SiteURL="https://crescent.sharepoint.com" $OutputFile ="C:\Temp\ContentTypes.csv" Try { #Get Credentials to connect $Cred= Get-Credential #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Get all content types from the web
SharePoint Online: Get Content Type Inventory Report using PowerShell SharePoint Online: Get Content Type Inventory Report using PowerShell Reviewed by Salaudeen Rajack on March 28, 2017 Rating: 5

SharePoint Online: Create List Item based on Specific Content Type

March 27, 2017    , ,
Requirement: Add list item with specific content type in SharePoint Online. How to Add a New List of specific content type in SharePoint Online? Say we've a customized content type "Business Contacts" for contacts list and want to add a new item of the given content type. To create new list item of a specific content type in SharePoint Online, Simply select the desired content type from the "New" menu of that list! In my case, I've selected "Business Contacts" from the "New" item drop down instead of simply clicking on "New" button of the list. PowerShell to create a list item of particular content type: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Co
SharePoint Online: Create List Item based on Specific Content Type SharePoint Online: Create List Item based on Specific Content Type Reviewed by Salaudeen Rajack on March 27, 2017 Rating: 5

How to Use Choice Field in Lookup Columns in SharePoint?

March 26, 2017    
Problem: Could not create lookup columns on Choice field in SharePoint list! Solution: Not all column types are supported in lookup column. Supported column types are: Single line of text,  Number, Date and Time,  Calculated (Single Line of text),  External Data So, what's the trick? Well, in the parent lookup list, Create new calculated column from the choice field in the list and you can use that choice field in lookup fields on any other list! Now, you'll be able to create lookup on choice field!
How to Use Choice Field in Lookup Columns in SharePoint? How to Use Choice Field in Lookup Columns in SharePoint? Reviewed by Salaudeen Rajack on March 26, 2017 Rating: 5

Remove "Show More" in SharePoint Task List

March 24, 2017    , , ,
Requirement: Remove "Show More" in SharePoint task list new and edit forms! By default, SharePoint On-premises or SharePoint Online New task or Edit task forms displays only the first Four fields from the task list and when user clicks on "Show More" link, all other fields of the task list are displayed.  How to Remove SharePoint task list remove show more in SharePoint Online? To remove show more and display all fields of the task list, follow these steps: Navigate to your Task list New form (such as: https://crescent.sharepoint.com/Lists/Tasks/NewForm.aspx) by clicking  on "New Task". From the Site settings gear icon, click on "Edit Page" >> Click on "Add a web part" link and then insert a "Script Editor" web part. Click on "Edit Snippet" link on the web part and insert this CSS in the script editor web part, save and close the page. <style type="text/css"> /* Remove "show m
Remove "Show More" in SharePoint Task List Remove "Show More" in SharePoint Task List Reviewed by Salaudeen Rajack on March 24, 2017 Rating: 5

SharePoint Online: Update Choices in Choice Field using PowerShell

March 23, 2017    , , ,
Requirement: Update choice field choices in SharePoint Online using PowerShell SharePoint Online: PowerShell to Update Choice Field #Load SharePoint Online Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" ##Variables for Processing $SiteUrl = "https://crescenttech.sharepoint.com" $ListName= "Projects" $FieldName="Category" #Define Choices $Choices = @("Growth Capital","Private Investment","Development", "Start up", "Real Estate") #Get Credentials to connect $Cred= Get-Credential $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Set up the context $Ctx = New-Object Microsoft.SharePoint.Client
SharePoint Online: Update Choices in Choice Field using PowerShell SharePoint Online: Update Choices in Choice Field using PowerShell Reviewed by Salaudeen Rajack on March 23, 2017 Rating: 5

SharePoint Online: Create a Document Library or List with New Experience UI using PowerShell-CSOM

March 21, 2017    , , , ,
The new list and library experience in SharePoint Online improves the user experience by providing many features such as navigation, fast response, mobile UI, easier to use, etc. You can switch between classic & new experiences anytime. Here is the PowerShell-CSOM script to create a document library in SharePoint online with new experience UI. PowerShell Script to create a document library in new experience UI: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" ##Variables for Processing $SiteUrl = "https://crescent.sharepoint.com/Projects" $UserName="salaudeen@crescent.com" $Password ="Password goes here" #Setup Credentials to connect $Credentials = New-Object Microsoft.SharePoint.Cli
SharePoint Online: Create a Document Library or List with New Experience UI using PowerShell-CSOM SharePoint Online: Create a Document Library or List with New Experience UI using PowerShell-CSOM Reviewed by Salaudeen Rajack on March 21, 2017 Rating: 5

SharePoint Online: How to Restore a Deleted Site Collection using PowerShell?

March 15, 2017    , , , , ,
Requirement: Restore a Deleted Site Collection in SharePoint Online. How to Restore a Deleted Site Collection in SharePoint Online? SharePoint Online recycle bin provides the ability to recover even when an entire site collection is deleted. To restore a deleted site collection in SharePoint Online, follow these steps: Login to SharePoint Online Admin Center >> Click on "Site Collection" link in left navigation. On the ribbon, Click on "Recycle Bin" button. You'll see the list of all Site Collections which are deleted along with when they were deleted, and how many days are remaining before they disappear from the recycle bin. To restore deleted site collection, Select the site collection that you want to restore in the Recycle Bin page, Click on "Restore Deleted Items" button in the Ribbon  Click on "Restore" button in the Popup window to restore the selected site collection. SharePoint Online: PowerShell to Restore
SharePoint Online: How to Restore a Deleted Site Collection using PowerShell? SharePoint Online: How to Restore a Deleted Site Collection using PowerShell? Reviewed by Salaudeen Rajack on March 15, 2017 Rating: 5

SharePoint Online: Get All List Items with Unique Permissions using PowerShell

March 12, 2017    , , , ,
Requirement: Get All SharePoint Online List Items with Unique Permissions using PowerShell How to Check if a list Item is using Unique permissions or inheriting permissions from the parent? To get if a SharePoint Online list Item or File in a document library has unique permissions, follow these steps: Navigate to the list/library and then select the list item. From the details pane, Click on "Manage Access" link (in Classic experience, Click on "Advanced" >> "Shared With") and then click on "Advanced" link. This takes you to the Advanced permissions page of the list item, which gives you the information whether the list item has unique permissions or its inheriting permissions from the parent. E.g. You'll get the text " This list item has unique permissions " SharePoint Online: PowerShell to Get All List Items with Unique Permissions: Lets get all list items with unique permissions using PowerShell. #Load Shar
SharePoint Online: Get All List Items with Unique Permissions using PowerShell SharePoint Online: Get All List Items with Unique Permissions using PowerShell Reviewed by Salaudeen Rajack on March 12, 2017 Rating: 5

Fix "Unfortunately, help seems to be broken...There aren't any help collections in the current language for the site you're using." Error in SharePoint 2016

March 08, 2017    ,
Problem: The Help Menu (?) in SharePoint 2016 is not working! On clicking the Help menu, it gets the error message: "Unfortunately, help seems to be broken... There aren't any help collections in the current language for the site you're using." Troubleshooting Steps:  Enable External Web-based Help in Privacy Options of SharePoint 2016 Central Admin. Navigate to : http://central-admin-url/_admin/privacy.aspx , and Set "Yes" to "Display Help from external web Sites as specified by each Help collection?" Check the help collection status and install if needed: Open SharePoint 2016 Management Shell, Run: Get-SPHelpCollection It gave nothing. Guess help collection is not installed. Now, Install help collection by running: Install-SPHelpCollection -All wait for few minutes to get them installed (10 min!). Try close and reopen the SharePoint 2016 sites! Now, SharePoint 2016 help should work.
Fix "Unfortunately, help seems to be broken...There aren't any help collections in the current language for the site you're using." Error in SharePoint 2016 Fix "Unfortunately, help seems to be broken...There aren't any help collections in the current language for the site you're using." Error in SharePoint 2016 Reviewed by Salaudeen Rajack on March 08, 2017 Rating: 5
Powered by Blogger.