SharePoint Online: How to Delete a File from Document Library using PowerShell?

February 25, 2017    , , , ,
Requirement:   Delete a file from SharePoint Online document library using PowerShell How to Delete a File in SharePoint Online? To delete a single document from a library, do the following: In SharePoint Online site, Navigate to the document library.  Select the File you want to delete and Click on "Delete" button from the toolbar. You can also select and delete multiple files! Confirm delete by clicking on "Delete" button in the confirmation popup.  You can also hover over the document you want to delete and click on "Delete" from the context menu. You'll find a notification in the top of the document library telling you that the item has been deleted. The deleted item is moved to the site's recycle bin . SharePoint Online: PowerShell to Delete a File from Document Library Here is how to delete a SharePoint Online file using PowerShell #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Sh
SharePoint Online: How to Delete a File from Document Library using PowerShell? SharePoint Online: How to Delete a File from Document Library using PowerShell? Reviewed by Salaudeen Rajack on February 25, 2017 Rating: 5

Set Global Search Center in SharePoint 2016

February 24, 2017    , , , ,
So, you have your search center site ready for SharePoint 2013 (Use this article: Create Enterprise Search Center using PowerShell ) as a next step, you should configure global search center from SharePoint central admin site to set default search center site for all site collections. SharePoint 2016 default search center Once the search center site collection is created, navigate: Central Administration >> Application Management >> Service Applications Click on the Search Service Application >> In Search Administration page, Click on "Set a Search Center URL" link Enter the URL of your Enterprise Search Center Site collection that you created and add "/pages" at the end. In my case, its "http://searchcenter.crescent.com/pages" By this, we've instructed the SharePoint Search Service Application to use this site to submit search queries and view search results. Change Global Search Center URL with PowerShell You can al
Set Global Search Center in SharePoint 2016 Set Global Search Center in SharePoint 2016 Reviewed by Salaudeen Rajack on February 24, 2017 Rating: 5

Add Rich Text Column in SharePoint Document Library

February 22, 2017    , , , ,
Problem: Could not add rich text columns to SharePoint document library, Picture Library and other type of Libraries! Little background: End user created in document library with type "Description" column as "Multiple lines of text"and expecting this column to is expecting to have the Rich text capability. so, tried editing the column, and found no option to update the type of this column as rich text! Troubleshooting: When you add a Multiple lines of text field to custom list, announcement, tasks, etc, You'll find the Rich text and Enhanced rich text options. However on document libraries, these options seems missing! It just displays a Text area without any formatting! It seems you can't have a rich text column in a document library with SharePoint 2013. So, How do we create Rich Text column for a Document Library? Solution: How to Add Rich Text Field to SharePoint Document Library? While there are many options to get rich text field in SharePo
Add Rich Text Column in SharePoint Document Library Add Rich Text Column in SharePoint Document Library Reviewed by Salaudeen Rajack on February 22, 2017 Rating: 5

Fix "Get-SPOSite: The Site 'https://tenant.sharepoint.com/' is not properly formed" Error in SharePoint Online

February 21, 2017    , ,
Problem: When trying to connect to SharePoint Online site collection, got this error message "Get-SPOSite The Site Tenant-URL is not properly formed." Solution: Solution is simple! Just remove the trailing "/" from the URL! E.g. In my case, instead of " https://crescent.sharepoint.com/sites/marketing/ ", I had to removing the backslash "/ "after marketing. So the right format of my site collection is: " https://crescent.sharepoint.com/sites/marketing "
Fix "Get-SPOSite: The Site 'https://tenant.sharepoint.com/' is not properly formed" Error in SharePoint Online Fix "Get-SPOSite: The Site 'https://tenant.sharepoint.com/' is not properly formed" Error in SharePoint Online Reviewed by Salaudeen Rajack on February 21, 2017 Rating: 5

Compare SharePoint List Item Version History using PowerShell

February 19, 2017    , , , , ,
Requirement: Compare version history data of SharePoint List items and update a metadata column based on a particular field's value change. Bit background: We've a project tracking list with "Status" column. We wanted to have a insight on when a particular item's status was set to "Rejected". PowerShell to Compare Version History Data and update a Column value: As far solution to the above requirement, lets compare list item versions to capture when a particular item's "status" column was changed to "rejected", and get the created date of the specific version to update "Rejected Date" column of the list item. Lets compare version history in SharePoint using PowerShell: Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue #Parameters $SiteURL="http://intranet.crescent.com" $ListName = "Projects" #Get web and List $Web = Get-SPWeb $SiteURL $List = $web.Lists.TryGetList(
Compare SharePoint List Item Version History using PowerShell Compare SharePoint List Item Version History using PowerShell Reviewed by Salaudeen Rajack on February 19, 2017 Rating: 5

SharePoint Online: Change User Permissions using PowerShell

February 19, 2017    , , ,
Requirement:   Edit user permissions in SharePoint Online How to change user permissions  in SharePoint Online? You want to change user's permission on a particular site/library/item in SharePoint online. E.g. Once a particular project has completed and you no longer want the team member to add or edit the project's supporting documents but only view! SharePoint provides a flexible way to manage permission changes to a user or a group. Here is how to update user permissions in SharePoint online. To edit site permissions for a user, Navigate to the SharePoint Online site where the user has access. Click on Settings gear and then site settings. On the Site Settings page, click on "Site Permissions" link under Users and Permissions group. On the site permissions page, Select the check box next to the user which you want to edit permissions. Click on "Edit User Permissions" button from the ribbon. Select-Unselect the relevant permissions check boxes.
SharePoint Online: Change User Permissions using PowerShell SharePoint Online: Change User Permissions using PowerShell Reviewed by Salaudeen Rajack on February 19, 2017 Rating: 5

SharePoint Online: Change Group Permissions using PowerShell

February 19, 2017    , , , , ,
Requirement: SharePoint Online Change Group Permissions How to Update permissions for a SharePoint group? To edit group permissions in SharePoint Online, following these steps: Login to your SharePoint Online site as a administrator >> On the site collection Home page, click on Settings icon >> Click Site settings. On the Site Settings page, under Users and Permissions, click on Site permissions. Select the check box of the group to which you want to change permissions (either to grant additional rights or to revoke existing permissions). In the Modify section of the ribbon, click on "Edit User Permissions" button. On the Edit Permissions page, select/deselect the group permission check boxes according to your requirement. You can simply tick a checkbox next to permission levels such as "Contribute" to grant permission or uncheck to remove permission from the group. Click OK to save permission changes to the group. Now, Lets edit group
SharePoint Online: Change Group Permissions using PowerShell SharePoint Online: Change Group Permissions using PowerShell Reviewed by Salaudeen Rajack on February 19, 2017 Rating: 5

SharePoint Online: Remove Site Collection Administrator using PowerShell

February 19, 2017    , , , ,
Requirement: Remove Site collection Administrator using PowerShell in SharePoint Online. How to remove site collection administrator(s) in SharePoint Online? Site collection administrators in SharePoint Online have full control for the entire site collection, including the root site and all the sub-sites, lists and libraries in the site collection. To remove a site collection admin, follow these steps: Login to SharePoint Online site as a SharePoint Online Administrator or Site collection Administrator Click on Settings gear and then Site Settings On the site settings page, click on "Site Collection Administrators" link Remove unwanted users from the site collection administrators and click on "OK" to save your changes. SharePoint Online: PowerShell to Remove Site Collection Administrator To remove a user from site collection administrators rights for a particular SharePoint Online site collection, use this PowerShell script in SharePoint Online Manag
SharePoint Online: Remove Site Collection Administrator using PowerShell SharePoint Online: Remove Site Collection Administrator using PowerShell Reviewed by Salaudeen Rajack on February 19, 2017 Rating: 5

SharePoint Online: Get List By Title, GUID using PowerShell

February 17, 2017    , , ,
SharePoint Online: PowerShell to Get List by Title  Here is how to get list by its title. #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://crescenttech.sharepoint.com" $ListName="Documents" #Setup Credentials to connect $Cred= Get-Credential $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = $Credentials #Get the List $List=$Ctx.Web.Lists.GetByTitle($ListName) $Ctx.load($List) $Ctx.ExecuteQuery() Write-host "Total Number of List Items:"$List.ItemCount Get List by ID (GUID) in
SharePoint Online: Get List By Title, GUID using PowerShell SharePoint Online: Get List By Title, GUID using PowerShell Reviewed by Salaudeen Rajack on February 17, 2017 Rating: 5

