OU使用PowerShell批量许可Office 365用户
我试图做一些我认为不应该太复杂的修复。 我的最终目标是:我有一个AD OU中的某些用户需要在Office 365中使用某个许可证,而另一个OU中的不同用户则获得不同的许可证。 我想运行的命令是: Get-ADUser -Filter * -SearchBase "ou=test,dc=our,dc=domain,dc=edu" | Set-MsolUserLicense -AddLicenses ourorg:STANDARDWOFFPACK_IW_STUDENT 但失败的回应是: Set-MsolUserLicense : The input object cannot be bound because it did not contain the information required to bind all mandatory parameters: ObjectId At line:1 char:111 + Get-ADUser -Filter * -SearchBase "ou=Test students,ou=Students,dc=campus,dc=org,dc=edu" | Set-MsolUserLicense <<<< -AddLicenses nwcu:STANDARDWOFFPACK_IW_STUDENT 单独地,这两个命令都起作用。 我可以selectOU中的所有用户,也可以手动使用带-UserPrincipalName的Set-MsolUserLicense命令来授权单个用户。 这是因为Get-ADUser不像Set-MsolUserLicense所寻找的那样返回ObjectID? […]