-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New-ServicePrincipal] Cannot find type [Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential]: verify that the assembly containing this type is loaded. #39
Comments
Can you provide me with the commands that you ran so I can investigate? |
PS C:\WINDOWS\system32> Import-Module PSServicePrincipal |
Ok, one last thing. Can you please run a Get-Module list as well as the last error from powershell after running the command: $e = $error[0].
TIA
Dave
From: dkotars ***@***.***>
Sent: Thursday, April 6, 2023 12:28 PM
To: dgoldman-msft/PSServicePrincipal ***@***.***>
Cc: Dave ***@***.***>; Comment ***@***.***>
Subject: Re: [dgoldman-msft/PSServicePrincipal] [New-ServicePrincipal] Cannot find type [Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential]: verify that the assembly containing this type is loaded. (Issue #39)
PS C:\WINDOWS\system32> Import-Module PSServicePrincipal
PS C:\WINDOWS\system32> New-ServicePrincipalObject -DisplayName 'ExchangeCBAApp' -RegisteredApp -Cba -CreateSingleObject
—
Reply to this email directly, view it on GitHub<#39 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJQPRPFHNCCTVNX4PRJB6VDW73VIBANCNFSM6AAAAAAWNLJNVY>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
Sent from mail.dgoldman.org
|
PS C:\WINDOWS\system32> get-module ModuleType Version Name ExportedCommands Script 2.12.1 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear... WARNING: [16:06:17][Add-ExchangePermsToSPN.ps1] Cannot convert 'System.Object[]' to the type 'System.String' required |
I am unable to reproduce that code. The one thing that could cause this is if you do not have the necessary to execute the following permissions. Are you able to execute the following commands manually in a PowerShell session? Connect-AzureAd |
I do get results, yes. |
In Powershell verion 5.1.22621.963. script generates errors:
[10:03:22][New-ServicePrincipal] Creating SPN with ApplicationID
WARNING: [10:03:22][New-ServicePrincipal] Cannot find type
[Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential]: verify that the assembly containing this type is
loaded.
[10:03:22][] Checking current Role Assignment. Waiting for AD Replication
WARNING: [10:03:23][Add-RoleToSPN] Failed to: Applying role assignment: Adding Contributor role to SPN | Cannot
validate argument on parameter 'ApplicationId'. The argument is null or empty. Provide an argument that is not null or
empty, and then try the command again.
[10:03:23][Add-ExchangePermsToSPN.ps1] Exchange.ManageAsApp roll applied to application ExchangeCBAApp. To complete setup go to your application in the Azure portal and Grant Admin Consent.
WARNING: [10:03:24][Add-ExchangePermsToSPN.ps1] Cannot convert 'System.Object[]' to the type 'System.String' required
by parameter 'ObjectId'. Specified method is not supported.
[10:03:24][New-ServicePrincipalObject] Completed. Log saved to: "C:\Users\user\Documents\PSServiecPrincipal Logging".
The text was updated successfully, but these errors were encountered: