Hello,
I have the following script:
I need to output the users name and employeeid - values that are not in CategoryA and where employeeid values that are not blanks.
Please help.
$CategoryA = "10","12","15","17"
$UserCount = $EnabledCount = $CatACount =$CatBCount = 0
foreach ($domain in Get-ADForest | select -Expand Domains) {
Get-ADUser -Server $domain -Filter * -Property EmployeeID | % {
$UserCount++;
if ($_.Enabled) { $EnabledCount++ }
if ($CategoryA -contains $_.EmployeeID) { $CatACount++ }
}
}
cls
write-output "Total Users:`t`t$UserCount"
write-output "Users in CategoryA:`t$CatACount"