Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXOAddressList : The term 'New-AddressList' is not recognized as the name of a cmdlet #5299

Closed
CovidtheDog2024 opened this issue Oct 29, 2024 · 16 comments

Comments

@CovidtheDog2024
Copy link

Description of the issue

Good day! Kindly help, we are getting this error while importing using Credentia and service account.

error:
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] The Address List 'All Users' does not exist but it should. Creating Address List.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-All users] in 13.9250 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-All users' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::35::10::EXOAddressList' threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

Microsoft 365 DSC Version

1.24.1016.1

Which workloads are affected

Exchange Online

The DSC configuration

Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.24.1016.1'

Node localhost
{
     EXOAddressList "EXOAddressList-All users"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "All users";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "All Users";
        RecipientFilter              = "((Alias -ne $null) -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne $null)) -and (-not(ServerLegacyDN -ne $null)))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne $null) -or (ServerLegacyDN -ne $null))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))";
    }
    EXOAddressList "EXOAddressList-All Group"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "All Group";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "All Groups";
        RecipientFilter              = "((Alias -ne $null) -and (RecipientTypeDetailsValue -eq 'GroupMailbox'))";
    }
    EXOAddressList "EXOAddressList-Public Folders"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "Public Folders";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "Public Folders";
        RecipientFilter              = "((Alias -ne $null) -and (ObjectCategory -like 'publicFolder'))";
    }
    EXOAddressList "EXOAddressList-Offline Global Address List"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "Offline Global Address List";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "Offline Global Address List";
        RecipientFilter              = "((Alias -ne $null) -and (((((((((((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact'))) -or (ObjectClass -eq 'msExchSystemMailbox'))) -or (ObjectClass -eq 'msExchDynamicDistributionList'))) -or (ObjectClass -eq 'group'))) -or (ObjectClass -eq 'publicFolder'))))";
    }
    EXOAddressList "EXOAddressList-All Rooms"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "All Rooms";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "All Rooms";
        RecipientFilter              = "((Alias -ne $null) -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox'))))";
    }
    EXOAddressList "EXOAddressList-All Contacts"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "All Contacts";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "All Contacts";
        RecipientFilter              = "((Alias -ne $null) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))";
    }
    EXOAddressList "EXOAddressList-All distribution lists"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "All distribution lists";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "All Distribution Lists";
        RecipientFilter              = "((Alias -ne $null) -and (ObjectCategory -like 'group'))";
    }
}

}

