get-qaduser stop on error

When using 'get-qaduser samaccountname' if the samaccount name is not valid,  no error is thrown it just does not return anything

Is there a way to make it return an error if the samaccountname is not valid?

Top Replies

  • Hi  

    Get-QADUser is searching for a user object, it will either return nothing ($null) as no object matches your search, or it will return one or more user object(s) if one or more users were found.