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 "C:\Windows\SCRIPTS\setup-net.ps1"</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
If the PowerShell cmdlet were not available you would have seen a message that looked like this:
You, however, got a "CimException". The type of object the cmdlet returns is TypeName: Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetAdapterHardwareInfoSettingData so maybe that WMI class hasn't been added to the WMI database yet?