none
Obtaining folder size of all User Profiles RRS feed

  • Question

  • Good Morning All,

    I am looking at migrating all user data of the local C:\ and on to a network share. Before I implement this I want to find out how much data there is to transfer per profile. 

    I have attempted to use a Powershell script to get this but get "Access is Denied" when getting info for User Profiles so thats out of the Window. 

    Ideally I would like an SCCM report to target ALL USERs and report back their profile size.

    I am open to a powershell script as one off fire and forget and export that data to a CSV.

    Using VBscript and GPO isnt something I want to attempt. 

    I will paste the Powershell script below that was unsuccessful to have a look at to see what I was trying to achieve. 

    ======================================================================

    $CsvFilePath = "C:\Temp\UserList.csv" $dataColl = @() Import-Module ActiveDirectory $list = Get-ADComputer -SearchBase "dc=Lookersgrp,dc=local" -Filter * | Select -ExpandProperty name foreach ($computer in $list) { Get-ChildItem "\\$computer\c$\users" | Where-Object {$_.PSIsContainer} | ForEach-Object { $size = (Get-ChildItem $_.FullName -recurse -force | Measure-Object -property length -sum).sum $obj = New-Object PSObject Add-Member -inp $obj NoteProperty Name $_.Name Add-Member -inp $obj NoteProperty Path $_.FullName Add-Member -inp $obj NoteProperty Size $size $dataColl += $obj $obj } } $dataColl | Sort-Object Size -Descending | Select-Object Name, @{n="Size(MB)";e={"{0:N2}" -f ($_.Size / 1MB)} }, Path | Export-Csv -noTypeInformation -path $CsvFilePath

    =====================================================================================================

    Many Thanks in advance.


    • Moved by Bill_Stewart Monday, October 2, 2017 10:05 PM This is not "scripts on demand"
    Thursday, August 31, 2017 7:36 AM

All replies

  • Group Policy will automatically migrate most user folders to a share.  Post in GP forum for assistance with setting up Group Policy to implement this.


    \_(ツ)_/

    Thursday, August 31, 2017 8:11 AM
  • Have a look at this script, you should be able to modify it to your needs.  Just run it as a user you will have access rights on the target machines.

    https://gallery.technet.microsoft.com/scriptcenter/0f01d059-d951-40b0-b885-6b6b50384267

    Thursday, August 31, 2017 9:15 AM