ansible-collections / community.windows

Windows community collection for Ansible
https://galaxy.ansible.com/community/windows
GNU General Public License v3.0
199 stars 153 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 1 year 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.