Udostępnij za pośrednictwem


Delete a common area phone Contact object in Lync Server 2013

 

Topic Last Modified: 2013-02-20

You might want to delete the contact object associated with a common area phone. For example, if you remove the phone from an employee lounge, there’s no need to have a contact object associated with that phone. The Remove-CsCommonAreaPhone cmdlet provides a way for you to delete common area phone accounts. When you run this cmdlet, the phone is deleted from the list of common area phones returned by Get-CsCommonAreaPhone. In addition, the contact object associated with that phone is deleted from Active Directory Domain Services.

Use Remove-CsCommonAreaPhone to remove one common area phone or all common area phones that have a common element, such as a display name or country and area code. You can run this cmdlet from either the Lync Server 2013 Management Shell or from a remote session of Windows PowerShell. For details about using remote Windows PowerShell to connect to Lync Server, see the Lync Server Windows PowerShell blog article "Quick Start: Managing Microsoft Lync Server 2010 Using Remote PowerShell" at https://go.microsoft.com/fwlink/p/?linkId=255876.

Removing a Specified Common Area Phone

  • The following command removes the common area phone with the SIP address sip:mainlobby@litwareinc.com:

    Remove-CsCommonAreaPhone -Identity "sip:mainlobby@litwareinc.com"
    

Removing Common Area Phones Based on Their Display Name

  • This command removes all the common area phones where the display name includes the string value "Building 14":

    Get-CsCommonAreaPhone | Where-Object {$_.DisplayName -match "Building 14"} | Remove-CsCommonAreaPhone
    

Removing Common Area Phones Based on Their Country and Area Codes

  • This command removes all the common area phones for the United States (country code 1) and the area code 425:

    Get-CsCommonAreaPhone | Where-Object {$_.LineUri  -match "^tel:\+1425"} | Remove-CsCommonAreaPhone
    

For details, see the Help topic for the Remove-CsCommonAreaPhone cmdlet.