Add a button to sharepoint that triggers a powershell script

Abivanth R 20 Reputation points
2025-06-20T04:59:38.2+00:00

Hello Everyone,

I have a backend logic which get user's site details like sites the user is owner of, storage usage details, recycle bin usage details and members in that site. I am sending all this details to the user over mail. I need to do this action in click of a button on sharepoint. Any help is much appreciated!!

To perform this action I am using Azure application with required api permissions, Hosting the script .ps1 on azure runbook.

when users clicks the button it needs to get users UPN as input or dynamically is fine. Please feel free to reply to this if you have any questions.

Thanks.

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Tammy-Ng 155 Reputation points Microsoft External Staff Moderator
    2025-06-20T08:18:03.1466667+00:00

    Dear Abivanth R

    Good day, and thank you for posting your question in the Microsoft Q&A forum.

    I commend the thoughtful design of your backend logic, it demonstrates a clear understanding of the platform's capabilities. 

    Based on the details you've provided, it’s evident you're seeking an optimal approach within SharePoint to initiate a PowerShell script that gathers comprehensive site data and delivers it to users via email. 

    However, as forum moderators, we do not have access to backend systems, which makes this kind of task particularly challenging, especially with the level of hard-coding involved.

    For more advanced and tailored support, I highly recommend reaching out directly to https://techcommunity.microsoft.com/. You can get more professional help, there will be very professional people to tell you about the steps on how to realize this function.    

    We hope this information is helpful and sincerely appreciate your understanding. Please let us know if there’s anything further we can do to support you


     If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.