I'm trying to add users from a csv file to a cloud-based Security group. I understand I need the Objectid of the SG. However I get 'access denied' when calling Get-Msolgroup -isAgentRole -UserprincipalName SG1@domain.com. I tried the steps mentioned in the following link:
My csv has only the UserPrincipalName column of users. Any thoughts?