Identify and delete old logon scripts

Delete logon scripts from deactivated users

With this script we delete logon scripts (x.bat) from deactivated users in the Active Directory.

The script first reads in all logon scripts and filters them using 2 log files for deactivated users and activated users.

delete old logon scripts reports

The log file of the deactivated users is read in and the powershell script only deletes the logon scripts of the inactive users.

Example:

I currently have 5 logon scripts and 5 users.

Identify and delete old logonscripts from netlogon

3 out of 5 users are deactivated.

Identify and delete old logonscripts disabled users

Run the script and 3 logon scripts have been deleted.

Identify and delete old logonscripts bat

SHA256: EE82569DEB28484E6DD598A82C71B0E1F42C633E14FB7122B119D5A42E664A7A

Identify and delete old logonscripts