当我运行此脚本
$Uppn = "[email protected]"`
$UserID = "00000"
$DisName = "XXX XXXX "
$FirstNm = "XXXX "
$LastNm = "XXXX "
$AltEmail = "[email protected]"
$Mobilenum = "+11111111111"
New-MsolUser -UserPrincipalName $Uppn -ImmutableId $UserID -DisplayName $DisName -FirstName $FirstNm -LastName $LastNm -AlternateEmailAddresses $AltEmail -LicenseAssignment "aaa:STANDARDWOFFPACK_STUDENT" -UsageLocation "LK" -MobilePhone $Mobilenum`
字符串
我知道这件事
New-MsolUser : Unknown error occurred.
At line:1 char:1
+ New-MsolUser -UserPrincipalName $Uppn -ImmutableId $UserID -DisplayNa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) \[New-MsolUser\], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.OperationNotAllowedException,Microsoft.Online.Administration.Automation.NewUser`
型
有什么办法吗?
我尝试了不同的方法,小工具,Microsoft Graph PowerShell.我没有得到任何好的结果:(
1条答案
按热度按时间zf9nrax11#
不推荐使用RolletNew-MsolUser的RolletSet-MsolUserLicense和参数**-LicenseAssignment**。请尝试使用Microsoft Graph PowerShell SDK。
在here中可以看到一个使用命令New-MgUser创建新用户的例子。它应该看起来像这样:
字符串