Created
November 4, 2016 12:28
-
-
Save automationhaus/3626dd332c8b624e757726d6bad05e3a to your computer and use it in GitHub Desktop.
PowerShell script to remove user profiles from Citrix or RDS session host servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Exclusions = "NetworkService","LocalService","systemprofile" | |
Get-CimInstance win32_UserProfile | ?{$Exclusions -notcontains $(Split-Path -Path $_.LocalPath -Leaf)} | Remove-CimInstance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment