Skip to content

Instantly share code, notes, and snippets.

View DonovanDiamond's full-sized avatar
💭
Working

DonovanDiamond

💭
Working
View GitHub Profile
Function Start-Cleanup {
<#
.SYNOPSIS
Automate cleaning up a C:\ drive with low disk space
.DESCRIPTION
Cleans the C: drive's Window Temperary files,
the local users Temperary folder, IIS logs(if applicable) and empties the recycling bin.
All deleted files will go into a log transcript in $env:TEMP. By default this
<#
.SYNOPSIS
Logs out inactive users.
.DESCRIPTION
Note: This script was forked and modified to also count "Active" but idle users as inactive.
Logs out inactive users, except for specific users that
have been manually approved and are allowed to stay logged
in for indefinite periods of time.