Skip to content

EWSContacts: Removing a Contact's phone number using EWS in Powershell? #22

@grahamr975

Description

@grahamr975

Hello,

Could you please provide some guidance on how I could strip a contact object's phone/mobile number in Powershell EWS? Setting it to $null does not work. I understand that the BusinessPhone/MobilePhone is an extended property and that there is a special way it has to be removed. I tried going through the EWS extended property list documentation, but become somewhat lost.

See below for what I'm looking for. Any help would be greatly appreciated.

if ($BusinssPhone -ne "")
{
	$Contact.PhoneNumbers[[Microsoft.Exchange.WebServices.Data.PhoneNumberKey]::BusinessPhone] = $BusinssPhone
} else {
	$Contact.PhoneNumbers[[Microsoft.Exchange.WebServices.Data.PhoneNumberKey]::BusinessPhone] = $NULL
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions