Comments on: Creating Files in SharePoint Online Using Azure Automation and PowerShell https://practical365.com/azure-automation-spo-create-files/ Practical Office 365 News, Tips, and Tutorials Mon, 21 Aug 2023 18:00:52 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_271716'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_271716"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/azure-automation-spo-create-files/#comment-271716 Wed, 09 Aug 2023 13:03:45 +0000 https://practical365.com/?p=55356#comment-271716 In reply to Azad Kumar.

I’m sure that you can…

But is there a better way to get files from file shares to SharePoint Online? Like Mover https://learn.microsoft.com/en-us/sharepointmigration/mover-plan-migration?WT.mc_id=M365-MVP-9501

]]>
By: Azad Kumar https://practical365.com/azure-automation-spo-create-files/#comment-271712 Wed, 09 Aug 2023 12:50:52 +0000 https://practical365.com/?p=55356#comment-271712 Hey Tony,

I like the post. Can we upload the CSV files from Azure File Shares to SharePoint online using Azure RunBook powershell?

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_245196'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_245196"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/azure-automation-spo-create-files/#comment-245196 Thu, 20 Oct 2022 21:07:28 +0000 https://practical365.com/?p=55356#comment-245196 In reply to Aja.

I haven’t tried posting information extracted from Office 365 to a dataverse, but if an API is available to Azure Automation to do the job, then go for it!

]]>
By: Aja https://practical365.com/azure-automation-spo-create-files/#comment-245195 Thu, 20 Oct 2022 20:48:55 +0000 https://practical365.com/?p=55356#comment-245195 Hi Tony,

I like this post and the idea.

However, is there a way I can iterate through and post them into a dataverse.

I’m running it on Azure Automation runbooks.

Thanks.

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_245098'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_245098"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/azure-automation-spo-create-files/#comment-245098 Wed, 19 Oct 2022 06:50:09 +0000 https://practical365.com/?p=55356#comment-245098 In reply to Rene.

The file was originally created as a PowerShell List object and then exported in CSV and HTML formats. Here’s how the CSV file was created:

$Report | Sort “Days before expiration” | Format-Table Group, “Last renewed”, “Next renewal”, “Days before expiration” -AutoSize
# Create data to store in SharePoint Online
# First, the CSV file
$SDate = Get-Date -format yyyyMMddHHmmss
[string]$SourceDocument = “Microsoft 365 Groups Expiration Report ” + $SDate + “.csv”
[string]$HTMLDocument = “Microsoft 365 Groups Expiration Report ” + $SDate + “.html”
$Report | Sort “Days before expiration” | Export-CSV -NoTypeInformation $SourceDocument

# Connect to PnP using the credentials fetched from Azure Key Vault
$PnpConnection = Connect-PnPOnline $SiteURL -Credentials $UserCredentials -ReturnConnection
# Add a document title
$Values = @{“Title” = ‘Microsoft 365 Groups Expiration Report (CSV)’}
# Add the file to the General folder
$FileAddStatus = (Add-PnPFile -Folder “Shared Documents/General” -Path $SourceDocument -Connection $PnpConnection -Values $Values | Out-Null)
$NewFileUri = $SiteUrl + “/Shared Documents/General/” + $HTMLDocument

]]>
By: Rene https://practical365.com/azure-automation-spo-create-files/#comment-245091 Wed, 19 Oct 2022 04:18:19 +0000 https://practical365.com/?p=55356#comment-245091 Hi Tony,

I like this post and the idea of posting a file directly from Azure Runbooks to SharePoint Online. I have an application I am working on where this would be helpful. One thing I did not get from the above was how/where the file is initially created … how/where do you set the $SourcePath parameter?

$FileAddStatus = (Add-PnPFile -Folder “Shared Documents/General” -Path $SourceDocument -Connection $PnpConnection -Values $Values | Out-Null)

Any chance you could share a code snippet that shows how to do this from within an Azure runbook? Or point me to an example?

Thanks

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_238015'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_238015"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/azure-automation-spo-create-files/#comment-238015 Wed, 16 Mar 2022 10:00:34 +0000 https://practical365.com/?p=55356#comment-238015 In reply to Todd Klindt.

I will…

]]>
By: Todd Klindt https://practical365.com/azure-automation-spo-create-files/#comment-238008 Tue, 15 Mar 2022 23:53:13 +0000 https://practical365.com/?p=55356#comment-238008 You can use Submit-PnPTeamsChannelMessage to submit a Teams message with PnP PowerShell. Connect-PnPOnline will let you authenticate with a thumbprint. That should get you access to Teams and SharePoint.
Ping me if you want any help.
Tk

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_238007'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_238007"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/azure-automation-spo-create-files/#comment-238007 Tue, 15 Mar 2022 22:35:42 +0000 https://practical365.com/?p=55356#comment-238007 In reply to Christoph.

I have had a look and think that it is certainly possible to post to a channel via a webhook. However, you run into problems with the amount of data supported by the cards. It is impossible to fit the amount of information included in a report like the groups expiration report and I hit some problems with HTML formatted data too. I’m sure the technique could come in handy in some instances, but not in this situation.

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_238005'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_238005"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/azure-automation-spo-create-files/#comment-238005 Tue, 15 Mar 2022 21:15:29 +0000 https://practical365.com/?p=55356#comment-238005 In reply to Christoph.

Good idea to use a webhook. I shall investigate.

]]>