[英]Azure AD Join with PowerShell on Windows 10+ (Automated)
[英]Is there a way to join a Windows 10 computer to Azure AD using PowerShell?
我想使用 PowerShell 腳本將我組織中的計算機加入 Azure AD。
我嘗試使用New-AzureADDevice
命令
但在示例中:
New-AzureADDevice -AccountEnabled $true -DisplayName "My new device" -AlternativeSecurityIds $altsecid -DeviceId $guid -DeviceOSType "OS/2" -DeviceOSVersion "9.3"
有人可以解釋參數AlternativeSecurityIds
來源嗎?
AlternativeSecurityId 由三個元素組成,其中設備只需要兩個元素。
參考: https : //docs.microsoft.com/en-us/graph/api/resources/alternativesecurityid?view=graph-rest-1.0
AlternativeSecurityIds : {class AlternativeSecurityId {
IdentityProvider:
Key: System.Byte[]
Type: 2
}
}
密鑰本身屬於此處描述的類型
X509:[指紋]+[公鑰哈希]
類型決定了密鑰的用途(例如 Bitlocker、Windows Hello、Recoverykeys)
$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)
這主要用於內部使用,我的理解是您將無法達到您的要求。
目前,沒有可以自動加入 AAD 的 powershell 腳本/命令行開關
已經存在相同的Uservoice 。
另一個選項將能夠使用:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.