Ashwin Agarkhed
Ashwin Agarkhed

Reputation: 77

PowerShell Azure AD B2C Identity Experience Framework policy key where name & secret are input params

Currently I am trying this from the https://github.com/cljung/AzureAD-B2C-scripts,

Enable-AzureADB2CIdentityExperienceFramework -n "ABC-WebApp" -f "abc123"

which dosent seen to work. After I import the modules I am not able to connect to Azure AD B2C.

\AzureAD-B2C-scripts-master\AzureAD-B2C-scripts-master> Connect-AzureAD -TenantId AcsToHeliosB2C.onmicrosoft.com
Connect-AzureAD : The term 'Connect-AzureAD' 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.
At line:1 char:1
+ Connect-AzureAD -TenantId vcbB2C.onmicrosoft.com
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Connect-AzureAD:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

otherwise I get this error

PS C:\Windows\system32> Enable-AzureADB2CIdentityExperienceFramework -n "ABC-WebApp" -f "abc123"
Enable-AzureADB2CIdentityExperienceFramework : The term 'Enable-AzureADB2CIdentityExperienceFramework' 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.
At line:1 char:1
+ Enable-AzureADB2CIdentityExperienceFramework -n "ABC-WebApp" -f "abc1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Enable-AzureADB...rienceFramework:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Upvotes: 0

Views: 440

Answers (1)

Joy Wang
Joy Wang

Reputation: 42063

I can reproduce your issue, to use this script, you need to install AzureAD module first.

Install-Module -Name AzureAD -Force

After installing it, close all the powershell sessions and open a new one, follow this link to import the module and connect to B2C tenant.

My test sample, it works on my side.

cd D:\AzureAD-B2C-scripts-master    
Import-Module D:\AzureAD-B2C-scripts-master\AzureADB2C-Scripts.psm1    
Connect-AzureADB2CEnv -t "JoyB2C"

enter image description here

After doing the first four steps successfully, the step 5 also works.

Enable-AzureADB2CIdentityExperienceFramework -n "ABC-WebApp" -f "abc123"

enter image description here

Upvotes: 1

Related Questions