Last active
August 29, 2015 14:17
-
-
Save jakubsuchybio/7286e4d7154ccd92e85f to your computer and use it in GitHub Desktop.
Revisions
-
jakubsuchybio revised this gist
Mar 16, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ Import-Module ActiveDirectory $list = Get-ADComputer -Filter * | Where { $_.DistinguishedName -like "*Computers*" } foreach ($computer in $list) { echo $computer.name if (Test-Connection -Cn $computer.name -BufferSize 16 -Count 1 -ea 0 -quiet ) { [string]$compname = $computer.name w32tm /resync /nowait /computer:$compname } else { echo DOWN! } } -
jakubsuchybio created this gist
Mar 16, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ Import-Module ActiveDirectory $list = Get-ADComputer -filter * -SearchBase "OU=Computers,OU=CaymanPort,DC=CaymanPort,DC=com" foreach ($computer in $list) { echo $computer.name if (Test-Connection -Cn $computer.name -BufferSize 16 -Count 1 -ea 0 -quiet ) { [string]$compname = $computer.name w32tm /resync /nowait /computer:$compname } else { echo DOWN! } }