Fix for SharePoint 2016 Project Templates Missing in Visual Studio 2015

February 14, 2017    , ,
Problem: SharePoint Project Templates are missing in Visual Studio 2015! Solution: We need to install "Microsoft Office Developer Tools for Visual Studio 2015" for SharePoint 2016 project templates in Visual Studio 2015. For SharePoint 2010/2013, download and install: Microsoft Office Developer Tools for Visual Studio 2015 For SharePoint 2016, Download and install: Update 2 for Microsoft Office Developer Tools for Visual Studio 2015 Once installed, You should see SharePoint 2016 project templates in Visual Studio 2015!
Fix for SharePoint 2016 Project Templates Missing in Visual Studio 2015 Fix for SharePoint 2016 Project Templates Missing in Visual Studio 2015 Reviewed by Salaudeen Rajack on February 14, 2017 Rating: 5

SharePoint Online: Get All Users in Site Collection using PowerShell

February 11, 2017    , , , ,
Requirement: SharePoint Online PowerShell to Get All Users in Site Collection While my another post addresses How to Get All Users and Groups in SharePoint Online , this post aims to get all users of the SharePoint site collection. SharePoint Online: PowerShell Get All Users of the Site Collection Here is the SharePoint Online CSOM to get all users #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" #Site collection URL $SiteURL="https://crescent.sharepoint.com" #Setup Credentials to connect $Cred = Get-Credential $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password) #Initialize the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteU
SharePoint Online: Get All Users in Site Collection using PowerShell SharePoint Online: Get All Users in Site Collection using PowerShell Reviewed by Salaudeen Rajack on February 11, 2017 Rating: 5

SharePoint Online: Create Announcement List using PowerShell

February 11, 2017    , , ,
Requirement: Create Announcement List in SharePoint Online. How to Create Announcement list in SharePoint Online? As its name indicates, Announcements list in SharePoint Online is used to share announcements and news. It has "Title" and "Body" fields for announcement and also has "Expiration Date" to set whether a particular announcement to be listed or not. Here is how to create announcement list in SharePoint Online: Navigate to the SharePoint Online Site >> Click on Settings Gear >> Select "Add an App"  From the Apps page, Click on "Announcements" Tile Provide the name to your announcement list and click on Create. This creates announcement list in SharePoint Online. Announcements lists are typically added to the home page of the sites. SharePoint Online: PowerShell to Create Announcement List Here is the PowerShell CSOM script to create announcement list in SharePoint Online. #Load SharePoint CSOM Ass
SharePoint Online: Create Announcement List using PowerShell SharePoint Online: Create Announcement List using PowerShell Reviewed by Salaudeen Rajack on February 11, 2017 Rating: 5

SharePoint Online: Copy Attachments from One List to Another using PowerShell

February 10, 2017    , , , ,
Requirement: Copy Attachment from one list to another in SharePoint Online.   PowerShell to Copy Attachment to Another List in SharePoint Online: Had a requirement to copy attachments between SharePoint Online lists. (only attachment - Not list items!). This script gets the attachments from source list, searches the matching list item based on "Mapping Column" value and attaches list attachments to the destination list items. #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 Copy-Attachments() { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Parameter(Mandatory=$true)] [string] $SourceListName, [Parameter(Mandatory=$true)] [string] $TargetListName, [Par
SharePoint Online: Copy Attachments from One List to Another using PowerShell SharePoint Online: Copy Attachments from One List to Another using PowerShell Reviewed by Salaudeen Rajack on February 10, 2017 Rating: 5

List View Threshold in SharePoint Online - FAQs

