SOLVED

Upload Sharepoint File Online and Share using Powershell Script

Brass Contributor

Hello friends,
To summarize:

 

I receive data from a MySQL table and it is processed via Powershell. This processing generates a CSV file.

 

This file, the Powershell Script itself, uploads to a Sharepoint Online library.

 

What I think - Two possibilities:
1) Or send the file to whoever requests it directly by email, and for this I would like to use the Script code for this;
OR
2) When uploading to a Sharepoint Online library, sharing for those who request it automatically upon execution.

 

Contextualizing:
We receive many requests for Auditing shares or in shared boxes, PO boxes, OneDrive or SharePoint sites.

 

Each request from this was initially a manual action.

 

Now a form that receives the request. The data from this form fills a table, which is consulted by a Powershell script and carries out the processing, generating the result with this file locally.

This part of the "local file" still requires us to return it to the requestor manually. What we want is to make this last step automatic,

 

If so, is there any script or code suggestion for this?

 

Thank you very much for everyone's attention

Big Hugs

4 Replies

You could use Send-MgUserMail for that? I wrote a blog post about that in the past here

 


Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.

If one of the posts was helpful in other ways, please consider giving it a Like.

best response confirmed by tcboeira (Brass Contributor)
Hi Harm_Veenstra,
Hello everybody...
First of all, I apologize for the delay in getting back to you.

I want to say that I was relatively successful, that I was very happy. And I did a lot of testing. Here in Brazil we have a popular saying that "whoever wants the finger, gets an arm"... As soon as I was successful and tested it in different ways, incorporating it into my script and using the variables that I was generating, I took the opportunity to test it - and also successfully - when one of my reports generates two output files, which are also important.

So I can't even thank you for all of this.
Thank you very much!!!



No worries, I'm glad that it worked out for you... Even though you are missing one of your arms now 😉

1 best response

Accepted Solutions
best response confirmed by tcboeira (Brass Contributor)