Forum Discussion
SYN_Dominik
Nov 25, 2022Brass Contributor
Delete team site permanently via PowerShell
Hi all, Sometimes I have the need to delete a team permanently to be able to use the site url and stuff again. Process: Delete the Team, go to Azure and delete the group permanently, go to sha...
SteveKnutson
Nov 27, 2022MVP
Have you tried running Get-AzureADMSDeletedGroup to see if the Group is still present after the hard delete?
Office Groups are retained for 30 days after a delete normally. Using the command above will give you a list of Office Groups marked for delete.
Use Remove-AzureADMSDeletedDirectoryObject to remove the group completely.
SYN_Dominik
Nov 28, 2022Brass Contributor
Hi SteveKnutson
Remove-PnPDeletedMicrosoft365Group is doing the same job.
To make sure the group deletion is running successfully, I created a new group and deleted it with Remove-PnPDeletedMicrosoft365Group. Afterwards neither Get-AzureADMSDeletedGroup nor Get-AzureADMSGroup show the group.