Skip to content

Instantly share code, notes, and snippets.

@Chirishman
Created April 26, 2017 17:20
Show Gist options
  • Save Chirishman/d662fdacf74ab7897065afbd70d6c3f7 to your computer and use it in GitHub Desktop.
Save Chirishman/d662fdacf74ab7897065afbd70d6c3f7 to your computer and use it in GitHub Desktop.
Get Diskspace for an AD Group and Call Out Nonresponsive
$Targets = Get-ADComputer -Filter '*' -SearchBase (Get-ADOrganizationalUnit -filter {Name -like "*GroupNameHere*"} |select -expand DistinguishedName) | Select -ExpandProperty Name
$Results = Get-WmiObject win32_logicaldisk -ComputerName $Targets
$UniqueResults = $Results | select -ExpandProperty __SERVER -Unique
$NonResponsive = $Targets |?{$_ -notin $UniqueResults}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment