你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Add-AzHDInsightSecurityProfile
将安全配置文件添加到群集配置对象。
语法
Add-AzHDInsightSecurityProfile
[-Config] <AzureHDInsightConfig>
-DomainResourceId <String>
-DomainUserCredential <PSCredential>
[-OrganizationalUnitDN <String>]
-LdapsUrls <String[]>
[-ClusterUsersGroupDNs <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
安全配置文件用于创建安全群集,方法是对其进行刻化。 安全配置文件包含将群集加入 Active Directory 域的相关配置。
示例
示例 1:将安全配置文件添加到群集配置对象
#Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "container001"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
#Security profile info
$domain="sampledomain.onmicrosoft.com"
$domainUser="sample.user@sampledomain.onmicrosoft.com"
$domainPassword=ConvertTo-SecureString -String "****" -AsPlainText -Force
$domainUserCredential=New-Object System.Management.Automation.PSCredential($domainUser, $domainPassword)
$organizationalUnitDN="ou=testunitdn"
$ldapsUrls=("ldaps://sampledomain.onmicrosoft.com:636","ldaps://sampledomain.onmicrosoft.com:389")
$clusterUsersGroupDNs=("groupdn1","groupdn2")
# Create the cluster
New-AzHDInsightClusterConfig `
| Add-AzHDInsightSecurityProfile `
-DomainResourceId $domain `
-DomainUserCredential $domainUserCredential `
-OrganizationalUnitDN $organizationalUnitDN `
-LdapsUrls $ldapsUrls `
-ClusterUsersGroupDNs $clusterUsersGroupDNs `
| New-AzHDInsightCluster `
-ClusterType Spark `
-OSType Linux `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer
此命令将安全配置文件值添加到名为 your-hadoop-001 的群集。
参数
-ClusterUsersGroupDNs
Ambari 和 Ranger 中可用的 Active Directory 组的可分辨名称
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Config
指定此 cmdlet 修改的 HDInsight 群集配置对象。 此对象由 New-AzHDInsightClusterConfig cmdlet 创建。
类型: | AzureHDInsightConfig |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DomainResourceId
群集的 Active Directory 域资源 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-DomainUserCredential
具有创建群集的足够权限的域用户帐户凭据。 用户名应采用user@domain格式
类型: | PSCredential |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-LdapsUrls
Active Directory 的一个或多个 LDAPS 服务器的 URL
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-OrganizationalUnitDN
将在 Active Directory 中创建用户和计算机帐户的组织单位的可分辨名称
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |