0

I have a project which requires a reporting tool be included in it. I need to be able to run the Management Shell command Get-SPOSite several times a day at regular intervals. As I am dealing with an O365 tenancy I have to use Azure webjobs for this but every source I have found for running powershell scripts from a console app has been contradictory and none of them address the problem of the extra step of management shell having to connect and authenticate with the tenancy.

Can anyone explain in a few simple step how I might accomplish this

0

If you are using SharePoint online management cmdlets in web jobs the you need to copy all the cmdlet module files and its dependent binaries along with your powershell script, identifying these files is tricky. Instead of using SharePoint online management cmdlets, you can directly use CSOM APIs in a console application. In that case you need copy only your exe and the referenced Sharepoint client dlls to the webjobs.

Refer:https://zimmergren.net/getting-started-with-building-azure-webjobs-timer-jobs-for-your-office-365-sites/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.