aad o365group recyclebinitem remove
Permanently deletes a Group from the recycle bin
| Option | Description |
| ----------------------- | ----------------------------------------- |
| --id [id] | Id of the Group in the recycle bin |
| -d, --displayName [displayName] | Displayname of the Group |
| -m, --mailNickname [mailNickname] | Mailnickname of the Group |
| --query [query] | JMESPath query string |
| --confirm | Does not ask for confirmation |
Reference: Graph endpoint
I don't think we have it at the moment yet, so it would be a nice addition indeed.
@waldekmastykarz: what about this suggestion? We might search for another name.
All groups will be deleted if no parameters are specified
I'm a bit hesitant to have this as a default behavior. What if we introduced a separate switch --all so that it's an explicit action to remove all groups rather than something that you could accidentally do by omission?
As for the naming, right now we have the aad o365group remove and ... restore commands. In SPO we have spo tenant recyclebinitem remove and ...restore for specifically working with deleted sites. Since the O365 Group restore command is already in the o365group name, I think we should add this command in the same namespace too. What's confusing is that by attaching the permanent delete command to o365group makes it look on the outside like you would delete an existing group directly rather than moving it to the recycle bin. Something, that we'd ideally solve by introducing --skipRecycleBin like we do on spo site remove. Similarly, for SharePoint sites, we have the --fromRecycleBin option on spo site delete that permanently deletes a removed site. There is however no concept of recycle bin for O365 groups.
So I guess the final question is: do we align with other commands in the CLI or do we follow the API that we use and offer inconsistent commands to our users?
Updated the specs. (Added --all and changed the naming).
I am going to create two more issues:
Can I propose using recyclebinitem instead of recyclebin as we're not deleting the recycle bin itself but rather an item inside?
@pnp/cli-for-microsoft-365-maintainers any other feedback before we start working on this?
There is however no concept of recycle bin for O365 groups.
There is a screen in the Microsoft 365 Admin Center that displays Deleted groups, https://admin.microsoft.com/AdminPortal/Home#/deletedgroups and in the SharePoint Admin Center what would be the recycle bin is now called Deleted sites. Whilst not explicitly stated I think that using the recycle bin name is something that the majority of users would understand.
do we align with other commands in the CLI or do we follow the API that we use and offer inconsistent commands to our users?
Based on existing commands, I think that the below commands would provide some consistency, which aligns with what you've already discussed.
aad o365group recyclebinitem list
aad o365group recyclebinitem remove
aad o365group recyclebinitem restore
I'm not sure on the --all switch however and would prefer to see an explicit command for this due to its potentially destructive behaviour, we could then also create a similar named command for clearing the SharePoint deleted sites recycle bin.
aad o365group recyclebin clear
spo tenant recyclebin clear
Good suggestions @garrytrinder 馃憤 @plamber, what do you think about updating the spec to follow Garry's suggestions?
I am going to update the specs and create separate issues for all remaining commands
Looking at the spec, is there a reason why the name and mail shouldn't be an exact match rather than a 'begins with'? In other commands we use an exact match so for consistency it would be better to follow the same approach here.
Also, let's change o365groups to a singular o365group
Most helpful comment
Can I propose using
recyclebiniteminstead ofrecyclebinas we're not deleting the recycle bin itself but rather an item inside?