PowerShell Azure AD B2C 身份体验框架策略密钥,其中名称和密码是输入参数

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

目前我正在 https://github.com/cljung/AzureAD-B2C-scripts,

中尝试这个
Enable-AzureADB2CIdentityExperienceFramework -n "ABC-WebApp" -f "abc123"

哪些药物有效。导入模块后,我无法连接到 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

否则我会得到这个错误

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

我可以重现你的问题,要使用这个脚本,你需要先安装 AzureAD 模块。

Install-Module -Name AzureAD -Force

安装后,关闭所有powershell会话并打开一个新会话,按照此link导入模块并连接到B2C租户。

我的测试样本,它在我这边有效。

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

成功完成前四个步骤后,步骤 5 也有效。

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