@george1421
Thanks for the quick followup. Just a couple more pointed questions. I’ve moved the majority of the First Run scripts into the start of SetupComplete.cmd before starting the FOG client. I’ve set the FOG service startup type to Auto…do I need to start it immediately by adding a line after “sc config FOGService start= auto” such as net start FOGService? I guess my question here is whether FOG will attempt to rename the device and join it to the domain BEFORE restarting at the end of SetupComplete.cmd or does it rename & join the domain immediately AFTER the final restart? Since we’re setting the startup type to Auto and then calling a restart immediately thereafter I’m thinking it won’t have time to rename/join domain prior to the restart. So, how long does the FOGService typically take to start and begin the rename/join domain? Will it restart again automatically thereafter?
Here is my setupcomplete.cmd file:
:: Set AutoLogon
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v SecondaryScripts /d C:\Admin\Scripts\FinalSetup.cmd /f
reg add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f
reg add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoLogonCount /t REG_DWORD /d 1 /f
reg add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUserName /d Administrator /f
reg add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassword /d ********* /f
reg add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v ForceAutoLogon /d 1 /f
:: Disable Scheduled Lenovo System Updates
reg add “HKLM\SOFTWARE\Wow6432Node\Lenovo\System Update\Preferences\UserSettings\Scheduler” /v SchedulerAbility /t REG_SZ /d NO /f
:: Configure Firewall Settings
netsh advfirewall firewall set rule group=Network Discovery" new enable=yes
netsh advfirewall firewall add rule name=“Fog Client” dir=in action=all program=“C:\Program Files (x86)\FOG\FOGService.exe”
netsh advfirewall firewall add rule name=“Fog Service” dir=in action=all program=“C:\Program Files (x86)\FOG\FOGServiceConfig.exe”
netsh advfirewall firewall add rule name=“Fog Tray” dir=in action=all program=“C:\Program Files (x86)\FOG\FOGTray.exe”
:: Disable Adobe Reader Update Service
sc config “AdobeARMservice” start= disabled
sc stop “AdobeARMservice”
:: Enable Windows Store Installer Service
sc config “InstallService” start= Auto
:: Set AutoRemoval of Taskbar Icons
powershell.exe -NoProfile -ExecutionPolicy ByPass -WindowStyle Hidden -file C:\Admin\Scripts\ManageTaskbar\Managetaskbar\taskband.ps1
:: Install MS-Teams (All Profiles)
msiexec /i C:\Admin\MS-Teams\Teams_windows.msi OPTIONS=“noAutoStart=true” ALLUSERS=1
:: Configure Wireless Profile Settings
net start wlansvc
Netsh wlan add profile Filename=C:\Admin\Scripts\Vistex.xml user=all
netsh wlan connect name=‘Vistex’
sc config FOGService start= auto
:: Do I need the following 1 line???
------>> net start FOGService
shutdown -t 0 -r
If the renaming/domain join occurs AFTER the final restart I will need to run a powershell script to install our AntiVirus software and also add a domain user account to the Remote Desktop Users group –
Add-LocalGroupMember -Group “Remote Desktop Users” -Member “vistex\SetupVTX”
obviously the latter needs to be done after it’s joined to the domain so I would need to set the autologon registry keys for two logons…one for immediately after setupcomplete.cmd and one for after the domain join/restart. Hopefully that makes sense and that I’ve got the order of operations down in my mind correctly.