ansible-collections / microsoft.ad

Ansible collection for Active Directory management
GNU General Public License v3.0
39 stars 22 forks source link

Not able to run module, giving an error AnsibleADObject not found #99

Closed HMA86 closed 7 months ago

HMA86 commented 7 months ago
SUMMARY

"exception": "The term 'Invoke-AnsibleADObject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:39 char:1\r\n+ Invoke-AnsibleADObject @setParams\r\n+ ~~~~~~\r\n + CategoryInfo : ObjectNotFound: (Invoke-AnsibleADObject:String) [], ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n\r\nScriptStackTrace:\r\nat , : line 39\r\n", "msg": "Unhandled exception while executing module: The term 'Invoke-AnsibleADObject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.", "_ansible_no_log": false,

ISSUE TYPE

Unable to use microsoft.ad module Tested with microsoft.ad.computer and microsoft.ad.object

COMPONENT NAME

Minimum requirements such as krb5 to connect to Windows and windows machine with AD module for powershell

ANSIBLE VERSION

ansible = 2.14


##### COLLECTION VERSION
collections:
microsoft.ad 1.41

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
OS / ENVIRONMENT

Windows 2019

STEPS TO REPRODUCE

Playbook executed with microsoft.ad to delete an object from Active Directory. Module seems to run but at the point that needs to pick this line Invoke-AnsibleADObject @setParams is not able to continue. Seems like the powershell module is not found

EXPECTED RESULTS

Be able to execute ansible playbook with result "change = true"

ACTUAL RESULTS

"exception": "The term 'Invoke-AnsibleADObject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:39 char:1\r\n+ Invoke-AnsibleADObject @setParams\r\n+ ~~~~~~\r\n + CategoryInfo : ObjectNotFound: (Invoke-AnsibleADObject:String) [], ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n\r\nScriptStackTrace:\r\nat , : line 39\r\n", "msg": "Unhandled exception while executing module: The term 'Invoke-AnsibleADObject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.", "_ansible_no_log": false,

jborean93 commented 7 months ago

How did you install this collection? Are you 100% sure you are running with Ansible 2.14?

HMA86 commented 7 months ago

Hi, thanks for the answer. It was tested with ansible 2.15. Collection has been installed using ansibe-galaxy command. In addition i have tested old module "community windows.win_domain_computer" and works just fine. Issue is with this new module. I would like to use the new one, because of two reasons, old module is deprecated and this new module has a playbook to manage objects.. Thank you.

jborean93 commented 7 months ago

What connection plugin are you using to connect to the Windows host? The Invoke-AnsibleADObject cmdlet is part of a shared module util which should be automatically loaded with the module so understanding what is running this might help figure out why it's failing on your host. Can you show the full task output with -vvv please?

HMA86 commented 7 months ago

I was able to identify the error, basically it wasn´t the module fault, it was the EE. Thanks for the help.