Comments on: Practical Graph: Create a Files Report for a OneDrive for Business Account https://practical365.com/onedrive-for-business-account-files/ Practical Office 365 News, Tips, and Tutorials Fri, 21 Jun 2024 22:31:06 +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_295836'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_295836"> <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/onedrive-for-business-account-files/#comment-295836 Fri, 21 Jun 2024 22:31:06 +0000 https://practical365.com/?p=60823#comment-295836 In reply to Carl Lee.

If you have access to the OneDrive account then you should be able to do so by replacing the assignment of the user account principal name to the $Account variable. Right now, it’s coded as follows:

$Account = (Get-MgContext).Account

This gets the account of the currently signed in user. Assign whatever account you want to report on to $Account and everything should work. The important thing is that the script uses delegated permissions, so if you don’t have access to the account, you can’t report its contents. To get past that restriction, you’d need to use application permissions and authenticate using an Entra ID registered app that has consent to use the required permissions.

]]>
By: Carl Lee https://practical365.com/onedrive-for-business-account-files/#comment-295830 Fri, 21 Jun 2024 18:31:15 +0000 https://practical365.com/?p=60823#comment-295830 if I wanted to run this for another user, should making $account = Read-host “enter account” work? Or how can I run this for another account?

]]>
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_294993'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_294993"> <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/onedrive-for-business-account-files/#comment-294993 Tue, 04 Jun 2024 07:51:56 +0000 https://practical365.com/?p=60823#comment-294993 In reply to Melvin.

There’s a GitHub link to the script at the bottom of the article… hopefully it’s visible!

]]>
By: Melvin https://practical365.com/onedrive-for-business-account-files/#comment-294992 Tue, 04 Jun 2024 07:42:28 +0000 https://practical365.com/?p=60823#comment-294992 Hi Tony,

I can’t seem to locate the script for “Report for a OneDrive for Business Account” here. While following the article, I did find the script for “Practical Graph: Report SharePoint Online Files in a Document Library,” but nothing for OneDrive. Could you please let me know if I’m missing something?

]]>