Powershell - get Active Directory User accounts with no employee number set

Ever wanted to query your Active Directory for users with an empty employeeNumber attribute that start with a certain PATTERN and do not end on letters?

Here you go:

Import-Module QADModule
$missingusers = Get-QADUser -SamAccountName PATTERN* -IncludedProperties "employeeNumber" -SizeLimit $MAX_AD_OBJECTS_LIMIT|
    Where-Object {$_.SamAccountName -notlike "PATTERN[a-z]*" -and $_.employeeNumber -eq $null}
"#Users with empty employee number: " + $missingusers.Count
$missingusers|select-object -property SamAccountName, sn, givenName, Description | Out-GridView

Ah - and I use the Quest Active Directory module for Powershell.