Which Windows PowerShell command should you run next?

You are the Office 365 administrator for your company. The company uses Microsoft Exchange
Online and Microsoft Lync Online.
An employee named User1 has the user name, email address, and Lync address
[email protected].
The employee requests that you change only his Lync address to [email protected].
You start a Windows PowerShell session and run the following commands, providing your admin
account credentials when prompted:

You need to complete the process of updating the employee’s Lync address without affecting any
other addresses.
Which Windows PowerShell command should you run next?

You are the Office 365 administrator for your company. The company uses Microsoft Exchange
Online and Microsoft Lync Online.
An employee named User1 has the user name, email address, and Lync address
[email protected].
The employee requests that you change only his Lync address to [email protected].
You start a Windows PowerShell session and run the following commands, providing your admin
account credentials when prompted:

You need to complete the process of updating the employee’s Lync address without affecting any
other addresses.
Which Windows PowerShell command should you run next?

A.
Set-MsolUser -UserPrincipalName $ID -ProxyAddresses@{add = “$NewAddress”; remove =
“$OldAddress”>

B.
Set-Mailbox -Identity $ID -EmailAddresses@{add = “$NewAddress”; remove = “$Old Address”}

C.
Set-Mailbox -Identity $ID -WindowsEmailAddress $NewAddress

D.
Set-CsUser -Identity $ID -ProxyAddresses@{add = M$NewAddress”; remove=”$OldAddress”>

Explanation:



Leave a Reply 11

Your email address will not be published. Required fields are marked *


Massimo

Massimo

B is correct, but the whole process is completely crazy. In order to change the SIP URI for Lync Online, you are editing low-level attributes *on the Exchange Online mailbox*, bypassing Office 365 altogether and not even touching Lync Online itself.

Hikmat

Hikmat

I Agree Massimo

Me

Me

The connection is to Exchange
The correct answer is B

Hikmat

Hikmat

It is tricky look at the value of $OldAddress and $NewAddress they are SIP:… not SMTP:…

SIP is the Lync address so B is the correct answer.

Andrew

Andrew

B is correct I have tested this.

Dave

Dave

Fortunately, SIP addresses are not written in stone; after all, you can easily change the SIP address by running the Set-CsUser cmdlet: Set-CsUser –Identity “Ken Myer” –SipAddress “sip:[email protected]

https://blogs.technet.microsoft.com/nexthop/2011/03/21/modify-the-sip-address-of-an-enabled-lync-server-user/

Which is correct for on-premise, however:

https://support.microsoft.com/en-gb/help/2909916/skype-for-business-online-admins-can-t-use-the-set-csuser-cmdlet-in-sk

“AudioVideoDisabled is the only parameter that you can use together with the Set-CsUser cmdlet in Skype for Business Online”

So: https://gallery.technet.microsoft.com/office/PowerShell-function-to-set-b4f25dac

Uses:

$SIPToRemove = $CurrentSIPObject.ProxyAddressString
[String]$MessageText = [String]$MessageText = “SIP address {0} is incorrect and will be deleted” f $CurrentSIPAddressString
Write-Verbose -Message $MessageText
set-mailbox -Identity $CurrentMailbox.Alias -EmailAddresses @{ remove = $SIPToRemove } -ErrorAction Continue

So essentially, B is correct 🙂

Dave

Dave

Oops, wrong paste:

[String]$SIPToAdd = “SIP:{0}” -f $CurrentMailbox.PrimarySMTPAddress

set-mailbox -Identity $CurrentMailbox.Alias -EmailAddresses @{ add = $SIPToAdd } -ErrorAction Continue

[String]$MessageText = “SIP address {0} was set on mailbox {1}” -f $SIPToAdd, $CurrentMailbox.Alias