Closed mkm17 closed 4 months ago
Hi, @mkm17, very nice suggestion! This could definitely be useful for a lot of people. However, I would like to know if we should make a sample script of it instead of a command. Commands should always be relevant. Over a few years when these things are marked as end-of-life, the command won't be used anymore. That's why I think it's better that we make it a sample script.
@pnp/cli-for-microsoft-365-maintainers any opinions?
Great suggestion @mkm17 and agreed @milanholemans that it would be a better candidate for a script if we're considering the retirement angle.
Before we commit to it, we'd need to research if it's even possible.
@milanholemans @waldekmastykarz Ok, you are right, the script would be better. However, just in case, I would also check if there is a way to obtain this information.
Would you be willing to help us with the research @mkm17?
@waldekmastykarz of course. I am not an expert in these solutions, but I will try to investigate to have a foundation for further discussion.
We appreciate your help @mkm17. Don't hesitate to share your findings and ask for help if you're stuck at any time
Hi @waldekmastykarz @milanholemans, After a quick investigation, it appears that obtaining all information is achievable using the current commands contained in the CLI.
Remote Event Receivers For Remote Event Receivers, the script should analyze all sites, webs, and lists/libraries through the spo eventreceiver list. The results give also default Event Receivers, identifiable by properties such as e.g. "ReceiverAssembly" Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" or "ReceiverClass": "Microsoft.SharePoint.Webhooks". In this scenario, we can choose to exclude them by checking for the presence of the string "Microsoft." in ReceiverClass or ReceiverAssembly. Alternatively, all receivers can be included, accompanied by a note specifying that these are default receivers (I am not sure if we can create a custom receiver setting these properties).
Azure ACS After creating an app using the page _layouts/15/appregnew.aspx I managed to locate it in the Azure Portal under the Enterprise Application section with the Application Type filter set to All Applications. We can retrieve these applications by executing m365 entra sp list and filtering items based on the servicePrincipalType being equal to Legacy
SharePoint Add-Ins
In this case, we can retrieve all libraries with BaseTemplate 330 which corresponds to the global AppCatalog type, and 336 represents a local AppCatalog on my tenant. For these libraries we obtain all files using m365 spo file list and search for items with the .app (to be confirmed if is correct) file extension in the Name or ServerRelativeUrl property (confirmation if this is enough needed). The .sppkg extension is associated with modern packages.
We store the data for all solutions with the .app extension and then search for the same names/ids among installed solutions per site using spo app instance list
The script would proceed as follows:
Do I have missed something? Unfortunately, I do not have any custom SharePoint Add-ins on my test tenant so I cannot confirm if all information included is correct.
Thorough research @mkm17! Really nice! It all makes sense to me. I think app add-ins end with .app
indeed. We only have to question whether we assume that the user has access to all sites because that's what we need to read every site in the tenant.
Should we include an option to add the user as site collection admin to each site?
About site collection app catalogs, we can easily list them using spo site appcatalog list as well.
Hello @milanholemans, thanks for the tips. I had some free time, and I created an initial script in my branch. Before submitting a pull request, I have a few questions that need clarification:
I still need to test the script on different tenants, but I plan to do so next week. If everything goes smoothly, we should have the script ready by the end of the following week.
@mkm17 we have a guide how to properly add a script sample for our repo https://pnp.github.io/cli-microsoft365/contribute/script-sample/new-script-sample
you may go over the steps and the structure and double check if it answers your questions. Don't hesitate to reach me (us) out directly if you need any kind of help or have any kind of question 👍
Create a sample script that provides a report detailing the retirement status of components within the current SharePoint Online tenant
Original issue
Usage
m365 spo report retirementstatus
Description
Retrieve a report detailing the retirement status of components within the current SharePoint Online tenant
Options
-s, --sharePointAddInsOnly [sharePointAddInsOnly]
-e, --eventReceiversOnly [eventReceiversOnly]
-a, --azureACSOnly [azureACSOnly]
Examples
Retrieve information regarding the retirement of Azure ACS, SharePoint add-ins, and Remote Event Receivers.
Retrieve information specifically about the retirement status of Azure ACS only.
Retrieve information specifically about the retirement status of SharePoint add-ins and Remote Event Receivers.
Default properties
Additional Info
Hi everyone,
I have a proposal that I believe could greatly benefit our tenant administration process. I'm thinking of creating a report that provides insights into the retirement status of various features, such as the SharePoint Online add-ins and more. This report aims to help administrators be better prepared for upcoming feature retirements, ensuring a smoother transition. Some details are available here.
While I'm not certain about the feasibility of gathering all the information needed, I'm eager to hear your thoughts and suggestions on this idea.