This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
script:powershell:mdt [2023/06/12 14:49] admin |
script:powershell:mdt [2023/06/12 14:50] (current) admin |
||
---|---|---|---|
Line 14: | Line 14: | ||
===== Récupérer le mot de passe dans Unattend.xml ===== | ===== Récupérer le mot de passe dans Unattend.xml ===== | ||
<sxh powershell> | <sxh powershell> | ||
- | # Recovery XML Password | + | # Recovery XML Password |
- | $sPassword=[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String("UABAAGcAMABkADAAbgAwACEAMQAyADMANAA1AEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==")) | + | $StringPassword = '' |
+ | $sPassword=[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($StringPassword)) | ||
$sPassword=[System.Text.RegularExpressions.Regex]::Replace($sPassword ,"AdministratorPassword$","") | $sPassword=[System.Text.RegularExpressions.Regex]::Replace($sPassword ,"AdministratorPassword$","") | ||
write-host $sPassword | write-host $sPassword | ||
</sxh> | </sxh> |