lwhitelock / HuduM365Automation

Hudu Microsoft 365 Syncronisation Tool
GNU Affero General Public License v3.0
29 stars 72 forks source link

Customer Exclude Issue - Commas in customer name #7

Open JPT62089 opened 2 years ago

JPT62089 commented 2 years ago

I'm currently working on getting this set up on our account. I noticed during the Azure Deploy that the Customer Exclude field is just a simple comma separated string that splits based on a comma. Problem being, 2 out of 4 clients I'd like to exclude have a comma in their name. One's "CompanyName, LLC" and the other is "Person name, person name, & person name PLLC".

The resulting split would be: @("CompanyName", " LLC", "Person name", " person name", " & person name PLCC"). There is no way to escape the commas and -notin does not support wildcards.

Any thoughts on what to do? For now I may just see if I can use the standalone in our own function app and modify it a bit to exclude what we want.

https://github.com/lwhitelock/HuduM365Automation/blob/2c1c4ae51c69c0d1bd272589a7fa877bcd6cbed0/Get-M365Tenants/run.ps1#L3

https://github.com/lwhitelock/HuduM365Automation/blob/2c1c4ae51c69c0d1bd272589a7fa877bcd6cbed0/Get-M365Tenants/run.ps1#L7

Perhaps it should be two fields. One for the *.onmicrosoft.com domain and one for the name? That way if there's not a better solution this could be resolved with a non-breaking change?

TectronIQ commented 1 year ago

We have the same issue. Honestly the easiest approach would probably be just to change the delimiter to a semi-colon or something else that you wouldn't commonly find in a company name.