Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

$passwordADApp : "System.String" to type "System.Security.SecureString" #79

@Mastoda

Description

@Mastoda

Hi,

I found an issue, the CreateAzureServicesScript.ps1 does not ran very well and gave me an error here like:

New-AzureRmADApplication : Cannot bind parameter 'Password'. Cannot convert the "Password.1%" value of type
"System.String" to type "System.Security.SecureString".
At line:1 char:142
... homePageURL1 -IdentifierUris $identifierURI1 -Password $passwordADApp
~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-AzureRmADApplication], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.ActiveDirectory.NewAzureADAppli
cationCommand

so I added

$securePASS = ConvertTo-SecureString -String $passwordADApp -AsPlainText -Force

before line :

$azureAdApplication1 = New-AzureRmADApplication -DisplayName $displayName1 -HomePage $homePageURL1 -IdentifierUris $identifierURI1 -Password $securePASS

note that I replaced -Password $passwordADApp to -Password $securePASS

My first time using power shell script so I don't know if it's a good solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions