This does work, just wondered if there was a better way to achieve this
While creating distribution groups in o365, I’m taking the Owners column that has a list of comma separated ‘firstname surname’ and I want to convert that to our corporate email address in the correct format to add the managedBy users
The first replace() looks like it’s redundant as you’re not specifying a delimiter for Import-CSV. If you have commas in your column you’re only going to get the first item in the comma separated list plus the domain.