SharePoint Online: Configure List Settings using PowerShell

June 30, 2017    , , , ,
Requirement: Edit List Settings in SharePoint Online using PowerShell How to Change List Settings in SharePoint Online? List settings in SharePoint Online defines the attributes of the list such as Name, description, etc and functionality of the lists. These settings can be configured by navigating to the list settings page. To manage these settings, following: Navigate to the list or library Settings page from Settings >> List Settings. All settings of the list or library is located on this single page. From this page, You can configure List Name, Description, and Navigation options. Similarly versioning, security, etc. SharePoint Online: PowerShell to Set List Settings Here is the PowerShell to update most common properties of a SharePoint Online list or library. #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 Fi
SharePoint Online: Configure List Settings using PowerShell SharePoint Online: Configure List Settings using PowerShell Reviewed by Salaudeen Rajack on June 30, 2017 Rating: 5

Configure Resource Throttling Settings for Large Lists in SharePoint 2016

June 30, 2017    , , , , ,
What is resource throttling in SharePoint? The biggest performance bottleneck in SharePoint sites is caused usually by large lists. If you have 50 simultaneous users in a site and two of them are contributing to large lists, all 50 users will experience very slow performance. Luckily starting from SharePoint 2010, There is a feature called "Throttling" introduced to address this issue. Throttling defines the Maximum number of rows user can query at a time. The resource throttling feature in SharePoint is used to configure Threshold for large lists to prohibit operations that involve too many items, such as queries that return a large number of items or adding a column to a list that contains a large number of items. List throttling is turned on by default in SharePoint 2016 and the default value for List View Threshold is 5,000. When the number of items in a list exceeds this value, users receive a warning when they browse the List Settings page. SharePoint Resource T
Configure Resource Throttling Settings for Large Lists in SharePoint 2016 Configure Resource Throttling Settings for Large Lists in SharePoint 2016 Reviewed by Salaudeen Rajack on June 30, 2017 Rating: 5

SharePoint Online: How to Move a Folder using PowerShell?

June 30, 2017    , , , ,
Requirement:   Move a Folder to Another Library or Another Site in SharePoint Online. How to Move a Folder in SharePoint Online? Moving a folder in SharePoint Online modern experience is quite simple. Navigate to your SharePoint Online library >> Select the Folder to move From the Toolbar, Click on "Move to" button Select the destination location you want a move the folder. You can even choose a different site collection or subsite. Use "Browse Sites" to see a full list of sites that you can move to. You can also create a new folder in the destination. Click on "Move here" button to start moving the folder. This moves the folder with all its files to the selected destination. Please note, the "Move To" is not available in SharePoint Online classic experience. SharePoint Online: Move folder using PowerShell We can also use PowerShell to move a folder in SharePoint Online. Lets move folder up a level. #Load SharePoint CSOM
SharePoint Online: How to Move a Folder using PowerShell? SharePoint Online: How to Move a Folder using PowerShell? Reviewed by Salaudeen Rajack on June 30, 2017 Rating: 5

SharePoint Online: Find Site Column Usage in Content Types using PowerShell

June 29, 2017    , , , ,
Requirement: Find Site Column Usage in Content Type in SharePoint Online site collection. Little background: When trying to delete a site column in SharePoint Online, Got a error message: "site columns which are included in content types cannot be deleted. Remove all references to this site column prior to deleting it".  So, How to find where a site column is being used? PowerShell to Find Site Column usage in Content Types: #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 to get a particular Site column usage in content types Function Get-SPOSiteColumnUsage([String]$SiteURL, [String]$SiteColumnInternalName) { Try{ Write-host -f Yellow "Processing Site:" $SiteURL #
SharePoint Online: Find Site Column Usage in Content Types using PowerShell SharePoint Online: Find Site Column Usage in Content Types using PowerShell Reviewed by Salaudeen Rajack on June 29, 2017 Rating: 5

How to Get SharePoint Farm Account?

