How do I run Set-ADUser for a property (msExchRecipientDisplayType) that is currently set to NULL?
Tried this:
$users = Import-Csv -Path .\TestUsers.csv
foreach ($user in $users) {
Get-ADUser -Identity $($user.DN) -Properties msExchRecipientDisplayType -Server Domain.parent.com |
Set-ADUser -msExchRecipientDisplayType $($user.Value)
}
My error is:
Set-ADUser : A parameter cannot be found that matches parameter name ‘msExchRecipientDisplayType’.
I thought I would have the parameter in the pipeline to set.
Exchange Active Directory attributes should only be set with Exchange cmdlets.
https://blogs.technet.microsoft.com/johnbai/2013/09/11/o365-exchange-and-ad-how-msexchrecipientdisplaytype-and-msexchangerecipienttypedetails-relate-to-your-on-premises/
http://memphistech.net/exchange-recipient-types-and-office-365-setting-active-directory-attribute-values/
I’m not an Exchange SME, but my guess would be that those values are set when you do something like Enable-Mailbox for a user would associate the attribute with a User Mailbox. To reiterate (also by the first link), Exchange sets those values, they should not be directly modified
this worked:
$users = import-csv
Foreach ($u in $users) {set-ADUser $u.DN -replace @{msexchrecipientdisplaytype="0"}