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"
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.