有没有办法使用PowerShell将Windows 10计算机加入Azure广告?
我想使用PowerShell脚本将组织中的计算机加入Azure AD 我尝试使用有没有办法使用PowerShell将Windows 10计算机加入Azure广告?,azure,powershell,azure-active-directory,windows-10,Azure,Powershell,Azure Active Directory,Windows 10,我想使用PowerShell脚本将组织中的计算机加入Azure AD 我尝试使用newazureaddevice命令 但在这个例子中: New-AzureADDevice -AccountEnabled $true -DisplayName "My new device" -AlternativeSecurityIds $altsecid -DeviceId $guid -DeviceOSType "OS/2" -DeviceOSVersion "
newazureaddevice
命令
但在这个例子中:
New-AzureADDevice -AccountEnabled $true -DisplayName "My new device" -AlternativeSecurityIds $altsecid -DeviceId $guid -DeviceOSType "OS/2" -DeviceOSVersion "9.3"
有人能解释一下参数
AlternativeSecurityId
从何而来吗?AlternativeSecurityId由三个元素组成,设备只需要两个元素
参考:
- 密钥本身是所描述的类型 X509:[指纹]+[publickeyhash]
- 类型决定密钥的用途(例如Bitlocker、Windows Hello、Recoverykeys)
$key=[System.Text.Encoding]::Unicode.GetBytes(“X509:”) $altsecids=新对象-类型名称PSObject-属性@{ #“IdentityProvider”=“null” “Key”=$Key '类型'=“2”} 新AzureAddDevice-AccountEnabled$true-DisplayName'-DeviceOSType'OS/2'-DeviceOSVersion'9.3'-AlternativeSecurityID$AltsecID-DeviceId(新Guid)
- ,及
AlternativeSecurityIds : {class AlternativeSecurityId {
IdentityProvider:
Key: System.Byte[]
Type: 2
}
}
$key = [System.Text.Encoding]::Unicode.GetBytes("X509:<SHA1-TP-PUBKEY><Thumbprint>")
$altsecids = New-Object -TypeName PSObject -Property @{
#'IdentityProvider' = 'null'
'Key' = $key
'Type' = "2" }
New-AzureADDevice -AccountEnabled $true -DisplayName '<NAME>' -DeviceOSType 'OS/2' -DeviceOSVersion '9.3' -AlternativeSecurityIds $altsecids -DeviceId (New-Guid)