Good Morning Everyone,
I have written a script to get a list of users from Active Directory and
compare them with mailboxes we have in O365 to get their ForwardingSMTPAddress -
for some reason I am getting prompted to enter: Process[0] when my For-Each loop
starts, I am unsure of where the error is in my script, please could you take a
look and advise. Thanks ![]()
Get-ADUser-Filter * -SearchBase '<OU>'-Properties mail | `ForEach-Object {$Mailbox=Get-Mailbox-identity $_.mail |Select-Object PrimarySMTPAddress, ForwardingSMTPAddressNew-Object-TypeName PSCustomObject -Property @{ EmailAddress =$_.PrimarySMTPAddress ForwardingAddress =$_.ForwardingSMTPAddress } } |Export-Csv-Path<CSV Location> -NoTypeInformation