Forum Discussion
KJS
May 03, 2017Brass Contributor
Sharepoint online management module reference broken in azure
I have a azure web job in C# where i am trying to connect to SPO through connect-sposervice. I have copied the complete Sharepoint online management shell folder from my local into my project and upl...
Peter McDonald
May 09, 2017Iron Contributor
It can be tricky to use the SPOnline module from a webjob as it has a lot of associated binaries, one option could be to trigger an associated Azure Automation script using a webhook to then run the PowerShell components, see here: https://blogs.msdn.microsoft.com/razi/2014/08/22/getting-started-with-sharepoint-online-automation-using-azure-runbook/
An alternative would be to use the CSOM APIs instead of using PowerShell at all, see here:
https://zimmergren.net/getting-started-with-building-azure-webjobs-timer-jobs-for-your-office-365-sites/
Hope this helps.
An alternative would be to use the CSOM APIs instead of using PowerShell at all, see here:
https://zimmergren.net/getting-started-with-building-azure-webjobs-timer-jobs-for-your-office-365-sites/
Hope this helps.
KJS
May 25, 2017Brass Contributor
Thanks Peter for the reply. I can not use csom as i need to get information from the tenant and csom does not supports the tenant or farm object informtion.
I have used azure automation to host the script and moved my c# to powershell only. It helped to sort it out.
- May 28, 2017That's not correct...SPO cmdlets are built on top of CSOM and in CSOM you have a tenant assembly you can use to work at the tenant level...and just as a reminder, in SPO the highest level you can work is the tenant level, no the farm one
- KJSMay 30, 2017Brass Contributor
Hi Juan,
What i was trying to do was get the site collections list in the tenant and details, I did not get any object in C# to access the tenant object , I could see there is a third party dll in nuget which i could use to get the tenant object but i wanted to stick to microsoft.
If you can share some example or some article that would be good to know for future knowoledge.
Thanks,
KJ
- May 30, 2017Here you are :-) https://gallery.technet.microsoft.com/How-to-get-all-the-tenant-2999c21b?redir=0 as you can see, you just need to use CSOM dlls and no third party ones