Загрузка данных


# Получаем список активных компьютеров из определенного OU (или всего домена)
$Computers = Get-ADComputer -Filter 'Enabled -eq $true' -SearchBase "OU=Computers,DC=yourdomain,DC=local" | Select-Object -ExpandProperty Name

foreach ($Computer in $Computers) {
    if (Test-Connection -ComputerName $Computer -Count 1 -Quiet) {
        # Проверяем, включен ли компонент IPv6 на сетевых адаптерах
        $IPv6Status = Invoke-Command -ComputerName $Computer -ScriptBlock {
            Get-NetAdapterBinding -ComponentID ms_tcpip6 | Select-Object Name, ComponentID, Enabled
        } -ErrorAction SilentlyContinue

        if ($IPv6Status) {
            foreach ($Adapter in $IPv6Status) {
                [PSCustomObject]@{
                    ComputerName = $Computer
                    AdapterName  = $Adapter.Name
                    IPv6Enabled  = $Adapter.Enabled
                }
            }
        }
    } else {
        [PSCustomObject]@{
            ComputerName = $Computer
            AdapterName  = "Offline"
            IPv6Enabled  = "N/A"
        }
    }
}