Sending PowerShell script output to a remote SharePoint folder

Copper Contributor

Hi all, 


I am currently working on a PowerShell script which has its own logging function. 

I'm currently logging into a local file on my desktop, but I want to the logs to be directly send to a remote SharePoint folder. So far I couldn't find a good solution without storing the "logs" locally and then upload them to a SharePoint. 


I'm trying to this with the out-file command from PowerShell.



Has anyone a clue how to solve this or is there basically no way to do this.



Best regards

2 Replies
best response confirmed by Nick_2022 (Copper Contributor)

@Nick_2022 are we talking about SharePoint Online (Cloud) or SharePoint On-Premise version ?


For SharePoint Online you can use the following link as starting point here

For SharePoint On-Premise you can use the following link as starting point here


Concerning SharePoint Online things are more "complicated" depending on your M365 Tenant configuration. If you have MFA enabled in your tenant (most probably) then I suggest you to use a ClientId approach (here a sample)

@mr_w1nst0n Thank you for sharing these Links :)