【发布时间】:2022-08-05 14:44:24
【问题描述】:
我在自动化帐户中遇到身份问题 - 当我运行以下代码时
我面临的错误是:
在调用任何其他 cmdlet 之前,您必须调用 Connect-AzureAD cmdlet。
脚本块:
workflow test { Param ( [Parameter(Mandatory= $True)] [String] $GroupName, [Parameter(Mandatory= $True)] [String] $DestinationEmailAddress ) # log AccountId $UserManagedIdentityAccountId = \"XYZ\" Disable-AzContextAutosave -Scope Process $AzureContext = (Connect-AzAccount -Identity -AccountId $UserManagedIdentityAccountId).context $AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext # log AccountId $groups = Get-AzureADGroup -SearchString $GroupName $Exp = foreach($group in $groups){ $GroupId = $group.ObjectId $GroupName = $group.DisplayName Get-AzureADGroupMember -ObjectId $GroupId | Select-Object -Property @{Name = \'GroupName\'; Expression= {$GroupName}}, DisplayName, UserPrincipalName, usertype } Write-Output $Exp Write-Output $GroupName Write-Output $DestinationEmailAddress }
-
如果您将
Connect-AzureAD放在# log AccountId之后会发生什么情况 -
来自自动化帐户的相同响应:您必须在调用任何其他 cmdlet 之前调用 Connect-AzureAD cmdlet。
-
在运行
Get-AzureADGroup命令之前,我们需要使用Connect-AzureAD命令登录到 Azure AD 模块 -
哇 !伙计们 - 它有帮助!现在我面临其他问题...发生了一个或多个错误。:无法在 DLL \'iphlpapi.dll\' 中找到名为 \'GetPerAdapterInfo\' 的入口点。发生一个或多个错误。在 DLL \'iphlpapi.dll\' 中找不到名为 \'GetPerAdapterInfo\' 的入口点。出现一个或多个错误。: 无法在 DLL \'iphlpapi.dll\' 中找到名为 \'GetPerAdapterInfo\' 的入口点。在调用任何其他 cmdlet 之前,您必须调用 Connect-AzureAD cmdlet。
-
我有一个基金,但它与 RUNAS CONNECTION 相关联,我需要 Acc ID 的解析。 stackoverflow.com/questions/54272880/…
标签: azure powershell workflow identity azure-automation