New-GlobalAddressList not a cmd in Connect-ExchangeOnline

Mitchell Redekopp 21 Reputation points
2022-03-14T21:12:31.587+00:00

Hey there, sorry this is probably an amateur question but the guide I am following says to use Exchange Powershell and applies to Exchange Online.

I connect with Connect-ExchangeOnline - sign into a Global Admin that also is a member of a self made Address List role Permissions group in Exchange and I still get this output.

The guide I am looking at is here: https://learn.microsoft.com/en-us/powershell/module/exchange/new-globaladdresslist?view=exchange-ps#description

New-GlobalAddressList -Name "REDACTED GAL" -IncludedRecipients AllRecipients -ConditionalCompany REDACTED1 OR REDACTED2
New-GlobalAddressList : The term 'New-GlobalAddressList' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1

  • New-GlobalAddressList -Name "REDACTED GAL" -IncludedRecipients All ...
  • ~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (New-GlobalAddressList:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,189 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andy David - MVP 142.2K Reputation points MVP
    2022-03-14T21:38:22.163+00:00

    How did you add the role? Did you reconnect the Exchange Session afterwards?

    Before:

    Get-Command *global*  
    

    183051-image.png

    Add Address Role via: https://outlook.office.com/ecp/#

    Get-Command *global*  
    

    183052-image.png


3 additional answers

Sort by: Most helpful
  1. Andy David - MVP 142.2K Reputation points MVP
    2022-03-14T21:16:05.683+00:00
    0 comments No comments

  2. Mitchell Redekopp 21 Reputation points
    2022-03-14T21:20:30.97+00:00

    Hey @Andy David - MVP , in my initial response:

    I connect with Connect-ExchangeOnline - sign into a Global Admin that also is a member of a self made Address List role Permissions group in Exchange and I still get this output.

    0 comments No comments

  3. Mitchell Redekopp 21 Reputation points
    2022-03-14T22:00:02.347+00:00

    Thank you! It must have been delayed. I did restart the session with no luck. An hour or so later now it is finally there. Cheers!

    Any idea how I can do the OR statement for the ConditionalCompany? It said to use the OR but maybe I am using it wrong. It doesn't like the argument 'OR'

    I want it to be CompanyA OR CompanyB should both be added to this GAL

    0 comments No comments