Verbose logs showing the problem

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Mic
rosoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer MyVM with user sid S-1-5-21-329068152-1454471165-1417001333-907229.
VERBOSE: [MyVM]: LCM: [ Start Set ]
VERBOSE: [MyVM]: LCM: [ Start Resource ] [[EXOAddressList]EXOAddressList-All users]
VERBOSE: [MyVM]: LCM: [ Start Test ] [[EXOAddressList]EXOAddressList-All users]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] Testing Address List configuration for All Users
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] Getting configuration of AddressList for All Users
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] Current Values: ConditionalCompany=()
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] Test-TargetResource returned False
VERBOSE: [MyVM]: LCM: [ End Test ] [[EXOAddressList]EXOAddressList-All users] in 52.4640 seconds.
VERBOSE: [MyVM]: LCM: [ Start Set ] [[EXOAddressList]EXOAddressList-All users]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] Setting Address List configuration for All Users
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] Getting configuration of AddressList for All Users
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All users] The Address List 'All Users' does not exist but it should. Creating Address List.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-All users] in 15.9290 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-All users' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::35::10::EXOAddressList' threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ Start Resource ] [[EXOAddressList]EXOAddressList-All Group]
VERBOSE: [MyVM]: LCM: [ Start Test ] [[EXOAddressList]EXOAddressList-All Group]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] Testing Address List configuration for All Groups
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] Getting configuration of AddressList for All Groups
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] Current Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All Group
Ensure=Absent
IncludedRecipients=()
Name=All Groups
RecipientFilter=((Alias -ne ) -and (RecipientTypeDetailsValue -eq 'GroupMailbox'))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] Target Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All Group
Ensure=Present
IncludedRecipients=()
Name=All Groups
RecipientFilter=((Alias -ne ) -and (RecipientTypeDetailsValue -eq 'GroupMailbox'))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] Test-TargetResource returned False
VERBOSE: [MyVM]: LCM: [ End Test ] [[EXOAddressList]EXOAddressList-All Group] in 12.7390 seconds.
VERBOSE: [MyVM]: LCM: [ Start Set ] [[EXOAddressList]EXOAddressList-All Group]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] Setting Address List configuration for All Groups
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] Getting configuration of AddressList for All Groups
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] The Address List 'All Groups' does not exist but it should. Creating Address List.
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Group] You can't use RecipientFilter and precanned filters at the same time. All precanned filt
ers will be ignored.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-All Group] in 13.1610 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-All Group' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::63::9::EXOAddressList' threw one or more non-terminating errors
while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ Start Resource ] [[EXOAddressList]EXOAddressList-Public Folders]
VERBOSE: [MyVM]: LCM: [ Start Test ] [[EXOAddressList]EXOAddressList-Public Folders]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] Testing Address List configuration for Public Folders
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] Getting configuration of AddressList for Public Folders
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] Current Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=Public Folders
Ensure=Absent
IncludedRecipients=()
Name=Public Folders
RecipientFilter=((Alias -ne ) -and (ObjectCategory -like 'publicFolder'))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] Target Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=Public Folders
Ensure=Present
IncludedRecipients=()
Name=Public Folders
RecipientFilter=((Alias -ne ) -and (ObjectCategory -like 'publicFolder'))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] Test-TargetResource returned False
VERBOSE: [MyVM]: LCM: [ End Test ] [[EXOAddressList]EXOAddressList-Public Folders] in 13.6650 seconds.
VERBOSE: [MyVM]: LCM: [ Start Set ] [[EXOAddressList]EXOAddressList-Public Folders]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] Setting Address List configuration for Public Folders
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] Getting configuration of AddressList for Public Folders
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] The Address List 'Public Folders' does not exist but it should. Creating Address Li
st.
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Public Folders] You can't use RecipientFilter and precanned filters at the same time. All precanned
filters will be ignored.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-Public Folders] in 14.4740 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-Public Folders' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::90::9::EXOAddressList' threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ Start Resource ] [[EXOAddressList]EXOAddressList-Offline Global Address List]
VERBOSE: [MyVM]: LCM: [ Start Test ] [[EXOAddressList]EXOAddressList-Offline Global Address List]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] Testing Address List configuration for Offline Global Address List
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] Getting configuration of AddressList for Offline Global Address List
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] Current Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=Offline Global Address List
Ensure=Absent
IncludedRecipients=()
Name=Offline Global Address List
RecipientFilter=((Alias -ne ) -and (((((((((((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact'))) -or (ObjectClass -eq 'msExchSystemMailbox'))) -or (ObjectClass -eq 'msExchDynamicD
istributionList'))) -or (ObjectClass -eq 'group'))) -or (ObjectClass -eq 'publicFolder'))))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] Target Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=Offline Global Address List
Ensure=Present
IncludedRecipients=()
Name=Offline Global Address List
RecipientFilter=((Alias -ne ) -and (((((((((((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact'))) -or (ObjectClass -eq 'msExchSystemMailbox'))) -or (ObjectClass -eq 'msExchDynamicD
istributionList'))) -or (ObjectClass -eq 'group'))) -or (ObjectClass -eq 'publicFolder'))))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] Test-TargetResource returned False
VERBOSE: [MyVM]: LCM: [ End Test ] [[EXOAddressList]EXOAddressList-Offline Global Address List] in 13.7730 seconds.
VERBOSE: [MyVM]: LCM: [ Start Set ] [[EXOAddressList]EXOAddressList-Offline Global Address List]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] Setting Address List configuration for Offline Global Address List
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] Getting configuration of AddressList for Offline Global Address List
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] The Address List 'Offline Global Address List' does not exist but it s
hould. Creating Address List.
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-Offline Global Address List] You can't use RecipientFilter and precanned filters at the same time.
All precanned filters will be ignored.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-Offline Global Address List] in 14.1110 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-Offline Global Address List' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::117::9::EXOAddressList' threw one or more
non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel
for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ Start Resource ] [[EXOAddressList]EXOAddressList-All Rooms]
VERBOSE: [MyVM]: LCM: [ Start Test ] [[EXOAddressList]EXOAddressList-All Rooms]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] Testing Address List configuration for All Rooms
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] Getting configuration of AddressList for All Rooms
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] Current Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All Rooms
Ensure=Absent
IncludedRecipients=()
Name=All Rooms
RecipientFilter=((Alias -ne ) -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox'))))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] Target Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All Rooms
Ensure=Present
IncludedRecipients=()
Name=All Rooms
RecipientFilter=((Alias -ne ) -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox'))))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] Test-TargetResource returned False
VERBOSE: [MyVM]: LCM: [ End Test ] [[EXOAddressList]EXOAddressList-All Rooms] in 12.3150 seconds.
VERBOSE: [MyVM]: LCM: [ Start Set ] [[EXOAddressList]EXOAddressList-All Rooms]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] Setting Address List configuration for All Rooms
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] Getting configuration of AddressList for All Rooms
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] The Address List 'All Rooms' does not exist but it should. Creating Address List.
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Rooms] You can't use RecipientFilter and precanned filters at the same time. All precanned filt
ers will be ignored.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-All Rooms] in 13.7220 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-All Rooms' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::145::9::EXOAddressList' threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ Start Resource ] [[EXOAddressList]EXOAddressList-All Contacts]
VERBOSE: [MyVM]: LCM: [ Start Test ] [[EXOAddressList]EXOAddressList-All Contacts]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] Testing Address List configuration for All Contacts
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] Getting configuration of AddressList for All Contacts
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] Current Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All Contacts
Ensure=Absent
IncludedRecipients=()
Name=All Contacts
RecipientFilter=((Alias -ne ) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] Target Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All Contacts
Ensure=Present
IncludedRecipients=()
Name=All Contacts
RecipientFilter=((Alias -ne ) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] Test-TargetResource returned False
VERBOSE: [MyVM]: LCM: [ End Test ] [[EXOAddressList]EXOAddressList-All Contacts] in 13.5300 seconds.
VERBOSE: [MyVM]: LCM: [ Start Set ] [[EXOAddressList]EXOAddressList-All Contacts]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] Setting Address List configuration for All Contacts
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] Getting configuration of AddressList for All Contacts
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] The Address List 'All Contacts' does not exist but it should. Creating Address List.
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All Contacts] You can't use RecipientFilter and precanned filters at the same time. All precanned f
ilters will be ignored.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-All Contacts] in 13.9410 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-All Contacts' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::172::9::EXOAddressList' threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ Start Resource ] [[EXOAddressList]EXOAddressList-All distribution lists]
VERBOSE: [MyVM]: LCM: [ Start Test ] [[EXOAddressList]EXOAddressList-All distribution lists]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] Testing Address List configuration for All Distribution Lists
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] Getting configuration of AddressList for All Distribution Lists
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] Current Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All distribution lists
Ensure=Absent
IncludedRecipients=()
Name=All Distribution Lists
RecipientFilter=((Alias -ne ) -and (ObjectCategory -like 'group'))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] Target Values: ConditionalCompany=()
ConditionalCustomAttribute1=()
ConditionalCustomAttribute10=()
ConditionalCustomAttribute11=()
ConditionalCustomAttribute12=()
ConditionalCustomAttribute13=()
ConditionalCustomAttribute14=()
ConditionalCustomAttribute15=()
ConditionalCustomAttribute2=()
ConditionalCustomAttribute3=()
ConditionalCustomAttribute4=()
ConditionalCustomAttribute5=()
ConditionalCustomAttribute6=()
ConditionalCustomAttribute7=()
ConditionalCustomAttribute8=()
ConditionalCustomAttribute9=()
ConditionalDepartment=()
ConditionalStateOrProvince=()
Credential=***
DisplayName=All distribution lists
Ensure=Present
IncludedRecipients=()
Name=All Distribution Lists
RecipientFilter=((Alias -ne ) -and (ObjectCategory -like 'group'))
Verbose=True
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] Test-TargetResource returned False
VERBOSE: [MyVM]: LCM: [ End Test ] [[EXOAddressList]EXOAddressList-All distribution lists] in 12.9790 seconds.
VERBOSE: [MyVM]: LCM: [ Start Set ] [[EXOAddressList]EXOAddressList-All distribution lists]
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] Setting Address List configuration for All Distribution Lists
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] Getting configuration of AddressList for All Distribution Lists
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] The Address List 'All Distribution Lists' does not exist but it should. Cre
ating Address List.
VERBOSE: [MyVM]: [[EXOAddressList]EXOAddressList-All distribution lists] You can't use RecipientFilter and precanned filters at the same time. All p
recanned filters will be ignored.
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.
+ CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-All distribution lists] in 14.3990 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-All distribution lists' with SourceInfo 'C:\tmp\EXO\M365TenantConfig.ps1::200::9::EXOAddressList' threw one or more
non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel
for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

VERBOSE: [MyVM]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost

Environment Information + PowerShell Version

OsName : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : en-US
OsMuiLanguages : {en-US}

Key : PSVersion
Value : 5.1.22621.4249
Name : PSVersion

Key : PSEdition
Value : Desktop
Name : PSEdition

Key : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name : PSCompatibleVersions

Key : BuildVersion
Value : 10.0.22621.4249
Name : BuildVersion

Key : CLRVersion
Value : 4.0.30319.42000
Name : CLRVersion

Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion

Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion

Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion

@ykuijs
Copy link
Member

ykuijs commented Nov 6, 2024

I believe this has something to do with the permissions of the account/principal you are using. If that doesn't have the correct permission, this cmdlets isn't available. Please check if you have granted the required permissions and correct if that is not the case.

@ykuijs
Copy link
Member

ykuijs commented Nov 6, 2024

As mentioned here:

In Exchange Online, this cmdlet is available only in the Address Lists role, and by default, the role isn't assigned to any role groups. To use this cmdlet, you need to add the Address Lists role to a role group (for example, to the Organization Management role group).

@CovidtheDog2024
Copy link
Author

@ykuijs thanks! Permission is ok now. but we have encountered another issue. Same issue with resource EXOGlobalAddressList

Cannot process argument transformation on parameter 'RecipientFilter'. Cannot convert value "((Alias -ne ) -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and
(-not(Database -ne )) -and (-not(ServerLegacyDN -ne )))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne ) -or (ServerLegacyDN -ne ))))))) -and
(-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" to type "System.String". Error: "Invalid filter syntax. For a description of the filter parameter syntax see the command help.
"((Alias -ne ) -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne )) -and (-not(ServerLegacyDN -ne )))) -or (((ObjectCategory -like
'person') -and (ObjectClass -eq 'user') -and (((Database -ne ) -or (ServerLegacyDN -ne ))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" at position 13."
+ CategoryInfo : NotSpecified: (:) [], CimException

Let me know if we need to open another ticket.

@ricmestre
Copy link
Contributor

Look at the very first part of your filter ((Alias -ne ), this is malformed and you need to change it.

@CovidtheDog2024
Copy link
Author

Hi @ricmestre,

Refer to the original value:
RecipientFilter = "((Alias -ne $null) -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne $null)) -and (-not(ServerLegacyDN -ne $null)))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne $null) -or (ServerLegacyDN -ne $null))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))";

We try two scenarios via Powershell, but no success

Scenario 1:
Replaced the $null string to ""
Command:
Set-AddressList -Identity "All Users" -RecipientFilter "((Alias -ne "") -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne "")) -and (-not(ServerLegacyDN -ne "")))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne "") -or (ServerLegacyDN -ne ""))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))"

ERROR:
Cannot convert value "((Alias -ne ") -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne ")) -and (-not(ServerLegacyDN -ne ")))) -or
(((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne ") -or (ServerLegacyDN -ne "))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" to type "System.String". Error: "Invalid filter syntax. For a description of the filter parameter
syntax see the command help.
"((Alias -ne ") -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne ")) -and (-not(ServerLegacyDN -ne ")))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne ") -or (ServerLegacyDN -ne "))))))) -and
(-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" at position 269."
At C:\Users\jadmin\AppData\Local\Temp\tmpEXO_okv3suad.k0f\tmpEXO_okv3suad.k0f.psm1:1205 char:13

Scenario 2:
Create Variable $nullValue ="" and replaced the $null to $nullValue
Command:
$nullValue = ""
$filter = "((Alias -ne '$nullValue') -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne '$nullValue')) -and (-not(ServerLegacyDN -ne '$nullValue')))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne '$nullValue') -or (ServerLegacyDN -ne '$nullValue')))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))"

Set-AddressList -Identity "All Users" -RecipientFilter $filter

Error
Write-ErrorMessage : Cannot process argument transformation on parameter 'RecipientFilter'. Cannot convert value "((Alias -ne '') -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne '')) -and (-not(ServerLegacyDN -ne '')))) -or
(((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne '') -or (ServerLegacyDN -ne '')))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" to type "System.String". Error: "Invalid filter syntax. For a description of the filter parameter
syntax see the command help.
"((Alias -ne '') -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne '')) -and (-not(ServerLegacyDN -ne '')))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne '') -or (ServerLegacyDN -ne ''))))))
-and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" at position 1."
At C:\Users\jadmin\AppData\Local\Temp\tmpEXO_okv3suad.k0f\tmpEXO_okv3suad.k0f.psm1:1205 char:13

@CovidtheDog2024
Copy link
Author

Hi @ricmestre and team,

Could you please provide an update on the progress and any anticipated completion timeline?

Thank you for your attention.

Best regards,

@CovidtheDog2024
Copy link
Author

Hi @ykuij,

We would appreciate your assistance with this issue. We are unable to import due to an encountered problem.

Please refer to the full DSC configuration mentioned above.

**Cannot process argument transformation on paramete**r 'RecipientFilter'. Cannot convert value "((Alias -ne ) -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and
(-not(Database -ne )) -and (-not(ServerLegacyDN -ne )))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne ) -or (ServerLegacyDN -ne ))))))) -and
(-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" to type "System.String". Error: "Invalid filter syntax. For a description of the filter parameter syntax see the command help.
"((Alias -ne ) -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne )) -and (-not(ServerLegacyDN -ne )))) -or (((ObjectCategory -like
'person') -and (ObjectClass -eq 'user') -and (((Database -ne ) -or (ServerLegacyDN -ne ))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox')))))" at position 13."

  • CategoryInfo : NotSpecified: (:) [], CimException

@CovidtheDog2024
Copy link
Author

Hi MVP,

I hope this message finds you well.

Following up on the concern we previously discussed, we are encountering an error while importing the configuration mentioned below. We have tried this on the latest version but have not found success.

Could you please advise on the next steps or provide any insights that might help us resolve this issue? Your expertise would be greatly appreciated.

Looking forward to your response.

Best regards,

*** ERROR***

RecipientFilter=((Alias -ne ) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))
Cannot process argument transformation on parameter 'RecipientFilter'. Cannot convert value "((Alias -ne ) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))"
to type "System.String". Error: "Invalid filter syntax. For a description of the filter parameter syntax see the command help.
"((Alias -ne ) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))" at position 13."
+ CategoryInfo : NotSpecified: (:) [], CimException
+ FullyQualifiedErrorId : [Server=TYZPR06MB6305,RequestId=0xxxxxx-xxxx-xxxx-0000-443444444444444,TimeStamp=Tue, 26 Nov 2024 08:55:46 GMT],Write-ErrorMessage
+ PSComputerName : localhost

 
*** Configuration***

    EXOAddressList "EXOAddressList-All Contacts"
    {
        ConditionalCompany           = @();
        ConditionalCustomAttribute1  = @();
        ConditionalCustomAttribute10 = @();
        ConditionalCustomAttribute11 = @();
        ConditionalCustomAttribute12 = @();
        ConditionalCustomAttribute13 = @();
        ConditionalCustomAttribute14 = @();
        ConditionalCustomAttribute15 = @();
        ConditionalCustomAttribute2  = @();
        ConditionalCustomAttribute3  = @();
        ConditionalCustomAttribute4  = @();
        ConditionalCustomAttribute5  = @();
        ConditionalCustomAttribute6  = @();
        ConditionalCustomAttribute7  = @();
        ConditionalCustomAttribute8  = @();
        ConditionalCustomAttribute9  = @();
        ConditionalDepartment        = @();
        ConditionalStateOrProvince   = @();
        Credential                   = $Credscredential;
        DisplayName                  = "All Contacts";
        Ensure                       = "Present";
        IncludedRecipients           = @();
        Name                         = "All Contacts";
        RecipientFilter              = "((Alias -ne $null) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))";
    }

