SOLVED

Deleting a Team from within Teams client UI seems to leave the associated SharePoint group site

Brass Contributor

From within the Teams client application I deleted a team.  However I noticed its associated Sharepoint site is still there.

 

I can manually delete that also, but I just wanted to know if this is how it is supposed to work and what else might I need to delete manually associated with the deleted team?

 

I am running Windows 7 client.

We have an O365 Enterprise E3 license.

 

 

21 Replies

@Ellya Gold - very nice instructions!  I had not previously worked with powershell so it took awhile for me to get back to this, I had a bit of a learning curve just to get started.

 

In case anyone else is just getting started with powershell with SharePoint online (O365), here are my beginner tips:

  • You have to first install SharePoint Online Management Shell (required to use powershell to interact with SP Online) https://www.microsoft.com/en-us/download/details.aspx?id=35588
  • You must be an O365 global administrator
  • You must open powershell on your PC as an administrator
  • Then you must connect to your SP site before executing any commands: 
     -    Connect-SPOService -Url https://domain.sharepoint.com

 

Sample commands:

Get-SPSite : output is a columnar table listing of all your SP sites.  Default columns are URL, owner and Storage Quota

Get-SPSite | Get-Member : output is a list of all the SP-Site properties. Reference these names in explicit Select statement.

Get-SPSite | Select field1, field2, etc : will display just those column values in columnar table format

Get-SPSite | Select field1, field2, etc | Format-Table -Autosize  :   will set column widths to longest value in that column.  Otherwise, the default column widths may truncated some values. 

Get-SPSite | Select field1, field2, etc. |  Where field2 -eq 'xxxxx' | Format-Table -Autosize  :  limit output based on Where criteria

Get-SPSite | Select field1, field2, etc. | Where field2 -eq 'xxxxx' | sort field1 | Format-Table -Autosize  :  sort by specified column

Get-SPSite | Select field1, field2, etc. | Where field2 -eq 'xxxxx' | sort field1 | Format-List  :  the output values are displayed in a vertical list instead of a table. Each line is field-title : field-value

 

Use Start-Transcript to copy all input/output during your powershell session to a file.

     Start-Transcript -Path c:\temp\ps.txt -Append

     ....

     Stop-Transcript

 

A couple of intro articles I found helpful:

http://www.itprotoday.com/management-mobility/powershell-objects-and-output 

https://www.petri.com/powershell-101-sharepoint-friends

 

Complete TechNet documentation:  https://docs.microsoft.com/en-us/powershell/scripting/powershell-scripting?view=powershell-6

 

 

Thanks again for putting me on a powershell adventure!

 

 

Alessandro - I do not know how to do that directly, but could you do something like make the Team private and remove all the other members so that they do not see any references to it anywhere?  I think you will want to stay a member so that you can have access to the behind the scenes SharePoint team site.

 

There is also a  HiddenFromAddressListsEnabled parameter to the Set-UnifiedGroup powershell command that specifies whether the Office 365 Group appears in the global address list (GAL) and other address lists in your organization. Replace "Marketing Department" with your team name.  I've never done this but it looks like it would be relevant for you. 

 

Set-UnifiedGroup -Identity "Marketing Department" -HiddenFromAddressListsEnabled $true

 

 

There may be some other creative workarounds if what you want to do is not possible. Hopefully this could work for you or will give you other ideas to try.