Skip to content

Set Local Admin Password During OSD TS

Featured Replies

I have a MDT Task Sequence that deploys Windows 10.

I am trying to set the windows built in local administrator password during the OSD Task Sequence.

To make this a bit complex I have an exe that I pass the computer name to, which generates a password.

I want to take this and set it as the local admin password.

I have tried to set it through PowerShell using the OSD TS Variable:

$LocalAdminPass = & .\Password.exe $env:COMPUTERNAME | Out-String
$TSEnv = New-Object -COMObject Microsoft.SMS.TSEnvironment
$TSEnv.Value("OSDLocalAdminPassword") = "$LocalAdminPass"

This does not work.

Any suggestions?

 

did you see this bit ?
 

 Specifies the local administrator password. This value is ignored if the Randomly generate the local administrator password and disable the account on all supported platforms option is enabled. 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.