PowerShell – detecting and removing unused user profiles

Today I’m going to share a script that detects user profiles on the server that have not been used for a certain number of days (e.g. 60) and deletes them automatically to free up space and keep the server tidy.

  • The script is run on a Windows server.
  • You can customize the number of days after which unused profiles will be deleted.
  • The script saves the deleted profiles to a file

This script can, of course, be executed on many servers, just provide a list of servers on which the script is to be executed on the input.

Script code below:

Komentarze

Nie ma jeszcze komentarzy. Może zaczniesz dyskusję?

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *