SHARE
TWEET

MDT BootStrap - User Entry Script v3

Smooney Jan 25th, 2016 (edited) 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Configure WinPE Bootstrap.ini Account Details
  2. If ((Get-WmiObject Win32_Computersystem).partofdomain -eq $True) {
  3.  
  4. $TextMessage = Write-Host 'Please Enter an AD Account' -ForegroundColor Green
  5. Write-Host ' '
  6. $ADUserName = Read-Host 'Please Enter Service Account'
  7. $ADUserPassword = Read-Host 'Please Enter Service Account Password'
  8.  
  9. Get-Content -Path "D:\ReferenceShare\Control\Bootstrap.ini" | Out-Null
  10. Add-Content -Value DeployRoot=\\$Env:ComputerName\ReferenceShare$ -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  11. Add-Content -Value ' ' -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  12. Add-Content -Value SkipBDDWelcome=YES -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  13. Add-Content -Value UserID=$ADUserName -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  14. Add-Content -Value UserPassword="$ADUserPassword" -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  15. Add-Content -Value UserDomain=$Env:UserDnsDomain -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  16. Write-Host ' '
  17.  
  18. } else {
  19.  
  20. $TextMessage = Write-Host 'Please Enter an Local Account' -ForegroundColor Green
  21. Write-Host ' '
  22. $ADUserName = Read-Host 'Please Enter Service Account'
  23. $ADUserPassword = Read-Host 'Please Enter Service Account Password'
  24.  
  25. Get-Content -Path "D:\ReferenceShare\Control\Bootstrap.ini" | Out-Null
  26. Add-Content -Value DeployRoot=\\$Env:ComputerName\ReferenceShare$ -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  27. Add-Content -Value ' ' -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  28. Add-Content -Value SkipBDDWelcome=YES -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  29. Add-Content -Value UserID=$ADUserName -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  30. Add-Content -Value UserPassword="$ADUserPassword" -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  31. Add-Content -Value UserDomain=$Env:ComputerName -Path "D:\ReferenceShare\Control\Bootstrap.ini" -Force
  32. Write-Host ' '
  33.  
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top