Hi Friends
I have this unattended file
is there anything wrong with this file could someone advise
this is for windows 11
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>0</SkipRearm>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>net user administrator /active:yes</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Identification>
<Credentials>
<Domain>xxxx</Domain>
<Password>xxxx</Password>
<Username>xxxx</Username>
</Credentials>
<DebugJoin>true</DebugJoin>
<JoinDomain>someone.com</JoinDomain>
</Identification>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>ReplaceMe1</ComputerName>
<RegisteredOwner>Sxxx</RegisteredOwner>
<TimeZone>Coordinated Universal Time</TimeZone>
<RegisteredOrganization>xxx</RegisteredOrganization>
<OEMInformation>
<Manufacturer>xx</Manufacturer>
<SupportPhone>xx</SupportPhone>
<SupportHours>8am to 5pm - Weekdays</SupportHours>
<Model>Dell Precision 3560</Model>
<Logo>C:\Windows\Snap-on OEM Logo.bmp</Logo>
</OEMInformation>
<CopyProfile>true</CopyProfile>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-GB</InputLocale>
<SystemLocale>en-GB</SystemLocale>
<UILanguage>en-GB</UILanguage>
<UserLocale>en-GB</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>cscript /b c:\windows\system32\slmgr.vbs /ipk KEY </CommandLine>
<Order>1</Order>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>C:\Windows\System32\sysprep\STheme.bat</CommandLine>
<Description> Theme</Description>
<Order>3</Order>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
</FirstLogonCommands>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<DomainAccounts>
<DomainAccountList wcm:action="add">
<Domain>someone</Domain>
<DomainAccount wcm:action="add">
<Group>Administrators</Group>
<Name>ReplaceMe2</Name>
</DomainAccount>
<DomainAccount wcm:action="add">
<Name>some group </Name>
<Group>Administrators</Group>
</DomainAccount>
</DomainAccountList>
</DomainAccounts>
<AdministratorPassword>
<Value> sample value ==</Value>
<PlainText>false</PlainText>
</AdministratorPassword>
</UserAccounts>
<RegisteredOrganization>xxx</RegisteredOrganization>
<RegisteredOwner>xxxx</RegisteredOwner>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:g:/sources/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
Also I use this to inject username and computer name on bootup
but one of these needs changing I dont know which can anyone help
Option Explicit
Dim answer, answer2, computerName, domainAdminPass, unattendFile, WshShell, fso, unattendFileObject, strContents
unattendFile = "C:\Windows\System32\Sysprep\unattend.xml"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Do While answer <> vbYes
computerName = InputBox("Enter the desired Computer Name:", "Computer Name")
answer = MsgBox("Is this correct?" & vbCrLf & "Computer Name: " & computerName, vbYesNo, "Verify Name")
Loop
Do While answer2 <> vbYes
domainAdminPass = InputBox("Enter the domain User ID :", "User ID")
answer2 = MsgBox("Are you sure?" & vbCrLf & "UserID: " & domainAdminPass, vbYesNo, "Verify User ID. The system will take 5 to 10 minutes to complete install. Please be patient.")
Loop
If fso.FileExists(unattendFile) = False Then
wscript.echo "ERROR: Could not find the unattend file"
Else
'Read the unattend file in and replace apprpriate variables
Set unattendFileObject = fso.OpenTextFile(unattendFile, 1)
strContents = unattendFileObject.ReadAll
strContents = Replace(strContents, "ReplaceMe1", computerName)
strContents = Replace(strContents, "ReplaceMe2", domainAdminPass)
unattendFileObject.Close
'Write the updated contents back to the unattend file
Set unattendFileObject = fso.OpenTextFile(unattendFile, 2)
unattendFileObject.Write(strContents)
unattendFileObject.Close
End If
' Launch setup (will use the modified unattend.xml)
WScript.Sleep 5000
WshShell.Run "%WINDIR%\System32\oobe\windeploy.exe", 0, True