February 10, 2017    , , , , , ,
What is List View Threshold Limit in SharePoint Online? List View Threshold is a limit of 5000 list items in SharePoint online, which can't be exceeded! Is it possible to Change List View Threshold in SharePoint Online? No! We can't change list view threshold in SharePoint Online. The number 5000 is fixed and controlled by Microsoft to ensure better performance in SharePoint Online as its operates as shared tenant environment. If its SharePoint On-premises, You can change list threshold via Central Administration site: How to Increase List Threshold in SharePoint? How to Increase List View Threshold in SharePoint Online? It's not possible to increase threshold limit SharePoint Online! List View Lookup Threshold in SharePoint Online: SharePoint Online has lookup column threshold of 12. (It was 8 in SharePoint on-premises - before June 2013 CU ). Also, when the parent list contains more than 5000 items, then you'll get the error message: "This is a look
List View Threshold in SharePoint Online - FAQs List View Threshold in SharePoint Online - FAQs Reviewed by Salaudeen Rajack on February 10, 2017 Rating: 5

SharePoint Online: How to Change Home Page using PowerShell?

February 08, 2017    , , ,
Requirement: SharePoint Online Set Home Page How to Change Home page in SharePoint Online? The welcome page or Home page is the initial page displayed when you browse to a site. By default Home.aspx page in the Site Pages library is defined as the site welcome page. You can create new page and set as the site's welcome page. To set home page in SharePoint Online: Navigate to Site Settings >> Click on "Welcome Page" link under "Look and Feel" group This takes you to the "Site Welcome Page" (/_layouts/15/AreaWelcomePage.aspx) where you can pick any existing page and set it as a welcome page or home page for your SharePoint Online site. This changes welcome page in SharePoint Online. To get "Welcome page" link in site settings, "SharePoint Server Publishing" feature must be activated. Once its active, you'll get Welcome Page link in the Site Settings. SharePoint Online: Change home page using PowerShell Her
SharePoint Online: How to Change Home Page using PowerShell? SharePoint Online: How to Change Home Page using PowerShell? Reviewed by Salaudeen Rajack on February 08, 2017 Rating: 5

SharePoint Online: Get List Items from Folder using PowerShell

February 08, 2017    , , , ,
Requirement: Get all list items from a folder in SharePoint Online. SharePoint Online: PowerShell to Get List Items in a Folder Get all items from SharePoint list folder is a common requirement when working with client side object model scripts. Here is the SharePoint CSOM to get folder items. #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 Get-ListItemsFromFolder() { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Parameter(Mandatory=$true)] [string] $ListName, [Parameter(Mandatory=$true)] [string] $FolderURL ) Try { #Setup Credentials to connect $Cred = Get-Credential $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCrede
SharePoint Online: Get List Items from Folder using PowerShell SharePoint Online: Get List Items from Folder using PowerShell Reviewed by Salaudeen Rajack on February 08, 2017 Rating: 5

"Delete this list" Missing in SharePoint? Here is the solution!

February 06, 2017    ,
Problem: "Delete this list" option missing in SharePoint list settings! wanted to delete a particular list in SharePoint but could not find delete this list option under list settings. Tried deleting it from the list ribbon menu, SharePoint Designer, Content and structure tool, Explorer view, PowerShell but none helped. Root Cause: Delete this list option is not available because "Allow Deletion" flag set to FALSE to save the list from accidental deletions. If you have noticed, in some of the SharePoint lists and libraries (E.g. "Farm Templates" library), "Delete this List" or "Delete this Document Library" links are missing by default to prevent delete option. Tips: You can use SharePoint Manager tool as well, to set the "AllowDeletion" flag! Solution: Here is how we can revert the "Allow Deletion" flag to enable "Delete this list" link in SharePoint by setting. Add-PSSnapin Microsoft.Shar
"Delete this list" Missing in SharePoint? Here is the solution! "Delete this list" Missing in SharePoint? Here is the solution! Reviewed by Unknown on February 06, 2017 Rating: 5

SharePoint Online: Copy Files Between Site Collections using PowerShell

