Last active
December 31, 2018 23:19
-
-
Save neil-sabol/8542cb028a242c47f9dfad14a67f0d69 to your computer and use it in GitHub Desktop.
InnoSetup installer script to generate a "package" that resets a local account password on Windows (intended for use with SCCM)
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
[Setup] | |
; Basic information | |
AppName = Computer Maintenance | |
AppVerName = Computer Maintenance 0.0.1 | |
AppPublisher = Neil Sabol | |
AppVersion = 0.0.1 | |
Compression = lzma | |
SolidCompression = yes | |
PrivilegesRequired = admin | |
; Choose a benign directory to "install" even though we are not really | |
; installing anything - this "installer" will just run 2 commands | |
DefaultDirName = {win}\Temp | |
; Tidy up the name and location of the generated installer (current | |
; user's Desktop) | |
OutputDir=userdocs:..\Desktop | |
OutputBaseFilename=Comp-Maint | |
; Do not allow selection of an alternative install location and do not | |
; prompt for a Start menu location | |
DisableDirPage=yes | |
DisableProgramGroupPage=yes | |
; Do not create an uninstaller or add an entry to Apps (Programs | |
; and Features) | |
Uninstallable = no | |
CreateUninstallRegKey = no | |
[Run] | |
; Reset the password administrator password with "net user ..." | |
Filename: "net.exe"; Parameters: "user administrator MyNewPassword2018"; Flags: shellexec waituntilterminated runhidden; StatusMsg: Performing maintenance | |
; Add a registry value that can be used in a detection rule (in SCCM) | |
; so the "install" status is traceable | |
Filename: "reg.exe"; Parameters: "add ""HKLM\SOFTWARE\Computer Maintenance"" /v ""Status"" /t REG_DWORD /d 201812 /f /REG:64"; Flags: shellexec waituntilterminated runhidden; StatusMsg: Capturing status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment