How can we create a filter with an single quote in the displayName ?

Jun 12, 2013 at 5:56 PM
Edited Jun 12, 2013 at 5:58 PM
Hello,

I have some persons in FIM 2010 who have an quote in their name.
How can made my filter to have a correct request ?

For example :
String filter = "/Person[DisplayName=D' Hans Eric]";
RmResource objectFim = client.Enumerate(filter).ElementAt(0);

For infomation, I have already test :
-& apos;
-& quot;
(without space normally)

This is stack trace :

at Microsoft.ResourceManagement.Client.ClientHelper.HandleFault(Message message) in D:\Scripts\fim2010client 1.0.0 src\Microsoft.ResourceManagement.Client\ClientHelper.cs:line 12
at Microsoft.ResourceManagement.Client.WsEnumeration.WsEnumerationClient.Enumerate(EnumerationRequest request) in D:\Scripts\fim2010client 1.0.0 src\Microsoft.ResourceManagement.Client\WsEnumeration\WsEnumerationClient.cs:line 54
at Microsoft.ResourceManagement.Client.EnumerationResultEnumerator.MoveNext() in D:\Scripts\fim2010client 1.0.0 src\Microsoft.ResourceManagement.Client\EnumerationResultEnumerator.cs:line 68
at System.Linq.Enumerable.Count[TSource](IEnumerable1 source)
at ImportCsvToFim.FimConnector.updateValue(Mapping mapping, Key key, String valueID, String valueModif, Dictionary
2 lOptions) in D:\Scripts\FIM Robot\ConsoleApplication1\ConsoleApplication1\Engine\FimConnector.cs:line 274
at ImportCsvToFim.Engine.loadingAttributesTask(Object data) in D:\Scripts\FIM Robot\ConsoleApplication1\ConsoleApplication1\Engine\Engine.cs:line 156
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
Coordinator
Jun 13, 2013 at 8:14 AM
Hi Anthony,
Try with

String filter = "/Person[DisplayName=\"D' Hans Eric\"]";

Cheers,
Paolo
Jun 13, 2013 at 9:42 AM
Hello,

Thank you for your prompt reply, this works very well :D