@CovidtheDog2024
Copy link
Author

Hi MVP,

Please provide an update. We cannot fully use the DSC due to this error.
Your prompt response would be greatly appreciated.

Thank you!

@FabienTschanz
Copy link
Collaborator

@CovidtheDog2024 What happens if you escape the $ sign with a backtick ` character? So that the property looks like this:

RecipientFilter = "((Alias -ne `$null) -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact'))))";

@CovidtheDog2024
Copy link
Author

Hi @FabienTschanz,
We got this error.

VERBOSE: [myVM]: [[EXOAddressList]EXOAddressList-All Contacts] You can't use RecipientFilter and precanned filters at the same time. All precanned filters will be ignored. 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. + CategoryInfo : ObjectNotFound: (New-AddressList:) [], CimException + FullyQualifiedErrorId : CommandNotFoundException + PSComputerName : localhost

VERBOSE: [myVM]: LCM: [ End Set ] [[EXOAddressList]EXOAddressList-All Contacts] in 0.4390 seconds.
The PowerShell DSC resource '[EXOAddressList]EXOAddressList-All Contacts' with SourceInfo
'C:\Users\admin\DSC\v1.24.1218.1\outofscope\Exchange\EXOAddressList.ps1::16::9::EXOAddressList' threw one or more
non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called
Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

@FabienTschanz
Copy link
Collaborator

Can you provide the configuration you're trying to execute? I don't really get why you still receive the New-AddressList error when you said that the permissions are now okay. I guess they still aren't?

@CovidtheDog2024
Copy link
Author

Hi @FabienTschanz,
Here is the configuration. We encounter the same error when using both credentials and service principals, even though both are members of the Global Admin and Exchange Admin roles.

Thank you!

EXOAddressList.zip

@FabienTschanz
Copy link
Collaborator

@CovidtheDog2024 I'm currently checking a couple of things. Maybe it's related to the fact that you don't have the "Address Lists" permission assigned. Can you please check with the following article? https://www.easy365manager.com/the-term-get-globaladdresslist-is-not-recognized/

I had to enable organization customization using Enable-OrganizationCustomization, and now I'm waiting until I can assign that permission to the Organization Management role in the Exchange Admin center. Receiving an error message that it can't be saved right now, so I'll try again during the later day tomorrow. Will keep you posted.

Also, if you run Connect-ExchangeOnline, followed by Get-Command -Module *exo*, it will list all commands available for your currently connected session. After checking the Address Lists permission (and if it is assigned), wait for an hour and check if the command is available in your session.

@FabienTschanz
Copy link
Collaborator

@CovidtheDog2024 I can confirm that assigning the Address Lists permission to the Organization Management role solves the issue. Can you please check it?

Image

Image

@CovidtheDog2024
Copy link
Author

Hello @FabienTschanz,

It is functioning correctly now. I appreciate your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants