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
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 404 members 2,914 guests
Please welcome our newest community members: