This script will look for files that were not deleted properly during Windows images deployments from MDT and delete them.
Use the -Verbose
parameter for verbose output
The MDT deployment process creates the C:\MININT
folder during the Windows imaging process which contains an unattend.xml
file. This file can contain the following passwords:
- An AdministratorPassword element.
- A Password element which specifies the password for a LocalAccount to be created.
- A Password element for the AutoLogon account.
The PlainText element (which applies to all elements mentionned above) can be set to true
or false
. But even if it is set to false
, the password is not actually encrypted. It is simply encoded as a Base64 string which can easily be decoded.
Normally, this folder should be deleted at the end of the imaging process. In reality, many system administrators have reported certain deployments failing to delete this folder.
This script attempts to remediate this issue by scanning a list of hosts for the C:\MININT
folder and deleting it if you wish. It will then generate a CSV report.
Simply run the script with administrator credentials.
./delete-remote-deployment-files.ps1
[-ComputerList] <String>
[-ReportPath] <String>
[-DeleteFolder]
All the following parameters are optional.
-ComputerList
: Path of the list of computers to scan. Defaults to computers.txt
in the script's folder.
-ReportPath
: Path where to output the report. Defaults to report.csv
in the script's folder.
-DeleteFolder
: Use this flag to delete C:\MININT
. By default it will not be deleted.