cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kjmcintosh
Level: Powered On

powershell command to office365 flow

Is it possible to schedule powershell commands in flow to work on office 365 online.

I am wanting to run this command every week

Get-MessageTrace -senderAddress a.user@company.com -StartDate 10/08/2018 -EndDate 10/15/2018 | group-object -Property RecipientAddress | select name,count | sort count -desc

Is it possbile and if so can I feed in variablies to the startdate and enddate so that every week I can collect the results (idealy saved to a sharepoint list) of the last week

output looks like this

Name                                     Count
----                                          -----
some.body@anothercompany.com    10

another@another.com                         6

etc.....

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: powershell command to office365 flow

 

Hi @kjmcintosh ,

 

You could use Recurrence as a trigger and set Flow to run once a week.

Here is a blog on Run any PnP-PowerAhell in one AzureFunction from Microsoft Flow for your reference:

http://johnliu.net/blog/2018/4/run-any-pnp-powershell-in-one-azurefunction-from-microsoft-flow

Besides, it seems that we could also run on-premises PowerShell script from flow, the following blog for your reference:

https://sergeluca.wordpress.com/2017/12/01/upload-and-run-a-remote-powershell-script-from-microsoft-...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: powershell command to office365 flow

 

Hi @kjmcintosh ,

 

You could use Recurrence as a trigger and set Flow to run once a week.

Here is a blog on Run any PnP-PowerAhell in one AzureFunction from Microsoft Flow for your reference:

http://johnliu.net/blog/2018/4/run-any-pnp-powershell-in-one-azurefunction-from-microsoft-flow

Besides, it seems that we could also run on-premises PowerShell script from flow, the following blog for your reference:

https://sergeluca.wordpress.com/2017/12/01/upload-and-run-a-remote-powershell-script-from-microsoft-...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

kjmcintosh
Level: Powered On

Re: powershell command to office365 flow

Thanks very much. Although I will really need to look at locking that down so might just run it locally for the time being.

appreciate you help.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,578)