Extended property Definition for isExternalSender

$isExternalSender = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition([Guid]::Parse("41F28F13-83F4-4114-A584-EEDB5A6B0BFF"),"IsExternalSender", [Microsoft.Exchange.WebServices.Data.MapiPropertyType]::Boolean) 

Using it in FindItems

$ItemPropset = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
$ItemPropset.Add($isExternalSender)
$ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000) 
$ivItemView.PropertySet = $ItemPropset
$fiItems = $Service.FindItems($Folder.Id,$ivItemView)   

Using it in Search Filter to get External Email

$sfSearchFilter = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo($isExternalSender, $true) 
$fiItems = $Service.FindItems($Folder.Id,$sfSearchFilter,$ivItemView)  

Search Filter for only Internal Senders

$sfSearchFilter = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo($isExternalSender, $true) 
$SearchFilterNegate = new-Object Microsoft.Exchange.WebServices.Data.SearchFilter+Not($sfSearchFilter)
$fiItems = $Service.FindItems($Folder.Id,$SearchFilterNegate,$ivItemView)