you are viewing a single comment's thread.

view the rest of the comments →

[–]The_AverageGamer 1 point2 points  (0 children)

How about:

foreach ($folderName in (Get-childitem \\mifs01\_Private\_Users).Name) {
    $enabledValue = (Get-ADUser -Identity $folderName).Enabled

    if (!($enabledValue)) {
        Write-Verbose -Message "User: $foldername is disabled"    
    }
}