Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для DJ Mogarych

fascinating rhythm


Moderator


Сообщения: 6705
Благодарности: 1576

Профиль | Отправить PM | Цитировать


Код: Выделить весь код
$computers = Get-ADComputer -Filter 'enabled -eq "true"' -Properties Operatingsystem,OperatingSystemVersion,OperatingSystemServicePack,IPv4Address |
Select Name,Operatingsystem,OperatingSystemVersion,OperatingSystemServicePack,IPv4Address,sourceW32TM,statusServiceW32TM,precisionW32TM

$computers |% {
    if (Test-Connection $_.name -Count 1 -Quiet) {
    $w32tm = w32tm /query /computer:"$($_.Name)" /status
    $_.sourceW32TM = $w32tm[-3].Trim() -replace "^.*\s"
    $_.statusServiceW32TM = (Get-Service -Name W32Time -ComputerName "$($_.Name)").Status
    $_.precisionW32TM = $w32tm[2] -replace "^.*\:\s" -replace "\s\(.*$"
    }
}

$computers

-------
Powershell 7.x | Powershell 5.1 | ffmpeg (docs)

Это сообщение посчитали полезным следующие участники:

Отправлено: 16:11, 31-01-2020 | #2