June 24, 2017    , , ,
SharePoint Farm Account manages the farm services. It runs SharePoint timer service, Used in application pool identity for Central Administration site and in database access. Typically configured at the time you run PSconfig wizard. How to Get SharePoint Farm Account? To identify SharePoint Farm account,  follow these steps: Go to your SharePoint Central Administration site >> Click on Security >> Configure Service Accounts In the First Dropdown, Select "Farm Account" You'll find your SharePoint Farm Account listed automatically in the second dropdown. In my case, it is "Crescent\SPAdmin" This gets farm account in SharePoint. Get Farm Account Through Services Console: As SharePoint Farm account runs SharePoint Timer Service, You can Go to: Run >> Services.msc Pick "SharePoint Timer Services" >> You'll find the Farm account under "Log on as" column. Get Farm account in SharePoint using PowerShel
How to Get SharePoint Farm Account? How to Get SharePoint Farm Account? Reviewed by Salaudeen Rajack on June 24, 2017 Rating: 5

SharePoint Online: How to Save Site as Template?

June 22, 2017    ,
Requirement: Save SharePoint Online Site as Template! Site templates are the quickest way to define skeleton of a particular standard in SharePoint. It provides great re-usability so that we can create as many sites as we want from the template without manually re-creating them. So, After you create a site and customize, add lists and libraries to it, you save it as a template. When you save a site as a template, any lists and libraries, look and feel and other objects such as calendars, etc. you have added are also saved, optionally with content. "Save site as template" feature is not supported in Publishing sites (or sites with publishing feature enabled), SharePoint Online community and group sites! How to Save SharePoint Online Site as Template? Once you create a new site and customize it to meet your specific requirements, you can save the updated site as a new template to be used when additional sites are created. To Save site as a site template, follow these s
SharePoint Online: How to Save Site as Template? SharePoint Online: How to Save Site as Template? Reviewed by Salaudeen Rajack on June 22, 2017 Rating: 5

SharePoint Online: Save Site as Template Option Missing?

June 21, 2017    ,
Problem: "Save Site as Template" option missing in SharePoint Online! How to Enable Save Site as Template in SharePoint Online? To fix this problem, we need to enable custom scripts. Here is how to fix the save site as template not available issue. Login to SharePoint Online Admin Center Click on Settings from the left navigation >> Scroll down to "Custom Script" section Set "Allow users to run custom script on personal site" and "Allow users to run custom script on self-service created sites" options.  Click on "OK" to save your changes. This enables save site as template link. However, this change may take up to 24 Hours to reflect. To enable scripting on a particular site collection immediately, use this PowerShell script in SharePoint Online Management Shell. SharePoint Online save list as template URL: https://crescent.sharepoint.com /_layouts/15/savetmpl.aspx PowerShell to Fix Save Site as Template Op
SharePoint Online: Save Site as Template Option Missing? SharePoint Online: Save Site as Template Option Missing? Reviewed by Salaudeen Rajack on June 21, 2017 Rating: 5

Fix "Sorry, You don't have access" Access Denied Error on Save Site as Template in SharePoint Online

June 21, 2017    ,
Problem: Getting "Sorry, You don't have access" access denied error when trying to save site as template in SharePoint Online site from URL: https://crescent.sharepoint.com /_layouts/15/savetmpl.aspx Solution: To fix this problem, we need to enable custom scripts. Here is how to fix the access denied error on Save Site as Template. Login to SharePoint Online Admin Center Click on Settings from the left navigation >> Scroll down to "Custom Script" section Set "Allow users to run custom script on personal site" and "Allow users to run custom script on self-service created sites" options.  Click on "OK" to save your changes. However, this change may take up to 24 Hours to reflect. To enable scripting on a particular site collection immediately, use this PowerShell script in SharePoint Online Management Shell. PowerShell to Fix SharePoint Online Save Site as Template Access Denied Error: Use this PowerShell script
Fix "Sorry, You don't have access" Access Denied Error on Save Site as Template in SharePoint Online Fix "Sorry, You don't have access" Access Denied Error on Save Site as Template in SharePoint Online Reviewed by Salaudeen Rajack on June 21, 2017 Rating: 5

SharePoint Online: Change Time Zone using PowerShell

June 20, 2017    , , , ,
Requirement: Change Timezone in SharePoint Online. How to Change Timezone in SharePoint Online? As a global organization operating in different regions and time zones, we wanted to set time zones for respective sites since users get annoyed when they see Pacific time zones in uploaded document's time stamps. SharePoint Online timezone settings can be set by going to : Site Settings >> Click on "Regional Settings" under "Site Administration" In Regional settings page, You can set time zone, locale and other regional settings. Click on OK located at the bottom right of the page to save your changes. Please note, You must have Site collection Administrator rights on all SharePoint Online Site collections in order to change the Timezone Regional settings. Get a List of All Available Time Zones in SharePoint Online:  We need either the ID of the time zone or description in order to update timezone of a SharePoint Online site. To get list of time
SharePoint Online: Change Time Zone using PowerShell SharePoint Online: Change Time Zone using PowerShell Reviewed by Salaudeen Rajack on June 20, 2017 Rating: 5

SharePoint Online: PowerShell to Delete a Document Library

June 19, 2017    , , ,
How to delete document library in SharePoint Online? To delete document library in SharePoint Online, follow these steps: Login to SharePoint Online, Navigate to the document library Click on Settings >> Library Settings Under Permissions and Management, click on "Delete this document library" link. Confirm the prompt "This document library will be removed and all its files will be deleted.  Are you sure you want to send this document library to the site Recycle Bin?" with "Yes" once. This sends the document library to the recycle bin. You can also remove a document library in SharePoint Online from "Site Contents" page. Simply hover over the document library, Click on "Remove" from the context menu to delete the document library. SharePoint Online: PowerShell to Delete a Document Library Lets use PowerShell to delete a document library in SharePoint Online. #Load SharePoint CSOM Assemblies Add-Type -Path "
SharePoint Online: PowerShell to Delete a Document Library SharePoint Online: PowerShell to Delete a Document Library Reviewed by Salaudeen Rajack on June 19, 2017 Rating: 5

SharePoint Online: Delete Drop Off Library using PowerShell

June 19, 2017    , ,
Requirement: Remove drop off library in SharePoint Online. Site owner activated "Content Organizer" feature in a site which brought "Drop Off  Library" into the SharePoint Online site. Now, when he tried deleting this library by going to library settings, he could not find "Delete this document library" link in the library's settings! Deactivating the content organizer feature didn't help. So, How to delete the drop off library from SharePoint Online? As the drop off library doesn't provide "Delete this Library" link, we've to use PowerShell to delete this library. SharePoint Online Remove drop off library using PowerShell: We can delete the Drop Off Library by setting: AllowDeletion property. Here is the PowerShell script to delete the drop off library in SharePoint Online. #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePo
SharePoint Online: Delete Drop Off Library using PowerShell SharePoint Online: Delete Drop Off Library using PowerShell Reviewed by Salaudeen Rajack on June 19, 2017 Rating: 5

How to Secure SharePoint 2016 Central Administration Site from HTTP to HTTPS using SSL Certificate?

June 11, 2017    , , , ,
Central Administration site is a web application where administration activities are performed for the farm. By default, Central Administration runs on non-secure HTTP. Enabling encryption ensures that the communications between users and the central admin website remain secure. Prerequisite: Of course, You need the SSL certificate! You can use a free domain certificate from an internal CA, but you'll need a SSL certificate from public certificate authorities for public facing sites. Overall Steps to Change Central Administration from HTTP to HTTPS: The steps to secure Central Administration are as follows: Set SharePoint Central Administration site to use SSL Port 443 Assign SSL certificate binding to the Central Admin Web application through IIS.  Verify the Alternate Access Mappings to accommodate the port change Why We should Enable SSL for Central Administration site? To protect sensitive information such as credentials, its essential to enable SSL on SharePo
How to Secure SharePoint 2016 Central Administration Site from HTTP to HTTPS using SSL Certificate? How to Secure SharePoint 2016 Central Administration Site from HTTP to HTTPS using SSL Certificate? Reviewed by Salaudeen Rajack on June 11, 2017 Rating: 5

SharePoint Online: How to Inject CSS using Custom Action in PowerShell?

June 09, 2017    , , ,
Requirement: Add Custom CSS to SharePoint Online without editing Master page PowerShell to Add CSS to SharePoint Online: Assuming you have "Custom.CSS" file uploaded to "Site Assets" library, Here is the PowerShell to insert CSS to SharePoint Online site. #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://crescenttech.sharepoint.com/" $CustomActionTitle = "Custom Branding CSS" Try{ #Get 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.ClientCon
SharePoint Online: How to Inject CSS using Custom Action in PowerShell? SharePoint Online: How to Inject CSS using Custom Action in PowerShell? Reviewed by Salaudeen Rajack on June 09, 2017 Rating: 5

SharePoint Online: PowerShell to Inject JavaScript using Custom Action

June 09, 2017    , , , , , ,
Requirement: Inject JavaScript into SharePoint Online using PowerShell SharePoint Online Inject JavaScript using PowerShell: Lets insert JavaScript to SharePoint Online using PowerShell, without modifying the Master page! #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://crescenttech.sharepoint.com/" $CustomActionTitle = "Google Analytics" Try{ #Get 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 #G
SharePoint Online: PowerShell to Inject JavaScript using Custom Action SharePoint Online: PowerShell to Inject JavaScript using Custom Action Reviewed by Salaudeen Rajack on June 09, 2017 Rating: 5

SharePoint Online: Find All Checked Out Files using PowerShell

June 08, 2017    , , , ,
Requirement: Find All Checked Out files in SharePoint Online A bit background: Client have a large document library with bunch of check out documents and want them to make available to end users. So, tried creating a view which filters all checked out files, but it failed because of list view threshold issue, since the list item count is > 5000! How to Get Checked Out Files in SharePoint Online Document Library? To get all checked out files from SharePoint Online document library, follow these steps: Navigate to the document library, Make sure "Checked Out To" column is added to the List View Sort-Filter the view based checked out to column to get all checked out documents. PowerShell to Get All Checked Out Documents in SharePoint Online Library Here is the SharePoint Online PowerShell to get checked out files from a given document library. #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Ex
SharePoint Online: Find All Checked Out Files using PowerShell SharePoint Online: Find All Checked Out Files using PowerShell Reviewed by Salaudeen Rajack on June 08, 2017 Rating: 5

SharePoint Online: Change Navigation Settings using PowerShell

June 08, 2017    , , ,
Requirement: SharePoint Online Set navigation using PowerShell How to Change Navigation in SharePoint Online? To change navigation in SharePoint Online, Go to: Site Settings >> "Navigation" under "Look and Feel" group Set the navigation settings for global navigation and current navigation accordingly. SharePoint Online: Set Navigation using PowerShell Here is the PowerShell to set SharePoint Online navigation. #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" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Exte
SharePoint Online: Change Navigation Settings using PowerShell SharePoint Online: Change Navigation Settings using PowerShell Reviewed by Salaudeen Rajack on June 08, 2017 Rating: 5

SharePoint Online: Site Users and Groups Report using PowerShell

June 07, 2017    , , , , ,
Requirement: Generate a report with all site groups and members of each group of a SharePoint online site collection. Prerequisites: Make sure you have SharePoint Online Management Shell installed! Get all Site Groups and Members of Each group: #Import SharePoint Online Management Shell Import-Module Microsoft.Online.Sharepoint.PowerShell -DisableNameChecking #Variables for processing $AdminURL = "https://crescent-admin.sharepoint.com/" $AdminName = "spadmin@crescent.com" $SiteURL="https://crescent.sharepoint.com/sites/sales" #User Names Password to connect $Password = Read-host -assecurestring "Enter Password for $AdminName" $Credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $AdminName, $Password #Connect to SharePoint Online Connect-SPOService -url $AdminURL -credential $Credential #Get all Site groups $SiteGroups = Get-SPOSiteGroup -Site $SiteURL #Get Members of each group foreach($Group i
SharePoint Online: Site Users and Groups Report using PowerShell SharePoint Online: Site Users and Groups Report using PowerShell Reviewed by Salaudeen Rajack on June 07, 2017 Rating: 5

