Created
April 26, 2017 17:20
-
-
Save Chirishman/d662fdacf74ab7897065afbd70d6c3f7 to your computer and use it in GitHub Desktop.
Get Diskspace for an AD Group and Call Out Nonresponsive
This file contains 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 characters
$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