Share via

Automate a PowerShell script that updates information on all SharePoint sites.

Anonymous
2025-01-09T18:44:20+00:00

Hello

Please i need your help on this issue.

My IT department has a few PowerShell scripts we are currently using to mass update various settings and user information in our SharePoint sites. Outside of running them using Task Scheduler, is there a way to automate them using Power Automate or something similar?

As a quick side question, is there a way to avoid the authentication that occurs when using Connect-SPOService?

I've tried passing in the admin credential, but receive the following error when I do:

Connect-SPOService : One or more errors occurred.

At C:\Users\Kperry\Documents\defaultopen.ps1:46 char:1

  • Connect-SPOService -URL $AdminSiteURL -Credential $cred

[Connect-SPOService], AggregateException

  • FullyQualifiedErrorId : System.AggregateException,Microsoft.Online.SharePoint.PowerShell.ConnectSPOService

The only way I've had the script succeed is by not passing a credential into the function. Which means I then have to manually select my login credential from the sign-in popup that appears.

Without a solution to this, I feel that automating the script would be a bit pointless (as I will have to manually sign in when it

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-01-10T04:57:17+00:00

    Dear User,

    Good day!!

    I understand your concern but since you are looking to automate the PowerShell script with the Power Automate flow, I would like to request you post your requirement in the Power Automate community i.e., Microsoft Power Platform Community Forum Thread to get the detailed help from the experts.

    In addition, I also request you cross-post your concern in the SharePoint Developer community i.e., SharePoint Developer - Microsoft Community Hub & Questions - Microsoft Q&A with SharePoint Development tag to get the opinions from the experts.

    Apologies for redirecting you to different community as the members in the category posted focus on the users with the out of the box concerns in Microsoft 365 and have limited knowledge on Power Automate flow and custom scripts, so to get the fast and better assistance, we have redirected you in the correct path.

    Appreciate your patience and understanding. Have a great day!!

    Best Regards,
    Sophia

    Was this answer helpful?

    0 comments No comments