Get The Scoop On What's New
Want to know what Plugins4Automate is doing for ConnectWise Automate? Come check out our blog and find out about new products and updates that we are working on! https://www.plugins4labtech.com/blogs/blog

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
jallenEITP
Posts: 1
Joined: Mon Aug 06, 2018 7:49 pm

Names with ' in them

Post by jallenEITP » Tue Sep 17, 2019 2:08 pm

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 2.0.0.78.

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
Cubert
Posts: 1284
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Names with ' in them

Post by Cubert » Tue Sep 17, 2019 2:41 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest