Cannot find path 'C:\Modules\User\AzureAD\Microsoft.IdentityModel.Clients.ActiveDirectory.dll

Kothai Ramanathan (SC-ALT) 51 Reputation points Microsoft Employee
2024-02-12T13:40:38.3566667+00:00
I have this following line in my runbook:
Add-Type 

However, I am getting the below error:

Ran into an issue: Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path 'C:\Modules\User\AzureAD\Microsoft.IdentityModel.Clients.ActiveDirectory.dll' because it does not exist."

I have installed AzureAD module and it is listed under my modules. 

Please help resolve this issue.
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,120 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 11,641 Reputation points
    2024-02-13T17:50:02.43+00:00

    @Kothai Ramanathan (SC-ALT) - Welcome to Microsoft Q&A and thanks for reaching out to us. It seems like the error is related to the path of the module. You can try specifying the full path of the module in the Add-Type command. Here's an example:

    Add-Type -Path "C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.2.131\Microsoft.IdentityModel.Clients.ActiveDirectory.dll"
    

    Make sure to replace the path with the actual path of the module on your system. If the module is installed in a different location, you can use the Get-Module cmdlet to find the path. This will return the path of the AzureAD module. You can then use this path in the Add-Type command. If you're still having issues, please let me know and provide more details about your environment and the specific code you're running. Hope this helps. and please feel free to reach out if you have any further questions.


    If the above response was helpful, please feel free to "Accept as Answer" and click "Yes" so it can be beneficial to the community.