SharePoint Online: Access Denied Error on Navigation Settings

June 07, 2017    , ,
Problem: When trying to change the navigation settings of a SharePoint Online site, got access denied error.  Access Required: Sorry, you don't have access. I'm sure, I am a Global Admin in Office 365, and Site Collection Administrator for that particular site collection. Tried the PowerShell way and got the similar error: " Access denied. You do not have permission to perform this action or access this resource. " Solution to the Navigation Settings Access Denied Error: To fix this issue: You have to set "Custom Script" setting to "Allow users to run custom script on self service created sites" in the SharePoint Online Admin Center Settings page and it takes 24 hours or so to propagate! So, lets not wait and enable custom script at site collection level. PowerShell to Enable Custom Scripts in SharePoint Online Site Collection: #Config Parameters $AdminSiteURL="https://crescent-admin.sharepoint.com" $SiteURL="https://cresce
SharePoint Online: Access Denied Error on Navigation Settings SharePoint Online: Access Denied Error on Navigation Settings Reviewed by Salaudeen Rajack on June 07, 2017 Rating: 5

Change SQL Server Database Initial Size and Auto Growth Settings using PowerShell

June 07, 2017    , ,
Requirement: After a new farm deployment, I had to raise the size and growth of all SharePoint content databases. There were 20+ in the initial setup. As per SQL Server best practices for SharePoint , we must set the initial size and growth properties of the SharePoint content databases for better performance, which can be configured from database properties on each content database. PowerShell to Set SharePoint Database Initial Size and Auto Growth Settings: When we have large number of content databases, we can utilize PowerShell to configure database properties. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Import SQL PowerShell module Import-Module SQLPS –DisableNameChecking #Get All SharePoint Content Databases $ContentDatabases = Get-SPContentDatabase #Loop through each content database ForEach($Database in $ContentDatabases) { #Get the SharePoint content database in SQL Server $SQLDatabase = Get-SqlDatabase -Name $Database.Name
Change SQL Server Database Initial Size and Auto Growth Settings using PowerShell Change SQL Server Database Initial Size and Auto Growth Settings using PowerShell Reviewed by Salaudeen Rajack on June 07, 2017 Rating: 5

SharePoint Online: Export Permissions of a Site, List, Item using PowerShell

June 06, 2017    , , , , ,
Requirement: Export permissions applied on a particular SharePoint Site, List or List Item to CSV report. PowerShell to Export Permissions of a Site, List, List Item in SharePoint Online: This PowerShell script extracts and exports Immediate (not on any underlying objects) permissions of the given object. E.g. get list permissions. #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" #Get Permissions Applied on a particular Object, such as: Web, List or ListItem Function Export-SPOPermissions([Microsoft.SharePoint.Client.SecurableObject]$Object, $ReportFile) { #Write CSV- TAB Separated File) Header "Account `t Permissions `t Type" | out-file $ReportFile #Get permissions assigned to the object $C
SharePoint Online: Export Permissions of a Site, List, Item using PowerShell SharePoint Online: Export Permissions of a Site, List, Item using PowerShell Reviewed by Salaudeen Rajack on June 06, 2017 Rating: 5

SharePoint Online: CAML Query for Date Time Field in PowerShell

June 05, 2017    , , ,
Requirement: S harePoint Online CAML Query to Filter by Date Time Field Values SharePoint CAML: Order By Created Date Here is the SharePoint Online CAML Query to order by using "created date" field #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" #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 the List Object $List = $Ctx.Web.lists.GetByTitle($ListName) #Define the CAML Query $Query =
SharePoint Online: CAML Query for Date Time Field in PowerShell SharePoint Online: CAML Query for Date Time Field in PowerShell Reviewed by Salaudeen Rajack on June 05, 2017 Rating: 5
Powered by Blogger.