using accountneverexpires with get-qaduser

if you’re trying to use the AccountNeverExpires parameter, you may not find the built-in help very forthcoming.  it specifies the use as:

-AccountNeverExpires
Set the value of this parameter to 'true' if you want the cmdlet to retrieve only those user accounts that are configured to never expire.

i can tell you with confidence the following fails:

  • -accountneverexpires true
  • -accountneverexpires $true

 

so what works?

  • -accountneverexpires:$true

 

apparently, it requires a colon between accountneverexpires and $true.

Comments