kwizcom banner advertisement

Get-Set OneDrive Site Collection Storage Quota Size using PowerShell

7:43 PM    , , ,
Get OneDrive Site collection Storage Quota Information: To get the storage quota data for a particular OneDrive site, use this PowerShell cmdlet in SharePoint Online Management Shell Get-SPOSite -Identity "https://crescent-my.sharepoint.com/personal/salaudeen_crescent_com" This gets you the currently allocated storage quota data for a single site collection. Get Storage Quota Details of All OneDrive Site collections Use this script in SharePoint Online Management Shell. $AdminSiteURL="https://crescent-admin.sharepoint.com" #Get Credentials to connect to SharePoint Admin Center $Cred = Get-Credential #Connect to SharePoint Online Admin Center Connect-SPOService -Url $AdminSiteURL –credential $Cred #Get all Personal Site collections and export to a Text file $OneDriveSites = Get-SPOSite -Template "SPSPERS#9" -Limit ALL -includepersonalsite $True $Result=@() # Get storage quota of each site Foreach($Site in $OneDriveSites) { $Result += New-O
Get-Set OneDrive Site Collection Storage Quota Size using PowerShell Get-Set OneDrive Site Collection Storage Quota Size using PowerShell Reviewed by Salaudeen Rajack on 7:43 PM Rating: 5

Get All SharePoint Online Site Collections Inventory using PowerShell

12:37 PM    , , ,
Requirement: Get all site collections inventory in SharePoint Online using PowerShell PowerShell to Get All SharePoint Online Site Collections Inventory: Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking #Config Parameters $AdminSiteURL="https://crescent-admin.sharepoint.com" $ReportOutput="C:\Temp\SPOStorage.csv" #Get Credentials to connect to SharePoint Admin Center $Cred = Get-Credential #Connect to SharePoint Online Admin Center Connect-SPOService -Url $AdminSiteURL –Credential $Cred #Get All site collections $SiteCollections = Get-SPOSite -Limit All Write-Host "Total Number of Site collections Found:"$SiteCollections.count -f Yellow #Array to store Result $ResultSet = @() #Loop through each site collection and retrieve details Foreach ($Site in $SiteCollections) { Write-Host "Processing Site Collection :"$Site.URL -f Yellow #Get site collection details $Result = new-object PSObject $Resu
Get All SharePoint Online Site Collections Inventory using PowerShell Get All SharePoint Online Site Collections Inventory using PowerShell Reviewed by Salaudeen Rajack on 12:37 PM Rating: 5

SharePoint Online: Add Site Column to List using PowerShell

3:42 AM    , , , ,
Requirement: Add an existing site column to SharePoint list or library using PowerShell. How to Add a Site Column to SharePoint Online List? Site columns in SharePoint provides great re-usability without having to recreate same columns multiple times! Once created at top level site, we can utilize them to store metadata in any number of lists and libraries under the hierarchy. To add a site column to SharePoint list, follow these steps: Go to List Settings >> Under Columns, Click on "Add from existing site columns" link. From the available site columns, pick the required site column(s) and click on Add button. Click OK to save your changes. Add Site Column to List or Library with PowerShell: #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\
SharePoint Online: Add Site Column to List using PowerShell SharePoint Online: Add Site Column to List using PowerShell Reviewed by Salaudeen Rajack on 3:42 AM Rating: 5

How to Add a Custom Tile to SharePoint 2016 App Launcher

1:50 PM    ,
Requirement: Add new tile to App Launcher in SharePoint Online. How to Add a Custom Tile to SharePoint 2016 App Launcher? We wanted to place a new tile in SharePoint 2016 app launcher for support center site, as an end-user usability improvement. SharePoint 2016 Feature Pack 1 brought us the capability to add new tile to app launcher. Here is how you can customize SharePoint 2016 App launcher. Step 1: Enable the "Custom Tiles" feature in SharePoint 2016 with PowerShell: Use this PowerShell script to enable custom tiles feature.  Enable-SPFeature -Identity CustomTiles -Url "http://intranet.crescent.com" -Force This creates a new list "Custom Tiles" in the given web application's root site collection. Step 2: Create new Tile in "Custom Tiles" list Once the feature is activated, navigate to: http://intranet.crescent.com/Lists/Custom%20Tiles/AllItems.aspx URL and add a new entry with desired URL and image for tile for your custom t
How to Add a Custom Tile to SharePoint 2016 App Launcher How to Add a Custom Tile to SharePoint 2016 App Launcher Reviewed by Salaudeen Rajack on 1:50 PM Rating: 5

SharePoint Online: Grant Permission to List Item using PowerShell

7:03 PM    , , ,
Permissions are hierarchical in SharePoint from Top Site collection till the List Item level. To set unique permissions on list items, you need to configure permissions on item level. Here is how: How to Grant Access to Individual List Items in SharePoint Online? Got a business requirement to grant permissions at List item level. To set explicit permissions on SharePoint online list items, we need to break the permission inheritance first (stop inheriting permissions) and then add user or group to the List Item. Go to your SharePoint Online list or library >> Select the Item to which you want to provide unique permissions.  Click on "Shared With" button from the ribbon. On the Shared With page, click Advanced. On the Permissions tab, in the Inheritance group, click Stop Inheriting Permissions button. Confirm the prompt. Now, from the ribbon, click on "Grant Permissions." button. In the Share dialog box, enter names, email addresses. Click the Show
SharePoint Online: Grant Permission to List Item using PowerShell SharePoint Online: Grant Permission to List Item using PowerShell Reviewed by Salaudeen Rajack on 7:03 PM Rating: 5

Create Search Service Application in SharePoint 2016 Multi-Server Farm using PowerShell

3:02 PM    , , , ,
The Search Service Application in SharePoint provides search functionality, as its name implies. We have to use PowerShell scripts to configure search service application from SharePoint 2013 on wards as there is no user interface to configure the Search topology from SharePoint Central Admin - although we can create new search service application instance. Configuring SharePoint 2016 Search Service Application for Multi-Server Farm: While my earlier article addresses How to create search service application in SharePoint 2013 - Single Server farm , for Standalone SharePoint 2013 or SharePoint 2016 installations, In a production environment we may have to distribute and load balance search components to different servers in a multi-server farm. Here is the proposed Farm search topology in high level: I've the below servers in my SharePoint 2016 environment using Shared MinRoles: Web Front End + Distributed Cache Servers - 2 Application + Search Servers - 2 Since w
Create Search Service Application in SharePoint 2016 Multi-Server Farm using PowerShell Create Search Service Application in SharePoint 2016 Multi-Server Farm using PowerShell Reviewed by Salaudeen Rajack on 3:02 PM Rating: 5

SharePoint Online: Rename Files in Document Library using PowerShell

6:28 PM    , , , , ,
Requirement: Rename files in SharePoint document library using PowerShell PowerShell CSOM Script to rename a file in SharePoint Online: #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 Variables for Site URL, Old File Name and New File Name $SiteURL= "https://crescent.sharepoint.com/sites/sales/" $OldFileURL="/sites/Sales/Documents/Legal.docx" $NewFileURL="/sites/Sales/Documents/LegalTemplate.docx" #Setup Credentials to connect $Cred = Get-Credential $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password) Try { #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = $
SharePoint Online: Rename Files in Document Library using PowerShell SharePoint Online: Rename Files in Document Library using PowerShell Reviewed by Salaudeen Rajack on 6:28 PM Rating: 5

Create User Profile Service Application using PowerShell in SharePoint 2016

4:54 PM    , , , ,
We need User Profile Service Application to consume social features in SharePoint 2016 such as My Sites, User profiles, etc. This PowerShell script creates User Profile Service Application in SharePoint 2016. Prerequisite: Create my site host prior creating user profile service application. Create My site host using PowerShell in SharePoint PowerShell to create user profile service application in SharePoint 2016 Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Configuration Parameters $ServiceAppName = "User Profile Service Application" $ServiceAppProxyName = "User Profile Service Application Proxy" $AppPoolAccount = "Crescent\SP16_Pool" $AppPoolName = "Service Application App Pool" $DatabaseServer ="SP16-SQL" $UserProfileDB = "Farm_Profile_DB" $UserProfileSyncDB = "Farm_Profile_Sync_DB" $UserProfileSocialDB = "Farm_Profile_Social_DB" $MySiteHostLocation="http://mysi
Create User Profile Service Application using PowerShell in SharePoint 2016 Create User Profile Service Application using PowerShell in SharePoint 2016 Reviewed by Salaudeen Rajack on 4:54 PM Rating: 5

Archive ULS & IIS Log Files in SharePoint using PowerShell

1:36 PM    , , , ,
Requirement: Archive Log files of IIS and ULS Log.  Log files in SharePoint (both IIS Log and ULS Log) could grow and fill-up the disk space based on your configurations and usage. There are many scripts available in various blogs and boards and Here is my own script to archive Log files on SharePoint servers. PowerShell to Archive Log Files in SharePoint: Set the Log file path and archive location in the configuration parameters section and run the script. This script does the following: Copies all log files which are last modified before 7 Days or earlier from today, to a folder. Create a Zip file from the folder containing log files to archive. Deletes old log files. Add-Type -Assembly System.IO.Compression.FileSystem #Configuration Parameters $LogFilesPath="C:\inetpub\logs\LogFiles\W3SVC3" $ArchivePath="C:\LogArchive" #Get All Log Files Modified before Last Week $LogFilesToArchive = Get-ChildItem -Path $LogFilesPath -recurse | where-object {$_.La
Archive ULS & IIS Log Files in SharePoint using PowerShell Archive ULS & IIS Log Files in SharePoint using PowerShell Reviewed by Salaudeen Rajack on 1:36 PM Rating: 5

SharePoint Online: Site Users and Groups Report using PowerShell

4:54 PM    , , , , ,
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
SharePoint Online: Site Users and Groups Report using PowerShell SharePoint Online: Site Users and Groups Report using PowerShell Reviewed by Salaudeen Rajack on 4:54 PM Rating: 5

SharePoint Online: How to Change List to New Experience?

5:42 PM    , ,
SharePoint Online's new list experience provides faster and easier user interface to lists and libraries. You can switch between classic & new experiences in SharePoint online by simply changing list settings. To change list or library to new modern user interface: Go to List or Library settings >> Click on "Advanced Settings" Scroll down to the bottom, and from "List experience" section, Select "New experience" option and hit OK. This changes the list UI to new experience in SharePoint online, From: To: New list experience in SharePoint online How about setting the default option for all New Lists? To set list experience for new lists, you can specify this option globally using using SharePoint Admin Center. Here is how: Navigate to your SharePoint Admin Center(typically: https://YOURCOMPANY-admin.sharepoint.com/) Click on "Settings" from the Left navigation On the Setting page, under "SharePoint list and
SharePoint Online: How to Change List to New Experience? SharePoint Online: How to Change List to New Experience? Reviewed by Salaudeen Rajack on 5:42 PM Rating: 5

SharePoint Online: PowerShell to Get All Site Collections and Subsites

2:48 PM    , , , , ,
Requirement: SharePoint online PowerShell to get all site collections and subsites. SharePoint Online PowerShell to list all site collections and subsites Here is the PowerShell to list all site collections and subsites in SharePoint Online. Import-Module Microsoft.Online.SharePoint.Powershell #Config Parameters $AdminSiteURL="https://crescent-admin.sharepoint.com" #Get Credentials to connect to SharePoint Admin Center $Cred = Get-Credential #Function to get all subsites of a site Function Get-SPOWeb($WebURL) { #Setup credentials to connect $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Get Web information and subsites $Context = New-Object Microsoft.SharePoint.Client.ClientContext($webURL) $Context.Credentials = $Credentials $Web = $context.Web $Context.Load($web) $Context.Load($web.Webs) $Context.executeQuery() #Iterate through each subsite in the current
SharePoint Online: PowerShell to Get All Site Collections and Subsites SharePoint Online: PowerShell to Get All Site Collections and Subsites Reviewed by Salaudeen Rajack on 2:48 PM Rating: 5

How to Backup-Restore a Site Collection in SharePoint using PowerShell

