Compartimentos de Interfaces IP do Windows Server 2012 R2 Powershell

3

Se eu executar Get-NetIPInterface -ifIndex 29 -IncludeAllCompartments , recebo uma interface de volta.

Existem apenas 2 Compartimentos que verificaram por @(Get-NetCompartment).Count . Os IDs dos compartimentos são 1 e 2. Essas informações também são impressas por Get-NetCompartment .

Mas se eu executar o Get-NetIPInterface -CompartmetId 2, recebo este erro:

PS C:\Users\Administrator> Get-NetIPInterface -ifIndex 29 -CompartmentId 1
Get-NetIPInterface : No matching MSFT_NetIPInterface objects found by CIM query for instances of the
ROOT/StandardCimv2/MSFT_NetIPInterface class on the  CIM server: SELECT * FROM MSFT_NetIPInterface  WHERE
((InterfaceIndex = 29)) AND ((CompartmentId = 1)). Verify query parameters and retry.
At line:1 char:1
+ Get-NetIPInterface -ifIndex 29 -CompartmentId 1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (MSFT_NetIPInterface:String) [Get-NetIPInterface], CimJobException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound,Get-NetIPInterface

ou isto

PS C:\Users\Administrator> Get-NetIPInterface -ifIndex 29 -CompartmentId 2
Get-NetIPInterface : No matching MSFT_NetIPInterface objects found by CIM query for instances of the
ROOT/StandardCimv2/MSFT_NetIPInterface class on the  CIM server: SELECT * FROM MSFT_NetIPInterface  WHERE
((InterfaceIndex = 29)) AND ((CompartmentId = 2)). Verify query parameters and retry.
At line:1 char:1
+ Get-NetIPInterface -ifIndex 29 -CompartmentId 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (MSFT_NetIPInterface:String) [Get-NetIPInterface], CimJobException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound,Get-NetIPInterface

PS C:\Users\Administrator>

Por que recebo esse erro?
Se a Interface não está no Compartimento 1 e não no Compartimento 2, onde está?

Mais informações:

PS C:\Users\Administrator>  Get-NetIPInterface -ifIndex 29 -IncludeAllCompartments

ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore
------- --------------                  ------------- ------------ --------------- ----     --------------- -----------
29      NIC_INTERN_CONTOSO              IPv4                  1500               5 Disabled Connected       ActiveStore

PS C:\Users\Administrator> Get-NetCompartment


CompartmentId          : 1
CompartmentDescription : Default Compartment
CompartmentGuid        : !SOME NUMBERS!

CompartmentId          : 2
CompartmentDescription : COMPARTMENT2
CompartmentGuid        : !SOME NUMBERS"
    
por user232900 15.07.2014 / 17:39

1 resposta

1

Você deve poder usar algo assim para descobrir em que CompartmentId está:

Get-NetIPInterface -ifIndex 29 -IncludeAllCompartments | ForEach-Object { "$($_.InterfaceAlias) - $($_.CompartmentId)" }

Use isso para verificar se realmente está em um desses compartimentos.

    
por 22.07.2014 / 02:20