Names with ' in them

This forum is for Office365 for LabTech (Ver 2) support. When posting remember to include screenshots of any relevant information.
Post Reply
Posts: 1
Joined: Mon Aug 06, 2018 7:49 pm

Names with ' in them

Post by jallenEITP »

Still having the issue where the client has a name like O'Brian that will make it so no mailboxes show up. I am on the latest build of

I have gone as far as one one client to remove the ' from the name and then all mailboxes show up. I have alos updated the ps1 script mentioned in another post but that still doe snot fix the issue.

User avatar
Posts: 1371
Joined: Tue Dec 29, 2015 7:57 pm

Re: Names with ' in them

Post by Cubert »

Man, I tell you this has been a tricky one. We use a POSH script to parse the output and if found to replace with nothing and special marks. However some marks formats look to be getting tied up in UTF format issue and not identifying as a special mark. The POSH skips it and leaves it in place and you get the errors.

We have edited this script many times trying different community responses and with each release we fix some and fail others.

Code: Select all

	$objUsers = get-mailbox -ResultSize Unlimited -ea silentlyContinue -WarningAction silentlyContinue | select UserPrincipalName,DisplayName,Alias,Identity,Guid,WhenChanged,PrimarySmtpAddress,GrantSendOnBehalfTo,RecipientType,MaxSendSize,MaxReceiveSize,ForwardingSmtpAddress,DeliverToMailboxAndForward,ProhibitSendReceiveQuota

	$i = 0
	#Iterate through all users	
	Foreach ($objUser in $objUsers)

		$strUserPrincipalName = $objUser.UserPrincipalName
		$strDisplayName = $objUser.DisplayName -replace "'"," "
		$strAlias = $objUser.Alias  -replace "'",""
		$strIdentity = $objUser.Identity  -replace "'",""
The code above shows what we are trying to strip the (') from the data. We have also tried REGEX and LIKE functions in POSH with same results.

I will follow back around to see if there is something else we can do to better identify this and correct it.

Post Reply