![](/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.