February 05, 2017    , , , ,
Requirement: SharePoint Online Copy Files between Site Collections in document libraries. PowerShell to Copy Files between Site Collections in SharePoint Online: Lets copy a single file from source to destination. #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" #Set parameter values $SourceSiteURL="https://crescent.sharePoint.com/sites/sales" $TargetSiteURL="https://crescent.sharepoint.com/sites/Ops/" #Set Source and Destination File URLs - Relative path $SourceFileURL="/Sites/Sales/Project Documents/Active Users.xlsx" $TargetFileURL="/Sites/Ops/Shared Documents/Active Users.xlsx" #Setup Credentials to connect $Cred= Get-Credential $Credentials = New-Object Microsoft.SharePoin
SharePoint Online: Copy Files Between Site Collections using PowerShell SharePoint Online: Copy Files Between Site Collections using PowerShell Reviewed by Salaudeen Rajack on February 05, 2017 Rating: 5

SharePoint Online: Copy File Between Document Libraries using PowerShell

February 04, 2017    , , , ,
Requirement: SharePoint Online PowerShell to copy files from one library to another How to Copy a File in SharePoint Online Document Library? Here is how to copy file in SharePoint Online Document Library: Navigate to your SharePoint Online document library. Right click on the file to copy >> Select "Copy To" menu item This opens information panel in the right. Select the target library to which your file needs to be copied. You can select current library, any other library in the current site or even a library in any different site collection. Pick the library and click on "Copy Here" button to start copying the file. You'll see the "Copying" message in tool bar and your file will be copied momentarily. SharePoint Online: PowerShell to Copy Documents Here is the PowerShell to copy files in SharePoint Online document library. Function Copy-File { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Pa
SharePoint Online: Copy File Between Document Libraries using PowerShell SharePoint Online: Copy File Between Document Libraries using PowerShell Reviewed by Salaudeen Rajack on February 04, 2017 Rating: 5

SharePoint Online: Get All List Fields using PowerShell

February 03, 2017    , , , , , ,
Requirement: SharePoint Online PowerShell to Get All List Fields. How to Get List Fields in SharePoint Online? Navigate to list settings, under "Columns" section, you'll find all fields of the particular list. SharePoint Online: PowerShell to Get List Fields Here is the SharePoint Online PowerShell to get list columns: Lets use PowerShell to get list field properties and export to a CSV file, such as: List field name Field Type Field ID Field Internal Name Field Schema XML and Field description #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" #Set parameter values $SiteURL="https://crescent.sharepoint.com" $ListName="Projects" $Cred= Get-Credential $Credentials = New-Obje
SharePoint Online: Get All List Fields using PowerShell SharePoint Online: Get All List Fields using PowerShell Reviewed by Salaudeen Rajack on February 03, 2017 Rating: 5

SharePoint Online: Delete Attachments from List Item using Powershell

February 01, 2017    , , , ,
Requirement: Delete Attachment from SharePoint Online List Item. How to Delete Attachments from List Items in SharePoint Online? To delete an attachment from SharePoint list items, Navigate to the SharePoint Online List >> Select the List Item >> Click on Edit from tool pane. In Edit panel, scroll down to the bottom and click on little x Icon next to any attachment to delete it from the list item. Click on Save to commit your changes. PowerShell to Remove Attachment from SharePoint Online List Item: #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 Remove-AttachmentFromListItem() { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Parameter(Mandatory=$true)] [s
SharePoint Online: Delete Attachments from List Item using Powershell SharePoint Online: Delete Attachments from List Item using Powershell Reviewed by Salaudeen Rajack on February 01, 2017 Rating: 5

SharePoint Online: Add Attachment to List Item using PowerShell

February 01, 2017    , , , ,
Requirement: Add Attachment to SharePoint Online List Item SharePoint Online: How to Add Attachment to List Item? To add attachment to list item in SharePoint Online, Navigate to the SharePoint Online list >> Select the List Item you want to add attachments Edit List Item >> Scroll down and Click on "Add Attachments" link in the Edit pane. This opens browse dialog window., Select attachments to add Click on Save to complete adding attachment to list item. PowerShell to Add an Attachment to List Item: #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 Add-AttachmentToListItem() { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Parameter(Mandatory=$
SharePoint Online: Add Attachment to List Item using PowerShell SharePoint Online: Add Attachment to List Item using PowerShell Reviewed by Salaudeen Rajack on February 01, 2017 Rating: 5
Powered by Blogger.