<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Space Usage Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/space-usage/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/space-usage/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Mon, 03 May 2021 10:50:10 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Finding OneDrive for Business space usage using PowerShell</title>
		<link>https://blog.binarybits.net/finding-onedrive-for-business-space-usage-using-powershell/</link>
					<comments>https://blog.binarybits.net/finding-onedrive-for-business-space-usage-using-powershell/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Thu, 13 Feb 2020 16:24:50 +0000</pubDate>
				<category><![CDATA[OneDrive for Business]]></category>
		<category><![CDATA[Microsoft 365]]></category>
		<category><![CDATA[Office 365]]></category>
		<category><![CDATA[Space Usage]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1091</guid>

					<description><![CDATA[<p>One of the SharePoint Online administrator of the customer I work with wanted to know the space used by a business user&#8217;s private OneDrive. The following PowerShell script helps to know the exact same information. The script assumes that you have the SharePoint administrator role in your tenant. To run this script &#8220;SharePoint Online Management [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/finding-onedrive-for-business-space-usage-using-powershell/">Finding OneDrive for Business space usage using PowerShell</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><img decoding="async" class="wp-image-1161" style="width: 32px;" src="https://blog.binarybits.net/wp-content/uploads/2020/03/microsoft-onedrive-for-business-logo-2019.svg" alt="Microsoft OneDrive for Business Logo"> One of the SharePoint Online administrator of the customer I work with wanted to know the space used by a business user&#8217;s private OneDrive.</p>



<p>The following PowerShell script helps to know the exact same information. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>The script assumes that you have the SharePoint administrator role in your tenant.</p><p>To run this script &#8220;<a href="https://support.office.com/en-us/article/introduction-to-the-sharepoint-online-management-shell-c16941c3-19b4-4710-8056-34c034493429">SharePoint Online Management Shell</a>&#8221; PowerShell module should have been installed </p><p> Make sure you update the variables <em>$tenantName</em> &amp; <em>$url</em> </p></blockquote>



<p>Please note that the below scripts use minimal error handling for simplicity and clean code.</p>



<h2 class="wp-block-heading">Script for single URL</h2>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Clear-Host
 
$tenantName = &quot;tenant name&quot;
$url = &quot;https://unit4-my.sharepoint.com/personal/&lt;user one drive url&gt;&quot;
 
Connect-SPOService -Url &quot;https://$tenantName-admin.sharepoint.com&quot;
 
$sc = Get-SPOSite $url -Detailed -ErrorAction SilentlyContinue | Select-Object url, storageusagecurrent, Owner 
$usage = [math]::round(($sc.StorageUsageCurrent/1024),2)
$owner = $sc.Owner
 
Write-Host &quot;Site: $url&quot;
Write-Host &quot;Owner: $owner&quot;
Write-Host &quot;Usage: $usage GB&quot;
 
Disconnect-SPOService</pre></div>



<p>The following script helps to do the same for multiple URLs. All you need is a text file with OneDrive URL per line and it will provide output in a csv file.</p>



<h2 class="wp-block-heading">Script for multiple URLs</h2>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">$inputFileName = &quot;OneDrive-Usage-URLs.txt&quot;
$outputFileName = &quot;OneDrive-Usage-URLs.csv&quot;

Clear-Host
$tenantName = &quot;tenant name&quot;

Connect-SPOService -Url &quot;https://$tenantName-admin.sharepoint.com&quot;
$inputFile = Get-Content -Path .\$inputFileName
Add-Content .\$outputFileName -Value &quot;URL,Owner,Usage (GB)&quot;

foreach ($url in $inputFile) {
    $sc = Get-SPOSite $url -Detailed -ErrorAction SilentlyContinue | Select-Object url, storageusagecurrent, Owner
    $usage = [math]::round(($sc.StorageUsageCurrent / 1024), 2)
    $owner = $sc.Owner
    Add-Content .\$outputFileName -Value &quot;$url,$owner,$usage&quot;
    Write-Host &quot;Site: $url&quot;
    Write-Host &quot;Owner: $owner&quot;
    Write-Host &quot;Usage: $usage GB&quot;
    Write-Host &quot;&quot;
}

Disconnect-SPOService</pre></div>



<h2 class="wp-block-heading">Input file format (OneDrive-Usage-URLs.txt)</h2>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;null&quot;,&quot;mime&quot;:&quot;text/plain&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Plain Text&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;text&quot;}">https://tenant-my.sharepoint.com/personal/user1_tenant_com
https://tenant-my.sharepoint.com/personal/user2_tenant_com</pre></div>



<h2 class="wp-block-heading">Output file format (OneDrive-Usage-URLs.csv)</h2>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;null&quot;,&quot;mime&quot;:&quot;text/plain&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Plain Text&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;text&quot;}">URL,Owner,Usage (GB)
https://tenant-my.sharepoint.com/personal/user1_tenant_com,user1@tenant.com,123.45
https://unit4-my.sharepoint.com/personal/user2_tenant_com,user2@tenant.com,678.90</pre></div>
<p>The post <a href="https://blog.binarybits.net/finding-onedrive-for-business-space-usage-using-powershell/">Finding OneDrive for Business space usage using PowerShell</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/finding-onedrive-for-business-space-usage-using-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-04-23 23:51:22 by W3 Total Cache
-->