Hi @Abdullah Tahir khan ,
Please prepare the csv like the below and save it as useremail.csv
Command to forward to user in same Exchange,
Import-csv useremail.csv | foreach-object {Set-Mailbox -Identity $.Name -ForwardingAddress $.NewEmail}
If the mails needs to be delivered to both the mailboxes, use the below command,
Import-csv useremail.csv | foreach-object {Set-Mailbox -Identity $.Name -ForwardingAddress $.NewEmail -DeliverToMailboxAndForward $true}
If the mails needs to be delivered to external email, use the below command,
Import-csv useremail.csv | foreach-object {Set-Mailbox -Identity $.Name -ForwardingSMTPAddress $.External}
If the mails needs to be delivered to both the user mailbox and external email, use the below command,
Import-csv useremail.csv | foreach-object {Set-Mailbox -Identity $.Name -ForwardingSMTPAddress $.External -DeliverToMailboxAndForward $true}
You can verify it using,
Get-Mailbox -Identity user1 | fl ForwardingAddress,ForwardingSMTPAddress,DeliverToMailboxandForward
If the above suggestion helps, please click on "Accept Answer" and upvote it.