

8.x?), desired apps for the image (Office, PDF viewer, web browsers, plugins), virtual machine software (VMware Workstation, Microsoft Hyper-V, or Oracle Virtual Box), and image creation and deployment software (ImageX.exe, MDT, SCCM).Īlmost every place I have ever worked, IT had or needed a method to clone and deploy a specific Windows configuration and application set. See the below example.Requirements: Windows install media (7 or 10. I recommend, given your use-case to set a hostname dynamically, that you instead use RunSynchronousCommand in the specialize pass as this way, it will run as the system.Īdditionally, you can run the PowerShell command inline instead of using an external file you need to search for. So it appears you are trying to do administrator actions inside LogonCommands this isn't ideal because this will run in the user context and most likely won't be elevated even if the user is an admin. Once you have the contents of this file, update your post, and we can offer more assistance. To begin troubleshooting this, you need more context about what is going wrong. 23:36:39, Info Exiting 'oobeSystem' pass with status 0x00000000

23:36:39, Info UserAccounts: added 'User2' to group 'Administrators'

23:36:39, Info UserAccounts: Password set for 'User' 23:36:39, Info UserAccounts: added 'User2' to group 'Users' 23:36:39, Info UserAccounts: created account 'User' 23:36:39, Info LogonCommands: Set command 'FOR %i IN (C D E F G H I J K L N M) DO IF EXIST %i:\setup.ps1 Powershell -executionpolicy ByPass %i:\setup.ps1' Can it be the issue? 23:36:39, Info Running 'oobeSystem' pass Additionally setupact.log tries to run the script first and then creates the user. That means that it does not work for normal and admin rights. "Hello World!" | Out-File "$($home)\Desktop\delete_me.txt" "Hello World!" | Out-File "C:\delete_me.txt" $machineName = (Get-WmiObject Win32_bios).SerialNumber The contents of script:įor debug purposes i added strings with output to txt file in desktop and in C drive. Would you please help me to figure that out? I've read many topics regarding this question, unfortunately none of them had working answer for me.įOR %i IN (C D E F G H I J K L N M) DO IF EXIST %i:\setup.ps1 Powershell -executionpolicy ByPass %i:\setup.ps1 First two worked fine except running the script. I've created an autounattend.xml file with settings to skip OOBE, create user profile and running PowerShell script during first logon.
