繁体   English   中英

有没有办法使用 PowerShell 将 Windows 10 计算机加入 Azure AD?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM