Skip to content

Conversation

@Vorsku
Copy link

@Vorsku Vorsku commented Nov 26, 2025

Hi,

Thanks for this project!

I've encountered various issues with the win-toggle-safe-mode script which this PR fixes:

  1. Missing comments on line 48-49 which stop the script starting entirely
  2. AZ CLI always passes parameters as strings so the current DC switch does not work
  3. Any partitions without a drive letter get ignored (which includes the EFI partition we care about for safe mode which normally doesn't have a drive letter) so refactored to also check access paths
  4. Script error if it can't start up the ProblemVM - I've found by default my repair VM doesn't have enough memory to power up the nested VM, but we don't need the ProblemVM to be started to perform the safe mode changes so I've changed the error action to SilentlyContinue

I've tested this updated version successfully against a 2016 domain controller running in Azure as a Gen2:

az vm repair create -g rg-adrestore-tst01 -n vm-adrestore-tst01 --yes --repair-username local_admin --repair-password 'password!234' --enable-nested --verbose

az vm repair run -g rg-adrestore-tst01 -n vm-adrestore-tst01 --preview "https://github.com/Vorsku/repair-script-library/blob/main/map.json" --run-id win-toggle-safe-mode --parameters safeModeSwitch=on DC=yes --verbose --run-on-repair

az vm repair restore -g rg-adrestore-tst01 -n vm-adrestore-tst01 --verbose

Thanks,
Josh

@Vorsku
Copy link
Author

Vorsku commented Nov 26, 2025

@microsoft-github-policy-service agree

@Vorsku
Copy link
Author

Vorsku commented Nov 26, 2025

@Sandido hoping you can review please? The current script doesn't work anyway due to the missing comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant