While going over the AD Cmdlet -Filter
operators earlier today, I came across one I've not seen before: -approx
. I can find this operator mentioned on several blogs, and in some TechNet articles, but nothing I find explains what this operator is used for. I also cannot find any examples of its use beyond its definition of use as "approxiomately equal to", or ~=
. The only time I've used the ~=
operator when programming is in Ruby, which does a regular expression match, but regex matching doesn't seem to be how it's used in this case. The only way I've gotten it to return anything is if I provide the exact value of the property I'm filtering on like in this example:
Get-AdUser -Filter "samaccountname -approx 'myexactsamaccountname'"
What is the proper usage of this operator, and what examples might there be of using it as an Active Directory administrator?