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

  • You are talking about the SIP address in the proxy address list?

    If yes,

    Get-QADUser -SearchRoot "OU=Path” -SizeLimit 0 -IncludedProperties edsvaOffice365-UserID | %{

    # Clean out the old SIP

    Remove-QADProxyAddress -Pattern "SIP*" -DirObject $_


    $NewSIP = "SIP:" + $($_.edsvaOffice365-UserID)

    # Put in the new one

    Add-QADProxyAddress -DirObject $_ -Address $NewSIP

    }

  • Hey Johnny, I appreciate the response. I am going to give this a shot. Thanks!
  • Hi Johnny, I am getting this error when i try and run the script.



    At line:8 char:30
    + $NewSIP = $($_.edsvaOffice365-UserID)
    + ~~~~~~~
    Unexpected token '-UserID' in expression or statement.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
  • Ah yes, the dreaded '-' (dash).

    You need to put single quotes around the attribute name because it has the dash in it.

    Example:

    $NewSIP = $($_.'edsvaOffice365-UserID')
  • Hey Johnny, Your awesome.. that worked like a champ but it didnt change the live communications SIP like i thought it would. So i also wanted to change the msRTCSIP-PrimaryUserAddress to also have the edsvaOffice365-UserID. How would i go about doing this? im guessing i use the same Set-ADUser Instead? Im sorry to keep bugging you. i appreciate the help