7:03 PM    , , , , , ,
Requirement: Backup and restore a site collection in SharePoint 2013 using PowerShell. How to backup a site collection in SharePoint 2013 using PowerShell? Although you can backup site collections from SharePoint Central Administration, as in  How to Backup SharePoint Site Collection using Central Admin , the Central admin way is kind of clunky and takes a while to perform the backup. PowerShell provides a quick and easy way to backup site collections, We can use in scripted operations and avoid manual repetition of same tasks such as performing backups. Use SharePoint 2016 Management Shell to run these cmdlets. SharePoint site collection backups may be initiated from SharePoint WFEs and you need to be member of a local administrator on the server and should be a farm admin. Backup SharePoint Site Collection using PowerShell Here is the PowerShell syntax to take backup of a site collection in SharePoint 2016. It takes two mandatory parameters to identify the site collection to
How to Backup-Restore a Site Collection in SharePoint using PowerShell How to Backup-Restore a Site Collection in SharePoint using PowerShell Reviewed by Salaudeen Rajack on 7:03 PM Rating: 5

Backup SharePoint Site Collection using Central Admin

7:37 PM    , , , , ,
Requirement: Backup a SharePoint Site Collection using Central Administration Backup Site Collection in SharePoint 2016 Central Admin Site collections can be backed up using SharePoint 2016 Central Administration. To backup a  site collection using Central Administration, follow these steps: Login to SharePoint Central Administration Site >> Click on "Backup and Restore" link in the left navigation. Under Granular Backup, Click on "Perform a Site Collection backup" On the Site Collection Backup page, Select the target site collection to backup. You can switch between web applications and select any site collection in the farm. Set the UNC path to the backup file location. You can also specify any location server location such as "D:\Backup\Sales.bak" Click on "Start Backup" to begin the backup procedure. You'll get backup job status page. Based on the size of your site collection, backup may take time. Wait for the backu
Backup SharePoint Site Collection using Central Admin Backup SharePoint Site Collection using Central Admin Reviewed by Salaudeen Rajack on 7:37 PM Rating: 5

Rename a File in SharePoint Document Library using PowerShell

1:28 PM    ,
Requirement: Rename a File in SharePoint document library using PowerShell. PowerShell to Rename a File in SharePoint: Lets rename a file with ID "4" in "Documents" SharePoint library. Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue #Variables for processing $WebURL = "http://intranet.crescent.com" $ListName = "Documents" $ItemID ="4" $NewFileName="sharepoint databases.pptx" #Get Web, List and Item $Web = Get-SPWeb $WebURL $List = $Web.Lists[$ListName] $ListItem = $List.GetItemByID($ItemID) #Check-out and Rename the file $ListItem.File.CheckOut() $ListItem["Name"] = $NewFileName $ListItem.Update() $ListItem.File.CheckIn("File has been renamed!") Instead of Item ID, Lets use the existing file name and rename it. Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue #Variables for processing $WebURL = "http://intranet.crescent.com" $ListNam
Rename a File in SharePoint Document Library using PowerShell Rename a File in SharePoint Document Library using PowerShell Reviewed by Salaudeen Rajack on 1:28 PM Rating: 5

SharePoint Online: Site Collections Storage Size - Quota Usage Report using PowerShell

7:41 PM    , , , ,
Requirement: Need to generate a report to analyze all SharePoint Online Site collection storage consumption.   How to get the Storage Metrics of a SharePoint Online Site Collection? To find the storage details of a site collection, Go to: Click on Settings gear and then select Site Settings. In the "Site Settings" page, under "Site Collection Administration", click on Storage Metrics. This page gives SharePoint Online site collection storage details along with the breakdown of data usage. Get Storage Info for a Single Site Collection using PowerShell: Lets use PowerShell script to get the storage size allocated, used and warning level of a given site collection. #Config Parameters $AdminSiteURL="https://crescent-admin.sharepoint.com" $SiteURL="https://crescent.sharepoint.com/sites/Ops" #Get Credentials to connect to SharePoint Admin Center $Cred = Get-Credential #Connect to SharePoint Online Admin Center Connect-SPOService -Url
SharePoint Online: Site Collections Storage Size - Quota Usage Report using PowerShell SharePoint Online: Site Collections Storage Size - Quota Usage Report using PowerShell Reviewed by Salaudeen Rajack on 7:41 PM Rating: 5

How to Delete OneDrive for Business Site Collection in SharePoint Online?

