Freshservice - Adding user to AD with apostrophe in display name fails

Hi All,
We are using the on prem AD orchestrator and the out of the box ‘create ad user’ script. When attempting to create a user with an apostrophie in their name it fails. Gives ‘error: The display_name contains a single quote (’).
Example: Johnny O’Test
AD itself has no such restriction and the user can be created manually with no problem.
Any ideas please
Colin

Do you use the orchestration app? It use powershell commands on the server.
Found this escaping - Can I use a single quote in a PowerShell ‘string’? - Stack Overflow

Not sure if it going to help but if it works with 2 ’ you could maybe do it this way.
{{ placeholdername | replace: "'","''" }}
It will replace 1 single quotes with 2 single quotes

Hi Daniel, Thanks for the tip. Unfortunately the replace worked fine but still generated the error.
From the Orchestrator log:
Sending message to BrokerMQ:{“level”:0,“message”:“Setting DisplayName as Jennie O’'Test”
“Error: The display_name contains a single quote (') .”

I’m not sure if FreshService is passing the string in single or double quotes.
If single quotes then the escape should work. If double quotes the escape should not be required.
Colin

Hi Daniel. And anyone else who may be interested.
I have resolved this issue. It was being caused by the Freshworks out of the box scripts. They actively throw errors when detecting user names with single quotes in them.
I have rewritten their scripts to handle single quotes correctly.
Not sure why they would have done this other than to save a couple of lines of code and risk doing it properly.
Not impressed!
Perhaps the script author: Akash Hirve would care to comment?
Colin