Basic user query in Exchange online (on way to create a DDL) “it’s not getting what I want”
question
I have been trying to construct an additional DDL that won’t work in the “canned queries”.
Basically my logic was
company=RRR, State=NY OR State=Remote
The concept being get staff from company RRR that have either NY or Remote in the state field.
I’m getting nothing at all. (code will be below)
So what I’d like to try is just putting in search queries at a Exchange online CLI so I can build up my query from scratch. (i.e. I’d expect 150 for company=RRR and fewer as I add more query elements. That way I could check my logic one piece at a time.
The canned queries for this don’t work since I’m asking for an OR not an AND.
I have also tried a canned query: Company=RRR, State=NY and attribute 1=Remote and get nobody. (which would make sense again since I still want OR.)
SO, I end up with the below doesn’t work which means either my code is bad or my logic is bad. (and I’m not sure which since I’m getting no errors and it might BE doing just what I ask and my logic is bad)
HERE IS THE CODE
New-DynamicDistributionGroup -Name “RRR-All-US-employees2” ((((Company -eq ‘RRR’) -and (StateOrProvince -eq ‘US’ -or StateOrProvince -eq ‘NY’)
-and (RecipientType -eq ‘UserMailbox’))) -and (-not(Name -like ‘SystemMailbox{*’)) -and (-not(Name -like ‘CAS_{*’)) -and (-not(RecipientTypeDetailsValue -eq ‘MailboxPlan’))
-and (-not(RecipientTypeDetailsValue -eq ‘DiscoveryMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘PublicFolderMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘ArbitrationMailbox’)) -and
(-not(RecipientTypeDetailsValue -eq ‘AuditLogMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘AuxAuditLogMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘SupervisoryReviewPolicyMailbox’))
-and (-not(RecipientTypeDetailsValue -eq ‘GuestMailUser’)))
questionI have been trying to construct an additional DDL that won’t work in the “canned queries”.Basically my logic wascompany=RRR, State=NY OR State=RemoteThe concept being get staff from company RRR that have either NY or Remote in the state field.I’m getting nothing at all. (code will be below)So what I’d like to try is just putting in search queries at a Exchange online CLI so I can build up my query from scratch. (i.e. I’d expect 150 for company=RRR and fewer as I add more query elements. That way I could check my logic one piece at a time. The canned queries for this don’t work since I’m asking for an OR not an AND.I have also tried a canned query: Company=RRR, State=NY and attribute 1=Remote and get nobody. (which would make sense again since I still want OR.) SO, I end up with the below doesn’t work which means either my code is bad or my logic is bad. (and I’m not sure which since I’m getting no errors and it might BE doing just what I ask and my logic is bad)HERE IS THE CODE New-DynamicDistributionGroup -Name “RRR-All-US-employees2” ((((Company -eq ‘RRR’) -and (StateOrProvince -eq ‘US’ -or StateOrProvince -eq ‘NY’)-and (RecipientType -eq ‘UserMailbox’))) -and (-not(Name -like ‘SystemMailbox{*’)) -and (-not(Name -like ‘CAS_{*’)) -and (-not(RecipientTypeDetailsValue -eq ‘MailboxPlan’))-and (-not(RecipientTypeDetailsValue -eq ‘DiscoveryMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘PublicFolderMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘ArbitrationMailbox’)) -and(-not(RecipientTypeDetailsValue -eq ‘AuditLogMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘AuxAuditLogMailbox’)) -and (-not(RecipientTypeDetailsValue -eq ‘SupervisoryReviewPolicyMailbox’))-and (-not(RecipientTypeDetailsValue -eq ‘GuestMailUser’))) Read More