Issue with Deleting Site collections
From @suz7777 on December 28, 2016 17:13
####Which PnP repository should you use to report the issue?####
- PnP PowerShell - https://github.com/OfficeDev/PnP-PowerShell
Category
[x ] Bug [x] Enhancement
Environment
[x ] Office 365 / SharePoint Online
if we do the following:
• Create a site collection via PNP with the Site Collection URL – ie: corpBG04 o A site collection is created o A site collection termstore group is created – for example: Site Collection - tenantname.sharepoint.com-sites-corpBG04 • We delete a site collection o Remove-SPOSite $siteCollectionUrl o Remove-SPODeletedSite $siteCollectionUrl • We re-create a site collection via PNP with the same Site Collection URL – ie: corpBG04 o The site collection is re-created o A site collection termstore is created – for example: Site Collection - tenantname.sharepoint.com-sites-corpBG04-1 NOTE: The original termstore still exists – but is not visable via Site Settings- Term Store Management Tool - Site Collection - tenantname.sharepoint.com-sites-corpBG04 o We rename the new termstore (remove the -1 from the site collection termstore name) to Site Collection - tenantname.sharepoint.com-sites-corpBG04 o Use PNP to create term sets o When we use the PNP to provision the site columns and content types, we link to the termsets created for the site collection • Use code to access termstore o var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(ctx); o var termStore = taxSession.getDefaultSiteCollectionTermStore(); o var termSetCollection = termStore.getTermSetsByName(termSetName, 1033); o var termSet = termSetCollection.getByName(termSetName); o var terms = termSet.getAllTerms(); o ctx.load(terms, "Include(IsRoot, Labels, TermsCount, CustomSortOrder, Id, IsAvailableForTagging, Name, PathOfTerm, Parent, TermSet.Name, CustomProperties, LocalCustomProperties)"); o ctx.executeQueryAsync() o These commands return the ORIGINAL termstore and data – not the new termset we renamed.
We need to know how to do the following: • Remove-SPOSiteCollectionTermSet $termSetName • Remove-SPOSite $siteCollectionUrl • Remove-SPODeletedSite $siteCollectionUrl
OR we need the remove-sposite to also delete the termset
We also need to know how to do the following: • Remove an ORPHANED termstore that still exists after we deleted and recreated a site collection (basically clean up these site collections)
Thanks! suz
Copied from original issue: SharePoint/PnP#1578
From @suz7777 on December 28, 2016 17:16
here is how we would do this on premise: http://www.thesharepointbar.com/?p=432
We closed this issue as it had not activity within last 180 days. This is a generic process we have decided to perform for issues, which have not been explicitly marked still to be "work in progress" based on tags. We are performing this cleaning to make sure that old issues that have already been solved (but not closed) or are no longer relevant are cleaned out and make the issues more manageable. If this issue still valid, we would ask you to open a new issue and follow the guidance in the issue template related on the recommended location. We do apologize any inconveniences this might cause. Please do remember that issues in the issue lists are also messages for others in the community, so you can also check if you can assist on any of them. “Sharing is caring!”