azure - 有没有办法使用 PowerShell 将 Windows 10 计算机加入 Azure AD?
问题描述
我想使用 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 脚本/命令
已经有相同的现有用户语音 。
另一个选项将能够利用:
推荐阅读
- tizen - 无法使用 Tizen 模拟器(可穿戴)注入位置
- sql - 按多列分组是什么意思?
- c# - 如何在 Unity 中修复意外的场景 buildIndex 为 -1
- docker - Docker Compose 与 Express.js 和 Nginx - 502 响应
- php - 如何使用 PHP 在 TelegramBot 中发送随机照片?
- python - Django中的ManyToMany关系“添加朋友,删除朋友”不起作用
- javascript - 关于使用 Jquery 使用 qunit 进行单元测试和评估的大学问题
- xamarin.forms - 如何仅在我的 PCL 项目的一页上实例化 BroadcastReceiver?
- spring-boot - xmlns:th="http://www.thymeleaf.org" 不起作用
- react-native - 如何根据情况更改图像源