Import-Module -Name "C:\.........\Microsoft.Exchange.WebServices.dll"
$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013)
$service.Credentials = new-object System.Net.NetworkCredential($user, $pass)
$service.AutodiscoverUrl($MailboxName)
You don't need to set the version to match the server, you set the version to indicate the lowest level of service you support.
gc "d:\owa.txt" | %{Set-CASMailbox -Identity $_ -OWAEnabled $false}