SharePoint Online Office 365
5 TopicsPowershell for sharepoint online
Hi, I have a powershell script related to SharePoint 2013 server. Can this be converted to work on online, as the site is community site template which was available in SharePoint 2013 and its also available in SharePoint online. we are having an issue with community SharePoint site online and need to use the same script which fixed the issue on SP 2013 community site. Below is the script $web = Get-SPWeb <Affected web URL here> $categorieslist = $web.Lists["Categories"] $categorieslist.Title = "Categories_old" $categorieslist.RootFolder.MoveTo($web.Url + "/lists/categories_old") $categorieslist.Update() Write-Host "Categories list issue fixed..." Disable-SPFeature -Identity CommunitySite -Url $web.Url Enable-SPFeature -Identity CommunitySite -Url $web.Url Write-Host "Community Site Feature reactivated..."Solved4KViews0likes3CommentsPowerShell to find all suspended workflow for classic SharePoint online sites
I have a powershell script to find the list for all suspended workflows in classic SP online site but i am getting error "Add-PsSnapin : No snap-ins have been registered for Windows PowerShell version 5". On some research i found that this sript is for SP server Can you please advise, how to modify it to use it with SP online. Thanks if ( (Get-PSSnapin -Name "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue) -eq $null ) { Add-PsSnapin Microsoft.SharePoint.Powershell } $siteURL = "<Site URL>"; $libName = "<LibraryName>"; $spWeb = Get-SPWeb $siteURL; $spList = $spWeb.Lists[$libName]; $spListItems = $spList.Items; #Get the Workflow Manager object and then the instance of the Manager $wfMgr = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($spWeb); $wfInstanceSvc = $wfMgr.GetWorkflowInstanceService(); foreach($spListItem in $spListItems) { #Get a list of workflow instances running for the item in the library $wfInstances = $wfInstanceSvc.EnumerateInstancesForListItem($spList.ID, $spListItem.ID); foreach($wfInstance in $wfInstances) { #Check to see if the instance is suspended. If so, write it. if($wfInstance.Status -eq "Suspended") { write-host("Instances for library item: {0}" -f $spListItem.ID); } } }1.4KViews0likes2CommentsTerminate only suspended sharepoint 2013 workflows using powershell for sharepoint online
if ( (Get-PSSnapin -Name "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue) -eq $null ) { Add-PsSnapin Microsoft.SharePoint.Powershell } $siteURL = "<Site URL>"; $listName = "<ListName>"; $spWeb = Get-SPWeb $siteURL; $spList = $spWeb.Lists[$listName]; $spListItems = $spList.Items; #Get the Workflow Manager object and then the instance of the Manager $wfMgr = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($spWeb); $wfInstanceSvc = $wfMgr.GetWorkflowInstanceService(); foreach($spListItem in $spListItems) { #Get a list of workflow instances running for the item in the list $wfInstances = $wfInstanceSvc.EnumerateInstancesForListItem($spList.ID, $spListItem.ID); foreach($wfInstance in $wfInstances) { #Check to see if the instance is suspended. If so, terminate it. if($wfInstance.Status -eq "Suspended") { write-host("Terminating instances for list item: {0}" -f $spListItem.ID); $wfInstanceSvc.TerminateWorkflow($wfInstance); } } } Hi , we have a work flow for our document library which was built in SP 2013. Now it been migrated to SharePoint online. In our library, we have few workflows which are started by system accounts and they re showing as suspended. I am looking for a PS script which can help us terminate only those suspended workflows. I found the script as below, but looks like its doing the termination for list, what changes i need to make it work for document library? Thanks837Views0likes0CommentsSharePoint Online Usage
The tenant I administer has several thousand individual SP Online sites, I need to start reporting on the data that is being used within these sites. Is it possible to get a count of each file extension used within each site (Word, Excel, PDF etc) Dates any files were added within the site and updated dates? Outside of the actual files, in terms of the sites, using Powershell (as the built in usage reports within SP Admin don't appear to provide the detail), can these stats (for each site, total number of visits, number of unique visitors for a calendar month be created?572Views0likes0CommentsScript from 2 csv - URL list and Folder list
Hello there! I have 2 csv files. one has 82 rows with unique site address. like below the other has 1314ish folder names with path. like below Previously, I used to create 1000s of folder per site per script and now I have to create the same set of folders on 82 sites. so was trying to improvise the script by importing a csv and added 'for each'. the script works but skips all sites and goes to the last site in the list and creates the 1314 folders with correct permission. below is what I added to the script trying to trigger the loop. Please help! I have attached the full script as well. $csvs= Import-CSV $csvfilepathsite foreach ($row in $csvs) { $url = $row.siteurl $GroupNames=$row.GroupNamesSolved1.2KViews0likes2Comments