ansible-collections / community.windows

Windows community collection for Ansible
https://galaxy.ansible.com/community/windows
GNU General Public License v3.0
206 stars 160 forks source link

community.windows.win_domain_object_info => Unhandled exception while executing module: Unable to find type [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException] #469

Closed philippeBizou closed 1 year ago

philippeBizou commented 2 years ago
SUMMARY
ISSUE TYPE
COMPONENT NAME

community.windows.win_domain_object_info

ANSIBLE VERSION
2.9.14
COLLECTION VERSION
1.11.0 and 1.11.1
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The full traceback is:
Unable to find type [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException].
At line:212 char:45
+ ... ption() -is [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundE ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Activ...tFoundException:TypeName) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : TypeNotFound

ScriptStackTrace:
at <ScriptBlock>, <No file>: line 212
fatal: [mutprdwin176.gdc.geodis.org -> mutprdwin176.gdc.geodis.org]: FAILED! => {
    "changed": false,
    "msg": "Unhandled exception while executing module: Unable to find type [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException]."
}
jborean93 commented 1 year ago

Do you have the ActiveDirectory module installed? Import-Module -Name ActiveDirectory? If not you need to have this installed. You can get it from DISM or the ServerManager module.