Azure active directory 如何在Azure中自动化PIM登录?
如何在Azure中自动化PIM登录。每天需要3-5分钟来激活登录,有效期为8小时,因此无论何时需要,我都需要重新激活它。请建议PIM登录的任何自动化方法。要自动激活PIM,您可以按照以下步骤操作 1.创建(需要创建运行方式帐户)和(powershell类型) 2.导航到门户中的自动化帐户->Azure active directory 如何在Azure中自动化PIM登录?,azure-active-directory,azureportal,Azure Active Directory,Azureportal,如何在Azure中自动化PIM登录。每天需要3-5分钟来激活登录,有效期为8小时,因此无论何时需要,我都需要重新激活它。请建议PIM登录的任何自动化方法。要自动激活PIM,您可以按照以下步骤操作 1.创建(需要创建运行方式帐户)和(powershell类型) 2.导航到门户中的自动化帐户->模块库->搜索AzureADPreview模块并导入它 3.按照此操作将全局管理员分配给运行方式帐户,即服务负责人,只需搜索您的自动化帐户的名称,服务负责人的名称的格式为automationaccount\u
模块库
->搜索AzureADPreview
模块并导入它
3.按照此操作将全局管理员
分配给运行方式帐户,即服务负责人,只需搜索您的自动化帐户的名称,服务负责人的名称的格式为automationaccount\uuxxxx
4.在您的runbook中,使用下面的脚本登录服务主体,使用激活您需要的用户的合格分配
$connectionName = "AzureRunAsConnection"
try
{
# Get the connection "AzureRunAsConnection "
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
"Logging in to Azure..."
Connect-AzureAD `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrincipalConnection.ApplicationId `
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
Open-AzureADMSPrivilegedRoleAssignmentRequest -ProviderId 'aadRoles' -ResourceId '926d99e7-117c-4a6a-8031-0cc481e9da26' -RoleDefinitionId 'f55a9a68-f424-41b7-8bee-cee6a442d418' -SubjectId 'f7d1887c-7777-4ba3-ba3d-974488524a9d' -Type 'UserAdd' -AssignmentState 'Active' -schedule $schedule -reason "dsasdsas"
}
catch {
if (!$servicePrincipalConnection)
{
$ErrorMessage = "Connection $connectionName not found."
throw $ErrorMessage
} else{
Write-Error -Message $_.Exception
throw $_.Exception
}
}
5.在门户中导航到runbook->Schedules->创建定期计划并将其链接到您的runbook,例如,每天,详细信息取决于您。谢谢。我会检查一下,试试看。