User Tools

Site Tools


script:powershell:mdt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
script:powershell:mdt [2020/10/26 18:13]
admin
script:powershell:mdt [2023/06/12 14:50] (current)
admin
Line 1: Line 1:
 +====== PowerShell et MDT ======
  
-====== Utiliser les variables de MDT ======+===== Utiliser les variables de MDT =====
    
 <sxh powershell>​ <sxh powershell>​
Line 9: Line 10:
 #Copy Item from Deployroot #Copy Item from Deployroot
 Copy-Item ​ "​$DeployRoot\Scripts\This.exe"​ -Destination "​C:​\Scripts"​ Copy-Item ​ "​$DeployRoot\Scripts\This.exe"​ -Destination "​C:​\Scripts"​
 +</​sxh>​
 +
 +===== Récupérer le mot de passe dans Unattend.xml =====
 +<sxh powershell>​
 +# Recovery XML Password
 +$StringPassword = ''​
 +$sPassword=[System.Text.Encoding]::​Unicode.GetString([System.Convert]::​FromBase64String($StringPassword))
 +$sPassword=[System.Text.RegularExpressions.Regex]::​Replace($sPassword ,"​AdministratorPassword$",""​)
 +write-host $sPassword
 </​sxh>​ </​sxh>​
script/powershell/mdt.1603732437.txt.gz · Last modified: 2020/10/26 18:13 by admin