Add registry value from MDT works partially

Quentin FERAUD 20 Reputation points
2024-02-07T04:19:02.66+00:00

Hi, First, sorry for my bad english.

I manage MDT for deployment on non-domain computer wich be used by public user I have two accounts on these computer "Public" with no password and "Admin" with password

I want to set the "Public" profil by default when (re)starting the computer, so if log with Admin and stop the computer, the next user who turn it on have the "Public" profil instead of my last logged on Admin account

I try add these registry key via Powershell and Bat script in so many way : reg add, reg import regedit /s etc..
Set-ItemProperty -Path $registryPath -Name "DefaultUserName" -Value "EPN" -Type String
Set-ItemProperty -Path $registryPath -Name "DefaultPassword" -Value "" -Type String
Set-ItemProperty -Path $registryPath -Name "AutoAdminLogon" -Value "1" -Type String

I also try to make an application an run it into the tasksequence but still the same problem

When i run the commande localy : Everything working great

When i run a Task Sequence calling the Script : Only two value are created but in a wrong way :

DefaultUserName is created but blank

DefaultPassword is unexistant

AutoAdminLogon is created but with "0" value in

I don't understand why locally it's works like a charm but with MDT the reg are not created as i want

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,777 questions
Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
906 questions
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
999 questions
0 comments No comments
{count} votes

Accepted answer
  1. XinGuo-MSFT 19,156 Reputation points
    2024-02-08T08:18:00.5566667+00:00

    Hi,

    Please use this method to test your installations before deploying them with MDT Deploy. It’s the perfect way to ensure consistency and troubleshoot any issues.

    To become the LOCAL SYSTEM account and test application deployment, you can use PsExec. Here’s how:

    Run PsExec: In the Command Prompt, enter the following command:

    PsExec.exe -s -i cmd.exe
    

    User's image User's image

    User's image

    $registryPath = '"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"'
     
    $command = 'reg add ' + $registryPath + ' /v DefaultPassword /t REG_SZ /f'
     
    invoke-expression $command
     
    $command = 'reg add ' + $registryPath + ' /v DefaultUserName /t REG_SZ /d "EPN" /f'
     
    invoke-expression $command
     
    $command = 'reg add ' + $registryPath + ' /v AutoAdminLogon /t REG_SZ /d "1" /f'
     
    invoke-expression $command
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.