Comments (6)
I hope you're doing well.
I'm able to replicate this issue in my own environment. Specific contacts produce the "GivenName" error, but not to all mailboxes.
2021/03/02 16:40:12 INFO Updating Contact: [email protected]
PS>TerminatingError(Set-EXCContactObject): "The property 'GivenName' cannot be found on this object. Verify that the property exists and can be set."
2021/03/02 16:40:13 ERROR Failed to sync [email protected] contact to [email protected]'s mailbox The property 'GivenName' cannot be found on this object. Verify that the property exists and can be set.
GivenName is one of the properties of the Contact EWS class. You can find more info here: https://docs.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data.contact?view=exchange-ews-api
Since (in my experience) the error only occurs when updating contacts, we know that we're dealing with contact objects fetched from a user's mailbox. You can see the line below from Sync-ContactList.ps1.
$MailboxContacts = Get-EXCContactsObject -MailboxName $Mailbox -Credentials $Credential -Folder $ContactsFolderObject -service $service | Where-Object {$null -ne $_.EmailAddresses[[Microsoft.Exchange.WebServices.Data.EmailAddressKey]::EmailAddress1].Address}
I'll need to do some testing. Unfortunately, I've been busy with other projects and will need some time to come back to this.
from ews-office365-contact-sync.
Hello again,
just a little update: the error kept persisting but deleting the created folder and initiating a new sync solved the issue (as expected).
A way to remotely deleting the created folder would be a nice tool for troubleshooting in general.
Best regards
Adrian
from ews-office365-contact-sync.
Update: The same error keeps occuring.
Deleting the synced folder is just a temporary solution, also hard to keep up with multiple mailboxes.
from ews-office365-contact-sync.
I had same issue with update function, but i noticed it only happens if there is duplicate contact on destination folder.
from ews-office365-contact-sync.
I just added following if before set-exccontactobject. It's not pretty, but does following and doesn't crash to "Given name" error.
If more than one contact found with same email addres, this picks first one and deletes it and update second one.
For some reason it just delete on first run and update on second run. But without "$ContactObject = $result2" job crashes. So, it's not pretty and may need tweaking, but working its own ugly way ;)
###edit. Replaced - first 2 to - last 1 😉
write-host "Contact count on contacts folder with same email address $kontaktiwindowsemailaddress :" $ContactObject.count
Delete if double"
if ($ContactObject.Count -gt 1){
$result = $ContactObject | select-object -first 1
$result2 = $ContactObject | select-object -last 1
write-host "Duplicate found, deleting $result"
$result.Delete([Microsoft.Exchange.WebServices.Data.DeleteMode]::SoftDelete)
$ContactObject = $result2
}
try {
Set-EXCContactObject -MailboxName $Ma....
from ews-office365-contact-sync.
@wayfarerfin Thanks for explaining this issue and writing out some sample code to fix it. I just addressed this in the last commit 7cb0b30. Please update and see the changelog for more information.
from ews-office365-contact-sync.
Related Issues (20)
- Exclude Specific Users from receiving the GAL sync HOT 1
- Sync Pager HOT 3
- Failed to load the Certificate (then failed to fetch GAL contacts) HOT 1
- Error (403) HOT 1
- Microsoft deprecate Azure AD, Azure AD-Preview, and MS Online PowerShell modules on March 30, 2024 HOT 2
- Impossible to configure as a scheduled task from Windows
- Only contacts with MobilePhone HOT 1
- Better details in docs HOT 1
- Howto specify more than one mailbox to sync from command line ? HOT 5
- Issue adding Fax and Pager fields to the contacts HOT 1
- EWSContactSync.ps1 : Cannot convert the "System.Management HOT 2
- Failed verify that Directory Contacts exists HOT 2
- Could not load file or assembly 'System.Net.Http, Version=4.2.0.0 HOT 4
- Scripts Exceptions in Catch and Get-GALContacts HOT 2
- Sync contacts to the default folder name. HOT 1
- Apply the script only user mailboxes HOT 3
- Identifying errors in the log HOT 1
- Cannot find an appropriate constructor for type Microsoft.Exchange.WebServices.Data.OAuthCredentials HOT 5
- Duplicate Contacts in Folder HOT 1
- Running script in Azure Automation Account HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ews-office365-contact-sync.