none
Having some issues with a script to export an -MailUniversalSecurityGroup Members RRS feed

  • General discussion

  • Tried this in Exchange online with no success can someone please help?


    Get-MsolGroupMember -GroupObjectId %mygroupname | select-object firstName, lastname, primarysmtpaddress | Export-csv C:\XYZ3.csv

    • Changed type Bill_Stewart Friday, July 27, 2018 6:18 PM
    • Moved by Bill_Stewart Friday, July 27, 2018 6:18 PM Unanswerable drive-by question
    Tuesday, April 24, 2018 6:38 PM

All replies

  • Remember: We can't see your screen. You have to describe exactly what isn't working. If you get an error, please copy and paste it.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, April 24, 2018 6:43 PM
  • 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

    Tuesday, April 24, 2018 6:54 PM
  • Why %MyGroupName? % is an alias for the ForEach-Object cmdlet. If you intend a variable reference, that would be the $ rather than the % character.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, April 24, 2018 7:26 PM