【发布时间】:2020-08-14 03:21:01
【问题描述】:
powershell.exe -Nologo -NonInteractive -WindowStyle Hidden -NoProfile -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer mx.company.org; ". 'Set-ADServerSettings -ViewEntireForest $true; Get-Mailbox -Server mx | select -expand EmailAddresses | %{$_.SmtpAddress} > C:\temp\1.txt ; Get-DistributionGroup -DomainController 'dc.company.org' | select -expand EmailAddresses | %{$_.SmtpAddress} >> C:\temp\1.txt '""
将列表写入 1.txt,其中仅列电子邮件将打印在表单中
abc@company.ru
bac@company.ru
..
现在我想要实现的是将“OK”附加到每一行,以便得到以下信息:
abc@company.ru OK
bac@company.ru OK
..
我真的不熟悉 PowerShell,也没有找到附加“OK”的方法 提前非常感谢您!
【问题讨论】:
标签: string powershell exchange-server