dir-cli failed, error= Could not connect to the local service VMware AFD. Verify VMware AFD is running. 1021

This post was originally published on this site

I am trying to create a vcenter user by using the dir-cli command and Invoke-Script module. The command works in some vCenters and in some of the vCenters it gives the following error:

 

dir-cli failed, error= Could not connect to the local service VMware AFD.                                                                              
Verify VMware AFD is running. 1021

 

The same dir-cli command works when executed in the vCenter by doing an ssh. It fails when invoked through a powershell script.
Any suggestions on resolving the issue.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.