import depuis ancien GitHub
This commit is contained in:
33
provisioning-end-restart-clean/readme.md
Normal file
33
provisioning-end-restart-clean/readme.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# 🔄 LANDESK Final Reboot Workaround
|
||||
|
||||
In some scenarios, the default **reboot task in LANDESK** cannot be used for the **final deployment reboot**, because the provisioning task only completes after a user logs back into the system.
|
||||
|
||||
---
|
||||
|
||||
## 🧩 Problem
|
||||
|
||||
- LANDESK provisioning tasks require a new session to complete.
|
||||
- A standard reboot through LANDESK may interrupt the flow or fail to finalize properly.
|
||||
|
||||
---
|
||||
|
||||
## ✅ Workaround
|
||||
|
||||
To bypass this limitation, use `shutdown.exe` with a timeout longer than 30 seconds.
|
||||
|
||||
### 📝 Steps:
|
||||
|
||||
1. **Create a batch file** (e.g., `restart.cmd`) with the following line:
|
||||
|
||||
```cmd
|
||||
start c:\windows\system32\shutdown.exe /r /t 60 /c "Final restart"
|
||||
```
|
||||
2. Add this batch file to your LANDESK provisioning task. <BR>
|
||||
- Download <BR>
|
||||
 <BR> <BR>
|
||||
- Execute <BR>
|
||||
 <BR> <BR>
|
||||
3. When the task reaches the reboot phase, it will trigger a delayed restart without closing the provisioning session prematurely.
|
||||
The restart will be initiated at the end of the deployment after the provisioning task has completed properly.
|
||||
|
||||
|
||||
19
provisioning-end-restart-clean/restart.cmd
Normal file
19
provisioning-end-restart-clean/restart.cmd
Normal file
@@ -0,0 +1,19 @@
|
||||
Set cmdreg=reg
|
||||
Set cmdpowershell=powershell
|
||||
Set cmdpowercfg=powercfg
|
||||
if defined PROCESSOR_ARCHITEW6432 Set cmdreg=%SystemRoot%\sysnative\reg.exe
|
||||
if defined PROCESSOR_ARCHITEW6432 Set cmdpowershell=%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe
|
||||
if defined PROCESSOR_ARCHITEW6432 Set cmdpowercfg=%SystemRoot%\Sysnative\cmd.exe /c powercfg
|
||||
|
||||
if exist c:\exploit\vbooton.flg goto suite
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /f
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultPassword" /f
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoLogonCount" /f
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ForceAutoLogon" /f
|
||||
:suite
|
||||
|
||||
start c:\windows\system32\shutdown.exe /r /t 60 /c "Final restart"
|
||||
|
||||
if exist c:\users\administrateur %cmdnet% user administrateur /active:no
|
||||
if exist c:\users\administrator %cmdnet% user administrator /active:no
|
||||
|
||||
21
provisioning-end-restart-clean/shutdown.cmd
Normal file
21
provisioning-end-restart-clean/shutdown.cmd
Normal file
@@ -0,0 +1,21 @@
|
||||
Set cmdreg=reg
|
||||
Set cmdpowershell=powershell
|
||||
Set cmdpowercfg=powercfg
|
||||
Set cmdnet=net
|
||||
if defined PROCESSOR_ARCHITEW6432 Set cmdreg=%SystemRoot%\sysnative\reg.exe
|
||||
if defined PROCESSOR_ARCHITEW6432 Set cmdpowershell=%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe
|
||||
if defined PROCESSOR_ARCHITEW6432 Set cmdpowercfg=%SystemRoot%\Sysnative\cmd.exe /c powercfg
|
||||
if defined PROCESSOR_ARCHITEW6432 Set cmdnet=%SystemRoot%\Sysnative\cmd.exe /c net
|
||||
|
||||
if exist c:\exploit\vbooton.flg goto suite
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /f
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultPassword" /f
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoLogonCount" /f
|
||||
%cmdreg% delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ForceAutoLogon" /f
|
||||
:suite
|
||||
|
||||
start c:\windows\system32\shutdown.exe /s /t 60 /c "Shutdown"
|
||||
|
||||
if exist c:\users\administrateur %cmdnet% user administrateur /active:no
|
||||
if exist c:\users\administrator %cmdnet% user administrator /active:no
|
||||
|
||||
Reference in New Issue
Block a user