win_domain_user - MAke the query user try catch block more accurate (#58782)

* win_domain_user - MAke the query user try catch block more accurate for missing identity

* change to minor_changes

* Update win_domain_user-make-query-try-catch-accurate.yml

* Update win_domain_user-make-query-try-catch-accurate.yml
This commit is contained in:
Shachaf92 2019-07-08 00:13:48 +03:00 committed by Jordan Borean
parent 6e4c2c61bd
commit 5b953581b4
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- "win_domain_user - Make the query user try catch block more accurate for missing identity (https://github.com/ansible/ansible/issues/57719)"

View file

@ -80,7 +80,7 @@ if ($null -ne $domain_server) {
try {
$user_obj = Get-ADUser -Identity $username -Properties * @extra_args
}
catch {
catch [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException] {
$user_obj = $null
}