Skip to content

Instantly share code, notes, and snippets.

@ArtisanByteCrafter
Last active May 16, 2017 05:13
Show Gist options
  • Save ArtisanByteCrafter/81b8239c1b5ad2820a2549dbc3d8e430 to your computer and use it in GitHub Desktop.
Save ArtisanByteCrafter/81b8239c1b5ad2820a2549dbc3d8e430 to your computer and use it in GitHub Desktop.
$Servers = Get-ADComputer -Filter {(enabled -eq $True) -and (OperatingSystem -like "*Windows*")} | Select-Object -ExpandProperty Name
$OnlineServers = Test-Connection -ComputerName $Servers -AsJob -Count 1 | Wait-Job | Receive-Job | where-object { $_.StatusCode -eq 0} | select -ExpandProperty Address
$RemoteScriptBlock = {
$SMB1Enabled = Get-SmbServerConfiguration | Select-Object -ExpandProperty EnableSMB1Protocol
[pscustomobject]@{
'Computer' = $Env:ComputerName
'SMB1 Present' = $SMB1Enabled
}
}
$table = Invoke-Command -ComputerName $OnlineServers -ScriptBlock $RemoteScriptBlock
$table | Select-Object * -ExcludeProperty PSComputerName,RunspaceID | Sort-Object Computer | Format-Table -AutoSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment