Présentation
Active Setup is a powerful mechanism in Windows designed for implementing custom configurations within each user’s profile.
Its primary function is to ensure that specific scripts or settings are executed for every user logging onto a computer. This feature is particularly beneficial when setting up new machines or when users are logging in for the first time, ensuring a consistent and tailored experience for both new and existing users
ActiveSetup Example
Setting up the Registry: To implement Active Setup, you’ll need to create specific registry keys:
- Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\[Your Unique ID]
. - Create a new String Value named
StubPath
and input the command or script you wish to run. - Add another String Value named
Version
and set a version number (e.g., “1”).
Example
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{04BBA840-0D52-01CF-0AFA-00AA00B6015C}]
“StubPath”=”cmd /c C:\\Windows\\screensaver.bat”
“Version”=”1,0,0,0?
“IsInstalled”=dword:00000001
“ComponentID”=”ScreenSaver”
@=”ScreenSaver”
GUID Generator: Online guid generator
For User
In this example, each user will run the C:\Windows\screensaver.bat command just once.
A registry key (of flag) will be placed in HKEY_CURRENT_USER\Software\Microsoft\Active Setup\Installed Components
If the user key exists, Active Setup will no longer be played for the user.
ActiveSetup Example
In this example, I’m going to run a batch to modify the screen saver for each user.
- Install.bat (Script parent)
This is the batch that will be run (by SCCM, KACE, or manually) on the computers to set up the activesetup.
copy “%~dp0screensaver.bat” c:\windows\screensaver.bat /Y
regedit /s “%~dp0activeSetup.reg”
- ActiveSetup.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{04BBA840-0D52-01CF-0AFA-00AA00B6015C}]
“StubPath”=”cmd /c C:\\Windows\\screensaver.bat”
“Version”=”1,0,0,0?
“IsInstalled”=dword:00000001
“ComponentID”=”ScreenSaver”
@=”ScreenSaver”
ScreenSave.bat (Launches ActiveSetup on login)
This file will be executed when users log on.
reg add "HKCU\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 0 /f
reg add "HKCU\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 599940 /f
reg add "HKCU\Control Panel\Desktop" /v ScreenSaverIsSecure /t REG_SZ /d 0 /f
https://github.com/DavidWuibaille/Packaging/tree/main/Packaging/ActiveSetup_Example
0 Comments