为我写一个使用power shell批量创建邮箱账号的命令,用户名“CNSH31”, Alias "cnsh31", UserPrincipalName “cnsh31@ai-thermal.com”, Password “aish2021$$”
时间: 2023-03-31 07:01:34 浏览: 54
New-Mailbox -Name "CNSH31" -Alias "cnsh31" -UserPrincipalName "cnsh31@ai-thermal.com" -Password (ConvertTo-SecureString "aish2021$$" -AsPlainText -Force)
相关问题
为我写一个使用power shell批量创建邮箱账号的命令
你好,以下是使用PowerShell批量创建邮箱账号的命令:
New-Mailbox -Name "用户名" -Alias "邮箱前缀" -UserPrincipalName "邮箱地址" -Database "邮箱数据库" -OrganizationalUnit "邮箱所在的组织单位" -Password (ConvertTo-SecureString "密码" -AsPlainText -Force)
请注意,以上命令中的参数需要根据实际情况进行修改。
为我写一个使用power shell向两个o365账户添加许可的命令
可以使用以下命令向两个o365账户添加许可:
$Credential = Get-Credential
Connect-MsolService -Credential $Credential
$Account1 = "example1@contoso.com"
$Account2 = "example2@contoso.com"
$License = "ENTERPRISEPACK"
Set-MsolUserLicense -UserPrincipalName $Account1 -AddLicenses $License
Set-MsolUserLicense -UserPrincipalName $Account2 -AddLicenses $License
请注意,需要替换示例电子邮件地址和许可证名称以匹配您的环境。