Dynamic Distribution Group via csv file and Recipient Filter

Hello,
I am trying to create powershell command that will read a CSV file for "Name" and "Dept" and create a Dynamic Distribution Group based on the following Recipient Filter.
Import-CSV Dist.csv | ForEach-Object {New-DynamicDistributionGroup -Name $_.Name -RecipientFilter {((((((Department -like $_.Dept) -and (RecipientType -eq 'UserMailbox'))) -and (UserAccountControl -ne 'AccountDisabled, NormalAccount'))) -and (-not(Name -like
'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')))}
I keep getting an error that "Missing closing '}" in statement block Char:314.  I added a "}" at the end of the command but then the command fails to read the .csv file.
Assistance would be greatly appreciated to determine what I am missing.  I have over 100 Dynamic Distribution list to create.
Cheers

You're definitely missing a closing curly bracket.
You have a lot of superfluous parentheses in that expression.  You could certainly simplify it.
Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

Similar Messages

  • How to view members of Dynamic Distribution Group via Outlook client?

    Hello,
    Is it possible to view the members of a DDG via the outlook cliënt (exchange 2010 SP1 + Outlook 2010)? For a normal Distribution Group I can see who are the members by viewing it's properties but not for a Dynamic Distribution Group....
    Thnx Remco

    The members of a DDG are calculated when someone sends a message to it and might not be the same eight seconds before the message of three seconds after it. Simply trying to look at the membership from
    Outlook does not enumerate the potential membership and anyway, even if you could there's every chance that the membership could change in the period of time between looking at the membership and actually crafting the message.
    "Remco Tiel" wrote in message
    news:39415e3a-af02-4dde-bcc4-cc7334233e55...
    Hello,
    Is it possible to view the members of a DDG via the outlook cliënt (exchange 2010 SP1 + Outlook 2010)? For a normal Distribution Group I can see who are the members by viewing it's properties but not for a Dynamic Distribution Group....
    Thnx Remco
    Mark Arnold, Exchange MVP.
    If I open a new email in outlook 2010, and I click on the TO: button, it brings up the Global Address List.  If I use the Drop Down under "Address Book" I can select the Dynamic Distribution List and the members are show in the main window.
    That being said, I notice that two of the three that I'm using didn't get updated until I went in and edited it, and walked through the wizard without making any changes.  Then they got updated.  One of the three was up to date without me doing
    anything, which is what I thought the whole point of Dynamic Distribution Lists was?
    Was this in a Exchange 2010 server environment?

  • Dynamic Distribution Group set conditions by importing text file?

    Exchange 2010 SP2.
    I created a dynamic distribution group via the EMC.  We have populated AD with ExtenstionAttribute1 and ExtensionAttribute2.  I have created the ddg with custom attribute1 value = employee.  What I need to do now is  populate custom attribute
    2 = 00-0001, 00-0002, and so on.  There are about 300 of these numbers I need to add.  I have them in a text file or csv file.  Instead of adding them one by one in the EMC, is there a way to import them via powershell to the existing ddg? 
    The ddg is called All Management Employees.

    If they go from 00-0001 to 00-0300, you could just add them as follows:
    Set-DynamicDistributionGroup <group name> -RecipientFilter "(CustomAttribute1 -eq 'employee') -and (CustomAttribute2 -like '00-0*')"
    However, if you have additional items like this (such as 00-0350, etc), you may need to use the following:
    Set-DynamicDistributionGroup <group name> -RecipientFilter "(CustomAttribute1 -eq 'employee') -and ((CustomAttribute2 -like '00-00*') -or (CustomAttribute2 -like '00-01*') -or (CustomAttribute2 -like '00-02*') -or (CustomAttribute2 -eq '00-00300')"
    Now, if your numbering isn't sequential and it can't be, you would need to add them individually - which may make your search filter unusable, in which case, you may need to create several dynamic groups and add them to a parent group.

  • Edit existing Dynamic Distribution Group

    I'm running Exchange 2007 RTM
    I have an existing Dynamic Distribution Group "All Staff" - here's the filter taken from 'Properties'
    (&(!cn=SystemMailbox{*})(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) )))))
    My question is it possible to EDIT the group to exclude a user? If so how?

    You can edit the dynamic distribution list in EMS and add to the recipient an exclusion based on a value of an attribute (for example a CustomAttribute). 
    first get your current recipient filter with 
    Get-DynamicDistributionGroup dl_dyn_test | fl recipientfilter
    in this example the filter is set to include everything with a CustomAttribute11 value of "plop":
    ((((((((CustomAttribute11 -eq 'plop') -and (Alias -
    ne $null))) -and (-not(Name -like 'SystemMailbox{*'
    )))) -and (-not(Name -like 'CAS_{*')))) -and (-not(
    Name -like 'SystemMailbox{*')) -and (-not(Name -lik
    e 'CAS_{*')))
    lets say we want to exclude the recipients with a CustomAttribute12 value "flop"; we would have to add "-and (-not(CustomAttribute12 -eq 'flop'))" to our filter, making it:
    ((((((((((((((CustomAttribute11 -eq 'plop') -an
    d (-not(CustomAttribute12 -eq 'flop')))) -and (
    Alias -ne $null))) -and (-not(Name -like 'Syste
    mMailbox{*')))) -and (-not(Name -like 'CAS_{*')
    ))) -and (-not(Name -like 'SystemMailbox{*'))))
     -and (-not(Name -like 'CAS_{*')))) -and (-not(
    Name -like 'SystemMailbox{*')) -and (-not(Name
    -like 'CAS_{*')))
    We can write this back to our existing DynDL with the following command:
    Get-DynamicDistributionGroup dl_dyn_test | Set-DynamicDistributionGroup -recipientfilter {<recipientfilter>}
    !!! do not forget the "{}" around the filter value !!!
    So our command becomes: 
    Get-DynamicDistributionGroup dl_dyn_test | Set-DynamicDistributionGroup -recipientfilter {((((((((CustomAttribute11 -eq 'plop') -and (-not(CustomAttribute12 -eq 'flop')) -and (Alias -ne $null))) -and (-not(Name -like 'SystemMailbox{*')))) -and (-not(Name -like 'CAS_{*')))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')))}
    After this executes you can use the previous command again to read the value of recipientFilter attribute and verify the change. You can check that the DynDL is working properly by clicking  on the Preview button on the Filter tab in the DynDL properties
    window in EMC, and verifyng that the excluded recipients are not present in the list.

  • Read a CSV file and dynamically generate the insert

    I have a requirement where there are multiple csv's which needs to be exported to a sql table. So far, I am able to read the csv file and generate the insert statement dynamically for selected columns however, the insert statement when passed as a parameter
    to the $cmd.CommandText
    does not evaluate the values
    How to evaluate the string in powershell
    Import-Csv -Path $FileName.FullName | % {
    # Insert statement.
    $insert = "INSERT INTO $Tablename ($ReqColumns) Values ('"
    $valCols='';
    $DataCols='';
    $lists = $ReqColumns.split(",");
    foreach($l in $lists)
    $valCols= $valCols + '$($_.'+$l+')'','''
    #Generate the values statement
    $DataCols=($DataCols+$valCols+')').replace(",')","");
    $insertStr =@("INSERT INTO $Tablename ($ReqColumns) Values ('$($DataCols))")
    #The above statement generate the following insert statement
    #INSERT INTO TMP_APPLE_EXPORT (PRODUCT_ID,QTY_SOLD,QTY_AVAILABLE) Values (' $($_.PRODUCT_ID)','$($_.QTY_SOLD)','$($_.QTY_AVAILABLE)' )
    $cmd.CommandText = $insertStr #does not evaluate the values
    #If the same statement is passed as below then it execute successfully
    #$cmd.CommandText = "INSERT INTO TMP_APL_EXPORT (PRODUCT_ID,QTY_SOLD,QTY_AVAILABLE) Values (' $($_.PRODUCT_ID)','$($_.QTY_SOLD)','$($_.QTY_AVAILABLE)' )"
    #Execute Query
    $cmd.ExecuteNonQuery() | Out-Null
    jyeragi

    Hi Jyeragi,
    To convert the data to the SQL table format, please try this function out-sql:
    out-sql Powershell function - export pipeline contents to a new SQL Server table
    If I have any misunderstanding, please let me know.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • Import group members those are inactive more than 30 days to a csv file and then send the updated list by email

    Hello,
    I am very new to powershell and I have been looking for a solution where I can list all the inactive members more than 30 days from  particular groups in AD, export the updated list to a csv file and send the file by email . . Can someone help me on
    this?
    thanks

    Hi,
    Take a look at Get-ADGroupMember, Get-ADUser, Export-Csv, and Send-MailMessage:
    http://ss64.com/ps/get-adgroupmember.html
    http://ss64.com/ps/get-aduser.html
    http://ss64.com/ps/export-csv.html
    http://ss64.com/ps/send-mailmessage.html
    Let us know if you have any specific questions.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Dynamic Distribution Group - Moderator approval fails

    hi,
    (On premise and office365 Exchange)
    we use the above in our organization. we have some dynamic groups created. I have a moderator for a couple of groups. when a user sends an email to one of the group that has a moderator, the latter gets an email to either approve or reject the message. when
    he/she clicks on the accept button they get the following error:
    Delivery has failed to these recipients or groups:
    Microsoft Exchange Approval Assistant
    Your message wasn't delivered because the recipient's email provider rejected it.
    Diagnostic information for administrators:
    Generating server: DB4PR07MB0701.eurprd07.prod.outlook.com
    SystemMailbox{d57a4133-7e21-486e-9917-f7fb70dc2cdb}@XXXXXX.onmicrosoft.com
    Remote Server returned '< #5.7.12 smtp;550 5.7.12 RESOLVER.RST.SenderAuthenticated; Delivery restriction check failed as sender not authenticated>'
    Original message headers:
    Received: from AMXPR07CXXXXX.eurprd07.prod.outlook.com (10.242.64.XX) by
    DB4PR07XXXXX.eurprd07.prod.outlook.com (10.141.45.XX) with Microsoft SMTP
    Server (TLS) id 15.1.6.9; Fri, 31 Oct 2014 14:20:41 +0000
    Received: from DB3FFO11XXXXX.protection.gbl (2a01:111:f400:7e04::130) by
    AMXPR07CXXXXX.outlook.office365.com (2a01:111:e400:1000::20) with Microsoft
    SMTP Server (TLS) id 15.1.11.14 via Frontend Transport; Fri, 31 Oct 2014
    14:20:41 +0000
    Received: from XXXXX.XXXXX.co.ke (197.220.102.XXX) by
    DB3FFO11FD053.mail.protection.outlook.com (10.47.217.XXX) with Microsoft SMTP
    Server (TLS) id 15.0.1049.20 via Frontend Transport; Fri, 31 Oct 2014
    14:20:40 +0000
    Received: from XXXXX.XXXXX.co.ke (192.168.11.XXX) by
    XXXXX.XXXX.co.ke (192.168.11.XXX) with Microsoft SMTP Server (TLS) id
    15.0.847.32; Fri, 31 Oct 2014 17:20:37 +0300
    Received: from XXXXX.XXXXX.co.ke ([fe80::4b9:1080:7301:f8be]) by
    XXXX.XXXXX.co.ke ([fe80::4b9:1080:7301:f8be%15]) with mapi id
    15.00.0847.xxx; Fri, 31 Oct 2014 17:20:37 +0300
    From: "XXXXX XXXXX " <[email protected]>
    To: Microsoft Exchange Approval Assistant
            <SystemMailbox{d57a4133-7e21-486e-9917-f7fb70dc2cdb}@XXXXX.onmicrosoft.com>
    Subject: Approve: * QUOTE OF THE DAY *
    Thread-Topic: * QUOTE OF THE DAY *
    Thread-Index: Ac/1FciNlxJwVzCBTJKjqDyb/OnY+gAAAOtxAAAChkA=
    Date: Fri, 31 Oct 2014 14:20:37 +0000
    Message-ID: <[email protected]>
    Accept-Language: en-US
    Content-Language: en-US
    X-MS-Has-Attach:
    X-MS-TNEF-Correlator:
    x-originating-ip: [192.168.1.XXX]
    Content-Type: text/plain; charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable
    MIME-Version: 1.0
    Return-Path: [email protected]
    X-EOPAttributedMessage: 0
    X-Forefront-Antispam-Report: CIP:197.220.102.xxx;CTRY:KE;IPV:NLI;EFV:NLI;
    X-OriginatorOrg: XXXXX.onmicrosoft.com
    X-Microsoft-Antispam: UriScan:;
    X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DB4PR07xxxxx;
    Kind Regards, Khuzema R.

    Hi Khuzema,
    Please confirm if your Dynamic Distribution Group is created on-promise and the moderator is on the Office365 Exchange.
    If the Dynamic Distribution Group and the moderator are in different Exchange servers: On-premise and Online, please open the Dynamic Distribution Group in EAC, then check
    Senders inside and outside of my organization in delivery management to have a try.
    If it doesn’t work, I suggest we can change a moderator who is in the same mailbox server with the Dynamic Distribution Group to check whether the issue persists.
    Regards,
    Winnie Liang
    TechNet Community Support

  • Create/Edit "Custom Attributes" in Dynamic Distribution Groups

    Hi,
    I wanna create a Dynamic Distribution Group based on the users "title" and "company".
    I've noticed that there are 15 "Custom Attributes" that I can edit in someway, I guess via PowerShell?
    So what is the easiest way to accomplice this?

    Hi,
    Agree with the above suggestion, you can also bulk change the custom attributes:
    Get-Mailbox -ResultSize Unlimited -Database Execs | Set-Mailbox -CustomAttribute1 “title”
    http://dougg.co.nz/2012/05/01/bulk-setting-exchange-2010-custom-attributes/
    to Edit Custom Attributes:
    get-mailbox -filter {customattribute1 -eq ""} | set-mailbox -customattribute1 = "<value>"
    And here is a reference about Create/Edit "Custom Attributes" in Dynamic Distribution Groups:
    http://windowsitpro.com/exchange-server-2010/exchange-2010-sp2-value-custom-attributes
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    Best regards,
    Angela Shi
    TechNet Community Support

  • Regarding Dynamic distribution Group filtering! - URGENT HELP

    Hello Friends,
    We have some employess in our company having primary SMTP address as
    [email protected] as well as [email protected] as alias name.
    I want to create Dynamic distribution group using recipient filter option.. I have tried various option.. nothing is worked out. can you please someone help on how to do this?
    NOTE: I can able to filter using EMC filter : using "emailadresses" + "contains" @company2.com.......
    Karthick

    Your requirement is unclear. reply back with what you are actually looking for!
    if you want to use -RecipientFilter to Create/Manage Dynamic Distribution Groups then below are the few links which has the information about the values that you may use for -RecipientFilter
    Filterable properties for the -RecipientFilter parameter
    Filters
    in recipient Shell commands
    Using
    PowerShell to Manage Dynamic Distribution Groups and Recipient Filters in Exchange Server
    Create
    Dynamic Distribution Groups Using Customised Filters
    M.P.K ~ ( Exchange | 2003/2007/2010/E15(2013)) ~~ Please remember to click “Vote As Helpful" if it really helps and "Mark as Answer” if it answers your question, “Unmark as Answer” if a marked post does not actually answer your question. ~~ This
    Information is provided is "AS IS" and confers NO Rights!!

  • Help with dynamic distribution group exclusion

    Hi all,
    Having a strange trouble with a dynamic distribution group filtering on the user being a member of a particular group
    Recipient Filter  is:
    ((((((((RecipientType -eq 'UserMailbox') -and (-not(Title -like '[]*')))) -and (MemberOfGroup -ne 'CN =ExcludeFromMoitorigList,OU=Mail Redirect,OU=System Accounts,OU=New Objects,DC=test,DC=local'))) -and (-not(UserAccountControl -eq 'AccountDisabled, NormalAccount, DoNotExpirePassword')))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))
    If I make a preview of this distribution list I get expected result. Users included in ExcludeFromMoitorigList group don't appear. But they continue receive emails sent to dynamic distribution group.
    Any help is much appreciated

    I'm not sure what all of the settings you are adding are for, but operating under the assumption that they are necessary, try this:
    ((((RecipientType -eq 'UserMailbox') -and (-not(Title -like '[]*')) -and (-not(MemberOfGroup -eq 'CN =ExcludeFromMoitorigList,OU=Mail Redirect,OU=System Accounts,OU=New Objects,DC=test,DC=local')))) -and (-not(UserAccountControl -eq 'AccountDisabled, NormalAccount, DoNotExpirePassword')))
    If that doesn't work, try this:
    ((RecipientType -eq 'UserMailbox') -and (-not(Title -like '[]*')) -and (-not(MemberOfGroup -eq 'CN =ExcludeFromMoitorigList,OU=Mail Redirect,OU=System Accounts,OU=New Objects,DC=test,DC=local')) -and (-not(UserAccountControl -eq 'AccountDisabled, NormalAccount, DoNotExpirePassword')))
    FYI, the reason for those suggestions is because I got this working on Exchange 2013 running on Server 2012 Datacenter by taking the existing RecipientFilter and adding the -not MemberOfGroup section, but noticed that all of this was then duplicated:
    -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'))
    As such, I re-created it without that, and that's what I've done with your string.  I also changed the -ne to a -not(-eq) and in the second example, got rid of some extra parenthesis that I'm not sure you need.
    Also, note that in my working scenario, I used this command and put the filter I was setting where I have indicated <filter> (I left the double quotes in the command):
    Set-DynamicDistributionGroup -Identity <Group> -RecipientFilter "<filter>"

  • Importing CSV file and converting to an Array

    Hi all,
    I'm working on a site that is importing a published CSV (comma seperated values) via actionscript 3.0 URLloader().  Right now I'm just trying to get actionscript to successfully input the imported data from the CSV into an Array, so the CSV file has only 1 cell which contains "athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor".
    Here's the code I'm using:
    //create new array
    var shirtLiveIntense_btn_Colors:Array=new Array();
    //run CSV data import
    URLLoaderCSV();
    shirtLiveIntense_btn.addEventListener(MouseEvent.CLICK, selectingLogo);
    function selectingLogo(e:MouseEvent):void{
              trace ("logo selected");
              var colorButtons:Array=this[e.currentTarget.name+"_Colors"];
              for (var i:uint=0; i<colorButtons.length; i++) {
                        colorButtons[i].ivar=i;
                        colorButtons[i].addEventListener(MouseEvent.CLICK, shirtColorOption);
    //CSV data import function
    function URLLoaderCSV() {
                var loader:URLLoader = new URLLoader();
                configureListeners(loader);
                var request:URLRequest = new URLRequest("https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AlJnOKOffTSxdFk0RVlEUTVHeF9 DMHZfZ0JzSkJjZFE&single=true&gid=1&output=csv");
                try {
                    loader.load(request);
                } catch (error:Error) {
                    trace("Unable to load requested document.");
    function configureListeners(dispatcher:IEventDispatcher):void {
                dispatcher.addEventListener(Event.COMPLETE, completeHandler);
                dispatcher.addEventListener(Event.OPEN, openHandler);
                dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
                dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
                dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
                dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    function completeHandler(event:Event):void {
                var loader:URLLoader = URLLoader(event.target);
                trace("completeHandler: " + loader.data);
                                  shirtLiveIntense_btn_Colors.push(loader.data);
    function openHandler(event:Event):void {
                trace("openHandler: " + event);
    function progressHandler(event:ProgressEvent):void {
                trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
    function securityErrorHandler(event:SecurityErrorEvent):void {
                trace("securityErrorHandler: " + event);
    function httpStatusHandler(event:HTTPStatusEvent):void {
                trace("httpStatusHandler: " + event);
    function ioErrorHandler(event:IOErrorEvent):void {
                trace("ioErrorHandler: " + event);
    Here is the output:
    openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2]
    progressHandler loaded:57 total: 0
    httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=200]
    completeHandler: athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor
    logo selected
    ReferenceError: Error #1056: Cannot create property ivar on String.
              at main_fla::MainTimeline/selectingLogo()
    Examining the output results, I see it is clearly loading the data from the CSV file correctly, but what I think it's doing is importing the data as one string, aka "athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor", and pushing it to shirtLiveIntense_btn_Colors:Array=new Array().  But, as I see from the error, function selectingLogo(e:MouseEvent) can't process the array because it contains a string.
    If I switch out shirtLiveIntense_btn_Colors.push(loader.data); with shirtLiveIntense_btn_Colors.push(athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor);, everything works like a charm, but I need the array to be assigned from the dynamic data in the CSV file.
    Can anyone lend a hand in getting the imported stringed CSV data pushed to an accessable array?
    Thanks!

    Thanks kglad for the reply.
    I substituted shirtLiveIntense_btn_Colors.push(loader.data); for shirtLiveIntense_btn_Colors=loader.data.split(","); like you suggested, but I still got the same output:
    openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2]
    progressHandler loaded:57 total: 0
    httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=200]
    completeHandler: athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor
    athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor
    logo selected
    ReferenceError: Error #1056: Cannot create property ivar on String.
              at main_fla::MainTimeline/selectingLogo()
    I also tried shirtLiveIntense_btn_Colors.push(loader.data.split(",")); and it gave me the following output instead:
    openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2]
    progressHandler loaded:57 total: 0
    httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=200]
    completeHandler: athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor
    athleticMaroon,charcoal,colonialBlue,kellyGreen,fullColor
    logo selected
    TypeError: Error #1006: addEventListener is not a function.
              at main_fla::MainTimeline/selectingLogo()
    Any ideas?
    Thanks for the help!

  • How to filter disabled accounts out of Dynamic Distribution Groups/Lists?

    As far as I understand it, OPATH does not support bitwise and/or flags, so excluding disabled accounts from dynamic distribution lists is impossible, unless I am missing something super simple.
    Many have found what they believe to be a valid solution by using -not(UserAccountControl -eq 'AccountDisabled, NormalAccount') in their filter, but this only equates to "anything NOT with a UserAccountControl value of 514 (integer)".  Simply
    adding "password does not expire" option on the account breaks that filter even if the account is disabled.
    Further, it appears anytime you create an OPATH filter, Exchange does create an LDAP equivalent filter that can be read, however it seems you cannot directly edit the LDAPRecipientFilter.  If I could, I could put in the necessary bitwise operation needed
    for this, e.g.  (!UserAccountControl:1.2.840.113556.1.4.803:=2), but it doesn't seem possible.
    Unfortunately I cannot rely on the ExchangeUserAccountControl flag as that relates to just hiding from Address Lists, and I have disabled accounts that need to be in the GAL.  Further I have active mailboxes for disabled AD accounts so I cannot use IsMailboxDisabled.
    Is this by design?  If so I don't understand why.  Are there any options (even with Exchange 2013)?

    Hi Simon.  Thanks for your response.
    I'm not sure what additional information I can provide that I have not already regarding the my suggestion/requirement, short of re-stating my original query.
    With Exchange 2003, we could simply exclude disabled accounts from dynamic distribution lists via the use of an LDAP filter that used bitwise logic against the UserAccountControl attribute, e.g.
    (!UserAccountControl:1.2.840.113556.1.4.803:=2)
    With Exchange 2007, direct LDAP queries were deprecated in favor of OPATH.  Unfortunately as a result, we can no longer filter out disabled accounts because OPATH does not support bitwise logic -xor -xand, etc.  Because of this we can no longer
    effectively use the UserAccountControl flags to exclude disabled accounts.  We can use this attribute by specifying explicit combinations of flags, e.g.
    UserAccountControl -ne 'AccountDisabled, NormalAccount'
    But because this attribute is a culmination of bits representing many different account options, there are a large number of combinations of values that could include Disabled Accounts whereby a filter such as above would NOT work.  E.g. simply adding
    an option to not expire the password on the account renders the filter above invalid.
    Currently our only option is to use workarounds which are not very effective (e.g. using a different attribute to store information about disabled accounts and filter on that instead).  As accounts can be disabled simply with a right-click in ADUC,
    enforcing the use of an additional attribute is not effective.
    I would like to understand why OPATH excludes this functionality, e.g. is it a design decision?  Or is it simply an oversight?  Further I'd like to see this functionality added.

  • Dynamic Distribution Groups - Message Delivery Restrict to Security Group

    Hi,
    I have created a dynamic distribution group and want to restrict mail delivery to only accept messages from members of a security group.  How do I achieve this?
    The idea is the DDG's are set with their criteria and if anyone leaves/joins the relevant SG then they will have permission to send to those DDG's.
    Thanks in advance.

    Hi ,
    In exchange management console it is very simple to provide the access.Please follow steps.
    1.Open the Exchange Management Console (EMC)
    2.Locate the distribution list .
    3.Right-click on it and select Properties
    4.Open the Mail Flow Settings tab
    4.Select Message Delivery Restrictions
    5.Then select the option only senders in the following list and add the DL that you would like to provide access to send email to that group.
    Thanks & Regards S.Nithyanandham

  • Exchange 2007 - Edit Dynamic Distribution Group

    Hello everyone,
    I would like to edit a dynamic distribution group, the only way possible it seems is through the command shell. In the EMC on the properties of the dynamic distribution group on the Filter tab, I copied the data in the Recipients Filter box and edited it
    to what I needed.
    But how do I now apply it to the dynamic distribution group?
    Thanks!

    If you are editing the filter directly, I would recommend using the Exchange Management Shell.  You can also fallback to editing the group using ADSIEDIT.MSC as this information is stored on the AD object properties.
    Once you have the edits completed, be sure to test your changes.  If done improperly, it could cause issues
    http://blogs.technet.com/b/dblanch/archive/2010/10/12/there-s-something-about-2007-dynamic-distribution-groups.aspx

  • Dynamic Distribution Group - RecipientContainer ignored

    When i set the container in powershell and confirm that the setting took I then run the preview filter. It is for sure pulling from out side the OU that I set in the container parm. 
    Any help on this issue?
    Proactive security not reactive, lets make it happen.

    Hi,
    From your description, you set the RecipientContainer when you create the dynamic distribution group, but actually it doesn't work. If I have misunderstood your concern, please let me know. In your case, I recommend you take your time to post the cmdlet
    you use for my further research.
    Best regards,
    Amy Wang
    TechNet Community Support

Maybe you are looking for

  • Unable to expand table (or 'any' object) node - permissions issue?

    I am the dba for a database and hence have access to the system user. When I connect to the db through SQL Developer, I can expand the table node under any user and list tables. As I can with any object node. I now want to create an admin user that h

  • OpenGL 1.3 on iMac G4 700 MHz running MacOS X 10.4.11

    Morning. I want to install and play Glest on an iMac G4 700 MHz running MacOS X 10.4.11. The machine is equipped with a Geforce MX-2. This hardware normally does not support OpenGL 1.3. I do not know whether it's necessary to have a hardware that sup

  • After Intel Pro Wireless 2200 BG software/driver upgrade cant authenticate to WRT310N

    I was having connection issues (solid connection at first then weak to poor connection downloads on the internet started good but degraded - after reading the forums here it seems likely heat related as router is very HOT), so I decided to try upgrad

  • Searching the HTML Stream

    I need to search NOT WELL FORMATTED HTML for data extraction. Are there any stream searching library in java.

  • Tools respond delayed when working in CS4 64 bit

    So now i am workingon 8 gig memory and still once i need my marquee tool or actually any tool it takes up to 8 second until it even is available then after it is i dra my.. lets say rectangle.. dont see it while drwaing but have to wait another 3-7 s