WizTree - User Profiles

Published: Jan 17, 2022 by Bertland Hope

Uses WizTree to retrieve a list of user profiles and how large they are.

Please consider purchasing an Enterprise License for WizTree.

Requirements

WizTree must be installed on the target.

# Parameters
## Verbose
Enables Verbose log messages.

[CmdletBinding()]
param (
)

. '.\WizTree Functions.ps1'

# Make sure WizTree is installed.
Test-WizTree

# Run WizTree.
# https://wiztreefree.com/guide#cmdlinecsv
$ArgumentList = '"{0}" /export="{1}" /admin=1 /exportfiles=0' -f "$env:SystemDrive\Users", "$PWD\$WizTreeOutput"
Invoke-WizTree -ArgumentList $ArgumentList

# Define the CSV processing code that is unique to each script.
$ScriptBlock = {

	# Locate user profiles.
	if ( ($FileName -split '\\').Count -eq 4 ) {

		[PSCustomObject]@{
			'Profile' = $FileName
			'Size'    = $Size
		}

	}

}

# Process the CSV.
Read-WizTreeCsv -ScriptBlock $ScriptBlock | Sort-Object -Property 'Size' -Descending

Share

Latest News

10 Ways the ICT Performance Boost for Vision 2030 Jamaica Can Save You Money!
10 Ways the ICT Performance Boost for Vision 2030 Jamaica Can Save You Money!

10 Ways the ICT Performance Boost for Vision 2030 Jamaica Can Save You Money

What is a Constellation?
What is a Constellation?

What is a Constellation?

How are Pearls formed?
How are Pearls formed?

How are Pearls formed?

Chicken Back Gravy and Such Delights: Life Lessons From My Journey

Chicken Back Gravy and Such Delights: Life Lessons From My Journey

By Donna P. Hope

From $6.74

Inna Di Dancehall: Popular Culture And the Politics of Identity in Jamaica

Inna Di Dancehall: Popular Culture And the Politics of Identity in Jamaica

Donna P. Hope

From $22.96