I have been fighting for days to figure out how to get a custom automation PowerShell script to run for users with an empty attribute. The empty attribute report works great and finds the users needed, but then I am not able to get my custom automation script to run successfully. I really think the issue is that I am trying to append the %username% attribute to @company.com, so ADManager is literally trying to find a user called %firstname.lastname@example.org, which isn't a valid username.
I am hoping that someone has done something similar and can help figure out where I am going wrong.
The operation couldn't be performed because object %email@example.com couldn't be
Automation Script: Powershell.exe -File EnableRemoteMailbox.ps1 %username%
PowerShell Script: EnableRemoteMailbox.ps1
# Start logging
# Load the snap-in for the Exchange commands
# Enable Remote Mailbox routing needed for O365
Enable-RemoteMailbox -Identity %firstname.lastname@example.org -RemoteRoutingAddress %email@example.com
# Stop logging