Issue replacing proxyaddresses

Welcome Forums General PowerShell Q&A Issue replacing proxyaddresses

This topic contains 3 replies, has 3 voices, and was last updated by

 
Member
5 years, 4 months ago.

  • Author
    Posts
  • #9806

    Participant
    Points: 1
    Rank: Member

    Currently having an issue when trying to replace proxyaddresses.

    1st I get the proxys
    $proxys = (get-aduser $username -properties proxyaddresses).proxyaddresses

    Then I change the users proxyaddresses through ADUC

    I then run the above command again and compare to $proxys to confirm changes have been made

    Then
    set-aduser $user -replace @{proxyaddresses=$proxys}

    This leaves me with no addresses in proxyaddresses. If I then run
    get-aduser $username -Properties proxyaddresses | select proxyaddresses
    the result is

    proxyaddresses
    ————–
    {}

    This should be a relatively simple task yet I cannot seem to get it working.

    Any ideas on where I'm going wrong ? Using PS3.0.

    I can complete the task successfully with the Quest cmdlets but am trying to use the ActiveDirectory Module more and more and ween myself off Quest.

    Thanks in advance

  • #9813

    Participant
    Points: 428
    Helping Hand
    Rank: Contributor
  • #9817

    Participant
    Points: 1
    Rank: Member

    The above article is using -ADD, I am looking for -REPLACE

  • #9820

    Member
    Points: 0
    Rank: Member

    I wasn't able to reproduce the behavior you're describing. Set-ADUser with the syntax you posted worked fine every time I tried it. What are the values of your $user and $proxys variables right before you run the Set-ADUser command?

The topic ‘Issue replacing proxyaddresses’ is closed to new replies.