5:27 PM    , , , ,
Requirement: Delete OneDrive for Business Site Collection! After a business decision made to disable OneDrive in organization wide, We configured the settings to disable OneDrive. However,  All existing OneDrive sites were active, users can access them and we wanted to remove them all! Any SharePoint My Site or OneDrive for business site gets deleted in 30 days (retention period) from user account deleted from AD or when license is deactivated for the user in Office 365. How to Delete OneDrive for Business Site Collection in SharePoint Online? Deleting OneDrive for Business site collection is as same as deleting any SharePoint sites, But there is no way to delete it using browser UI. So, you can utilize Remove-SPOSite cmdlet to delete any OneDrive for Business (My Site) site collection. PowerShell to Delete a OneDrive for Business Site Collection Use this PowerShell script on SharePoint Online Management Shell to remove a particular OneDrive site collection. Make sure you log
How to Delete OneDrive for Business Site Collection in SharePoint Online? How to Delete OneDrive for Business Site Collection in SharePoint Online? Reviewed by Salaudeen Rajack on 5:27 PM Rating: 5

How to Set Secondary Admin for All OneDrive for Business Sites?

1:24 PM    , , , ,
When SharePoint My Site or OneDrive for business site collection are created by the user, SharePoint assigns primary site collection administrator rights to the user. At times, you may have to gain Admin access in situations such as User left the organization, troubleshooting, etc. In SharePoint on-premises environments, we've "User Policy" option for web applications which provides Admin rights to the whole web application. In SharePoint Online we don't have user policies but fortunately, we have the option to set secondary admin for all My sites to avoid adding them in every single site collection. While its possible to add additional site collection administrators to SharePoint Online My Sites, Here is how you can specify the default secondary site owner for all OneDrive for Business sites in SharePoint Online. Login to your SharePoint Online Admin Center  Click on User Profiles from left navigation Click on My Site Settings >> Setup My Sites >&
How to Set Secondary Admin for All OneDrive for Business Sites? How to Set Secondary Admin for All OneDrive for Business Sites? Reviewed by Salaudeen Rajack on 1:24 PM Rating: 5

There was a problem deleting Web site "Site-URL". Sites that have subsites or certain apps can't be deleted. Please try again after deleting all subsites and removing the apps.

11:54 PM    , , ,
Problem: If you try to delete a SharePoint Online site which has subsites in it, SharePoint throws error message saying " There was a problem deleting Web site "<subsite-url>". Sites that have subsites or certain apps can't be deleted. Please try again after deleting all subsites and removing the apps. " Solution: So, basically SharePoint Online tells us: You have to delete all subsites first, in order to delete its parent site. Deleting a subsite is a matter of few clicks: Go to Site Settings >> Click on "Delete this site" link under site actions group. Confirm the prompt once. However, the problem is: When you have larger number of subsites (say: 50!) its cumbersome and time consuming process to delete each and every subsite using browser interface. So, the solution is PowerShell! PowerShell to delete a subsite in SharePoint Online: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Mic
There was a problem deleting Web site "Site-URL". Sites that have subsites or certain apps can't be deleted. Please try again after deleting all subsites and removing the apps. There was a problem deleting Web site "Site-URL". Sites that have subsites or certain apps can't be deleted. Please try again after deleting all subsites and removing the apps. Reviewed by Salaudeen Rajack on 11:54 PM Rating: 5

How to Gain Owner Access to OneDrive for Business Sites in Office 365?

6:01 PM    , , , ,
By default, When SharePoint My Site or OneDrive site collection is created by the user, SharePoint assigns primary site collection administrator rights to the user. In some cases you might need to gain Admin access to a OneDrive for Business site of a user. E.g. User left the company and manager of the user wants to gain access, Backup purposes, compliance, security, etc. How to get admin access to the OneDrive for Business site in Office 365? To gain access to a user's OneDrive site, follow these steps: Login to SharePoint Online Admin Center Click on "User Profiles" link from left navigation >> Click on "Manage User Profiles" link under "People" group Search and pick the user profile which you want to gain access. From the search result, Click on the menu item "Manage site collection owners" from the context menu. Add any additional administrators to the site collection in "Site Collection Administrators" field.
How to Gain Owner Access to OneDrive for Business Sites in Office 365? How to Gain Owner Access to OneDrive for Business Sites in Office 365? Reviewed by Salaudeen Rajack on 6:01 PM Rating: 5
Powered by Blogger.