Set-ADUser for attribute that is NULL

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Rob Simmers Rob Simmers 1 week ago.

  • Author
  • #73093
    Profile photo of Jeff Taylor
    Jeff Taylor

    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 |            
      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.

  • #73094
    Profile photo of Rob Simmers
    Rob Simmers

    Exchange Active Directory attributes should only be set with Exchange cmdlets.

    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

You must be logged in to reply to this topic.