Active Roles

Change/replace SIP address from the edsvaOffice365-UserID field

Ill start off by saying I am a complete novice

I would like to change user SIP address with the field edsvaOffice365-UserID

Id also like to be able to update this by OU if possible

I am using Quest Commandlet to pull this information. Get-QADUser -SearchRoot "OU=Path” -SizeLimit 0 -IncludedProperties edsvaOffice365-UserID

How would I script this to take the information in edsvaOffice365-UserID and update the SIP with it?

 

Thanks,

Manny

Parents
No Data
Reply
  • I'm glad to hear that it is now working as expected, but I feel bad. JohnnyQuest did all of the heavy lifting, I just swooped in and stole the credit...

    Sorry about that, JohnnyQuest!

    This is a good scripting learning opportunity, as well. It's good practice to confirm that you have data to replace something with before you destroy the original data.

    You should use something like this:

    Connect-QADService -proxy
    
    Get-QADUser -SearchRoot "OU=Path” -SizeLimit 0 -IncludedProperties 'edsvaOffice365-UserID' | %{
    
    # Clean out the old SIP
    
    if($_.'edsvaOffice365-UserID') #checks to see if some value exists in the attribute retrieved
    {
    Remove-QADProxyAddress -Pattern "SIP*" -DirObject $_
    
    $NewSIP = "SIP:" + $($_.'edsvaOffice365-UserID')
    
    # Put in the new one
    
    Add-QADProxyAddress -DirObject $_ -Address $NewSIP
    
    Set-QADUser -identity $_ -objectattributes @{'msRTCSIP-PrimaryUserAddress'=$($_.'edsvaOffice365-UserID')}
    
    else{
    #Log an error somewhere
    }
    
    }
    




    }

Children
No Data