How to mass change the primary group of users in active directory with PowerShell

How to mass change the primary group of users in active directory with PowerShell
Introduction This very simple PS code will allow you to change the primary group of a group of users and report back who the users are you've changed through the script. Code Start-Transcript "C:\Users\UserName\Downloads\PrimaryGroupChange.log" $newPrimaryGroup = get-adgroup "NewPrimaryGroupHere" -Properties "primaryGroupToken" $oldPrimaryGroup = get-adgroup "OldPrimaryGroupHere" -Properties "primaryGroupToken" $tempUsers = get-aduser -Filter…

How to take ownership of a terminal user folder so you can safely remove it

How to take ownership of a terminal user folder so you can safely remove it
Introduction This was an annoying issue for me to remove the a terminal server user's profile from our file servers. Each time you need to remove an user's folder you get the standard access denied, then you need to change the permissions, inheritance, etc... so to save my colleagues and…