unattend xml file powershell script commands are not working.

Arun 1 Reputation point
2022-02-11T06:18:33.903+00:00

Hello,
I am trying to automate the install of windows-2019 server standard on a VM and in the unattend.xml I specified a powershell script to run at 'Specialze' section like below:

> 


    <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">

    >                     <Credentials>

    >                         <Domain>localhost</Domain>

    >                         <Password>test</Password>

    >                         <Username>administrator</Username>

    >                     </Credentials>

    >                     <Description>Network Settings</Description>

    >                     <Order>1</Order>

    >                     <Path>powershell.exe  -NoLogo -ExecutionPolicy unrestricted -noprofile -File &quot;C:\Windows\SCRIPTS\setup-net.ps1&quot;</Path>

    >                 </RunSynchronousCommand>

    >             </RunSynchronous>

    >         </component>

    >         <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" 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">

    >             <fDenyTSConnections>false</fDenyTSConnections>

    >         </component>

    >     </settings>

In my powershell script I am trying get the network interface information using the powershell command : Get-NetAdapterHardwareInfo . But it gives me the following error:

   Get-NetAdapterHardwareInfo: Critical error
    CategoryInfo : Notspecified: (MSFT_NetAdapterHardareInfoSettingData:ROOT/StandardCi...InfoSettingData)
    [Get-NetAdapterHardwareInfo], CimException
    +FullyQualifiedErrorId : HRESULT 0x8004100a, Get-NetAdapterHardwareInfo

I am using Get-NetAdapterHardwareInfo command to get the pci bus number of a particular network interface. The full command I am using is:

Get-NetAdapterHardwareInfo -Name "Ethernet" | Select-Object -ExpandProperty Bus

Could you please let me know what would be the issue I am facing here?.

Thank you

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,601 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 45,831 Reputation points
    2022-02-11T20:10:05.243+00:00

    About all I can find about that error code is:

    WBEM_E_CRITICAL_ERROR

    2147749898 (0x8004100A)

    Internal, critical, and unexpected error occurred. Report the error to Microsoft Technical Support.

    It may be a problem with the WBEM database, but if it's a fresh install I doubt that.