![](/img/trans.png)
[英]Exchange Powershell - Bulk add new SMTP address to all mailbox users
[英]Find all users with a 'Primary SMTP address' that ends with '@example.com'
我们有些组和/或用户的主SMTP地址错误。
查找所有具有主要uppercase
SMTP地址*@example.com
用户,但不包括小写地址。
结果应显示用户名称和主要电子邮件地址
尝试过:
Get-Mailbox -Filter {recipienttypedetails -eq "SharedMailbox"} -ResultSize Unlimited |
where-Object {($_.PrimarySMTPAddress -like "*@example.com")} |
fl displayname,PrimarySMTPAddress
但是,这将返回具有“否”大写SMTP地址的用户。 我正在寻找具有错误SMTP地址但具有正确smtp地址的用户和组。 SMTP地址需要更正。
您需要的是Get-CASMailbox
cmdlet。 Get-Mailbox
cmdlet也可以正常工作。 它们在某些命令上都有重叠,但是CASMailbox
更适合配置ActiveSync和OWA。
Get-CASMailbox -ResultSize unlimited |
where {$_.primarysmtpaddress -like "*@example.com.au"} |
select name, primarysmtpaddress |
Export-CSV C:\temp\file.csv
这将使您到达所需的位置。 根据需要过滤数据
以下似乎对我有用。
谢谢大家的帮助和教育。
有时候,找到正确的音轨只需要一点帮助。
Set-ExecutionPolicy RemoteSigned Set-ExecutionPolicy不受限制$ LiveCred = Get-Credential $ Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $ LiveCred -Authentication Basic -AllowRedirection Import- PSSession $ Session Connect-MsolService导入模块Msonline
Get-Mailbox -ResultSize无限| where对象{($ _。PrimarySMTPAddress -like“ *@somecompany.com”)} | fl displayname,PrimarySMTPAddress
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.