Thanks Bill for your help
I am getting the below error
Get-MsolGroupMember : Cannot bind parameter 'GroupObjectId'. Cannot convert value "mygroupname"
to type "System.Guid". Error: "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."
At line:1 char:36
+ ... oupObjectId %Mygroupname | se ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-MsolGroupMember], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Online.Administration.Automation.GetGroupMember