[Address book policies in Exchange Online] Fails to execute "New-" on Exchange Online PowerShell V2 RRS feed

  • Question

  • Hi everyone,

    I'm trying to set up "Address book policies" by using PowerShell in my verification environment, but I can't proceed with the error.  I need your help because I can't figure out the cause of the error.
    (This is my first post, so please let me know if there are any missing information.)


    > New-AddressList -Name “custom1_AddressList” -RecipientFilter {(CustomAttribute1 -eq 'custom1')}

    New-AddressList : The term 'New-AddressList' 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-AddressList -Name “custom1_AddressList” -RecipientFilter {(Custom ...
    + ~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (New-AddressList:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

    ▼Power Shell's infomation

    Name                           Value                                                                                                 
    ----                           -----                                                                                                 
    PSVersion                      5.1.17763.1432                                                                                        
    PSEdition                      Desktop                                                                                               
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                               
    BuildVersion                   10.0.17763.1432                                                                                       
    CLRVersion                     4.0.30319.42000                                                                                       
    WSManStackVersion              3.0                                                                                                   
    PSRemotingProtocolVersion      2.3                                                                                                   

    ▼My porpose

    Address book policies in Exchange Online

    :Prohibit communication between certain groups within a single tenant



    ・Installed Exchange Online PowerShell V2


    ・I've already given "Address Lists" to administrator on "Organization Management" 
    ・I signed in AAD as an administrator through Power Shell
    ・M365 E3/A3 License

    ▼My Power Shell Plan

    >Set-TransportConfig –AddressBookPolicyRoutingEnabled $True
    >Set-Mailbox –identity “user01” –customattribute1 “custom1”
    >Set-Mailbox –identity “user02” –customattribute1 “custom1”
    **↑Done / Error**
    >New-AddressList -Name “custom1_AddressList” -RecipientFilter {(CustomAttribute1 -eq "custom1")}
    >New-GlobalAddressList -Name “custom1_GAL” --RecipientFilter {(CustomAttribute1 -eq "custom1")}
    >New-OfflineAddressBook -Name “custom1_OAB” –AddressLists “custom1”
    >New-AddressBookPolicy -Name “custom1_ABP” -AddressLists “custom1” -GlobalAddressList “custom1_GAL” -OfflineAddressBook “custom1_OAB” -RoomList "All Rooms"
    >Set-Mailbox -identity “user01” -AddressBookPolicy “custom1_ABP”

    ※"New-GlobalAddressList" and "New-OfflineAddressBook" also show the same error

    Wednesday, September 16, 2020 3:51 PM