kwizcom banner advertisement

SharePoint Online: Upload File to Sub-Folder using PowerShell

January 21, 2018    , ,
Requirement: SharePoint Online PowerShell to Upload File to Folder PowerShell to Upload File to SharePoint Online Sub-Folder Here is the PowerShell to upload file to SharePoint Online Document library subfolder. #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/sites/marketing" $SourceFilePath="C:\Users\salaudeen\Desktop\Project Documents\Discloser Asia.doc" $TargetFolderRelativeURL ="/sites/Marketing/Shared Documents/2018/Active" #Setup Credentials to connect $Cred= Get-Credential $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) Try { #Setup the context
SharePoint Online: Upload File to Sub-Folder using PowerShell SharePoint Online: Upload File to Sub-Folder using PowerShell Reviewed by Salaudeen Rajack on January 21, 2018 Rating: 5

SharePoint Online: Upload a Folder using PowerShell

January 21, 2018    , , ,
Requirement: Upload a Folder to SharePoint Online using PowerShell Prerequisites: Make sure you have installed SharePoint Online Client Components SDK in your machine to use client side assemblies. You can download it from: https://www.microsoft.com/en-us/download/details.aspx?id=42038 PowerShell to Upload a Folder Structure to SharePoint Online (Folder, Sub-Folders and Files): Lets upload a folder to SharePoint Online using 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\Microsoft.SharePoint.Client.Runtime.dll" #Function to Check if Folder Exists. If not, Create the Folder Function Ensure-SPOFolder() { param ( [Parameter(Mandatory=$true)] [string] $FolderRelativeURL ) #Check Folder Exists Try { $Folder = $
SharePoint Online: Upload a Folder using PowerShell SharePoint Online: Upload a Folder using PowerShell Reviewed by Salaudeen Rajack on January 21, 2018 Rating: 5

SharePoint Online: Export List Data to XML using PowerShell

January 20, 2018    , ,
Requirement: Export SharePoint Online List data to XML file. PowerShell to Export SharePoint Online List Data to XML #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 valuesss $SiteURL="https://crescenttech.sharepoint.com/" $ListName="Projects" $XMLFile ="C:\Temp\ProjectData.xml" 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 the web & List objects $Web = $Ctx.Web $Ctx.Load($Ctx.Web) $List = $Web.Lists.GetByTitle($
SharePoint Online: Export List Data to XML using PowerShell SharePoint Online: Export List Data to XML using PowerShell Reviewed by Salaudeen Rajack on January 20, 2018 Rating: 5

SharePoint Online: Import XML to List using PowerShell

January 19, 2018    , ,
Requirement:   Import XML to SharePoint Online List PowerShell to Import XML to SharePoint Online List Here is the PowerShell to import XML in to SharePoint Online list #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" $XMLFile ="C:\Temp\ProjectData.xml" 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 the web & List objects $Web = $Ctx.Web $Ctx.Loa
SharePoint Online: Import XML to List using PowerShell SharePoint Online: Import XML to List using PowerShell Reviewed by Salaudeen Rajack on January 19, 2018 Rating: 5

SharePoint Online: Export Site Collection Administrators to CSV Report

January 19, 2018    , , , ,
Requirement: Get Site Collection Administrators Report for SharePoint Online. PowerShell to Get Site Collection Administrators in SharePoint Online and Export to CSV: Lets get site collection admins of all SharePoint Online sites and export them to a CSV report using PowerShell. #Variables for processing $AdminURL = "https://Crescenttech-admin.sharepoint.com/" $ReportOutput="C:\Temp\SiteCollectionAdmins.csv" Try { #Connect to SharePoint Online Connect-SPOService -url $AdminCenterURL -Credential (Get-Credential) #Get all Site colections $Sites = Get-SPOSite -Limit ALL $SiteData = @() #Get Site Collection Administrators of Each site Foreach ($Site in $Sites) { Write-host -f Yellow "Processing Site Collection:"$Site.URL #Get all Site Collection Administrators $SiteAdmins = Get-SPOUser -Site $Site.Url -Limit ALL | Where { $_.IsSiteAdmin -eq $True} | Select DisplayName, LoginName
SharePoint Online: Export Site Collection Administrators to CSV Report SharePoint Online: Export Site Collection Administrators to CSV Report Reviewed by Salaudeen Rajack on January 19, 2018 Rating: 5

SharePoint Online: Export List Version History to Excel using PowerShell

January 15, 2018    , , , , ,
Requirement: Export all versions of SharePoint Online List Items to CSV (Excel) file. PowerShell to Extract and Export List Item's Version History to CSV File: This article assumes you have an existing SharePoint Online list with columns given below. You may have to create and change columns according to your requirement. #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 Export-VersionHistory() { param ( [Parameter(Mandatory=$true)] [string] $SiteURL, [Parameter(Mandatory=$true)] [string] $ListName, [Parameter(Mandatory=$true)] [string] $CSVFile ) Try { #Delete the Output report file if exists if (Test-Path $CSVFile) { Remove-Item $CSVFile }
SharePoint Online: Export List Version History to Excel using PowerShell SharePoint Online: Export List Version History to Excel using PowerShell Reviewed by Salaudeen Rajack on January 15, 2018 Rating: 5

SharePoint Online: Find and Delete Orphaned Users using PowerShell

January 04, 2018    , , , , ,
What is "Orphaned Users" in SharePoint Online? In short, Orphaned users are those who deleted from the authentication provider (such as removed from Active Directory when user leaves the organization), and still continue to exist in SharePoint online sites! scanning each user in SharePoint online site collection for orphaned users could take days to complete! Since, Here is my PowerShell script to search for orphan users and delete them. Pr-Requisites: Before using this script, you need to have SharePoint Online Management Shell ( https://www.microsoft.com/en-us/download/details.aspx?id=35588 ) and Azure Active Directory Module ( https://technet.microsoft.com/en-us/library/dn975125.aspx ) installed on your machine! Find Orphan Users in SharePoint Online using PowerShell: This script scans each and every user from the given site collection URL and exports list of orphaned users to a CSV file. #Import SharePoint Online and Azure Online modules Import-Module Micros
SharePoint Online: Find and Delete Orphaned Users using PowerShell SharePoint Online: Find and Delete Orphaned Users using PowerShell Reviewed by Salaudeen Rajack on January 04, 2018 Rating: 5
Powered by Blogger.