addresslist with filter for multiple OU´s
HelloIs there a way to create an addresslist with multiple OU´s including the sub OU´s?I have tried following, but I don´t get any user.new-AddressList -RecipientFilter{(((recipienttype -eq 'usermailbox') -and ((RecipientContainer -eq 'MYDOMAIN/MAIN/FinanceOffice') -or (RecipientContainer -eq 'MYDOMAIN.ORG/MAIN/DevelopOffice'))) ))}-identity 'TestAddresslist'regards Björn
April 13th, 2010 12:09pm

Hi, It is impossible to create an address list with users from an OUMeaning you cannot have an address list whose filter is something like "all users in the domain.com/CompanyX and below". Too bad, since that was what I was trying to do. Anyone else missing this feature? (And by the way; no, you cannot filter on distinguished name.) The use of the RecipientContainer property inside the RecipientFilter parameter is not supported/possible even though it is listed as valid. If you examine the documentation carefully (or more carefully that I did, anyway) you will see that the OPATH property RecipientFilter actually maps to the LDAP attributemsExchDynamicDLBaseDN (http://technet.microsoft.com/en-us/library/bb430771(EXCHG.80).aspx) Reference: Using RecipientContainer with New-AddressList cmdle Regards, Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
April 13th, 2010 2:07pm

Hi, Also if you try to use RecipientContainer as a perameter to the command (not insider filter) then u will also have error, while "RecipientContainer " has been mentioned as a valid parameter for new-addresslist command at technet docs http://technet.microsoft.com/en-us/library/aa996912.aspx. [PS]PS>new-AddressList -name TestAL1 -RecipientContainer "Enterprise.local/TestOU" New-AddressList : A parameter cannot be found that matches parameter name 'RecipientContainer'. At line:1 char:50+ new-AddressList -name TestAL1 -RecipientContainer <<<< "Enterprise.local/TestOU" Also you cant pass -identity, u will have to give -name parameter for AL name. [PS]PS>new-AddressList -identity TestAL1 -RecipientContainer "Enterprise.local/TestOU" New-AddressList : A parameter cannot be found that matches parameter name 'identity'. At line:1 char:26 + new-AddressList -identity <<<< TestAL1 -RecipientContainer "Enterprise.local/TestOU" Regards, Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
April 13th, 2010 2:15pm

Hi Sorry my mistake the correct ps script is:new-AddressList -Name 'TestAddresslist' -DisplayName 'TestAddresslist' -RecipientFilter{(((recipienttype -eq 'usermailbox') -and ((RecipientContainer -eq 'MYDOMAIN/MAIN/FinanceOffice') -or (RecipientContainer -eq 'MYDOMAIN.ORG/MAIN/DevelopOffice'))))} I had been working with set-addresslist and have forgotten to change all parameters.I´m working with Exchange 2010. The script runs fine without an error only the result is empty.The link you posted seems to be the answer. Since Microsoft reference to the Exchange 2007 help for the RecipientFilter I think there is no change on it in 2010. thanks for your help Björn
Free Windows Admin Tool Kit Click here and download it now
April 13th, 2010 2:33pm

Hi, Yes the link which i posted is answer as u have seen on exchange 2010, and i personally have tested it on 2007. I will also test it on ex2010, but i think i dont need to, as u have already tested. Regards, Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
April 13th, 2010 3:40pm

Have you tried using EMC to create the address list and then viewing the cmdlet syntax that's generated? http://technet.microsoft.com/en-us/library/bb125036.aspx should help - follow the steps in the "Use the EMC to create an address list" section and then check the syntax EMC uses to create the address list against your own syntax. Missy
Free Windows Admin Tool Kit Click here and download it now
April 13th, 2010 4:11pm

Hi Missy with Emc I can select only one OU and then use the recipientfilter on it. With Emc it seems not be possible to select multiple ou´s.Thanks all for your help again Björn
April 13th, 2010 4:37pm

Right, but then you could model your cmdlet to use multiple OUs based upon the syntax of the single OU address list creation in EMC. I don't know for certain that it would work, but it'd certainly be worth trying. Missy
Free Windows Admin Tool Kit Click here and download it now
April 13th, 2010 4:50pm

Hi, I also test in my lab(Exchange 2010). I can run the cmdlet as expect: new-AddressList -name TestAL1 -RecipientContainer "Enterprise.local/TestOU" So I think since Exchange 2010, you can create addresslist with filter "OU". Also as MissyKos said, it is listed in the EMC. But I cannot find a way to add mulitple OU(multivalue) in the cmdlet. Neither new-AddressList -name TestAL1 -RecipientContainer "Enterprise.local/TestOU","Enterprise.local/TestOU2" Nor new-AddressList -name TestAL1 -RecipientContainer "Enterprise.local/TestOU,Enterprise.local/TestOU2" I also try to add multivalue as Technet article said, but it failed: http://technet.microsoft.com/en-us/library/bb684908.aspx The error message is: MethodNotFound So I guess the -recipientContainer doesn't support multivalue. Thus I try to run the cmdlet to get the method of object's property: $var1 = (get-addresslist testAL1).recipientcontainer get-member -inputobject $var1 -membertype method Compare with other cmdlet, for example: (get-mailbox).emailaddresses, (get-distributiongroup).emailaddresses,(get-transportconfig).generatecopyofdsnfor There is no Method named "Add" which I guess it is support for multivalue. Frank Wang
April 14th, 2010 12:19pm

Hi, Som more info: Yes may work on ex2010 but doesn't work on ex 2007. Also even I can't run new-addresslit command with "RecipientContainer " on Exch 2010 which is runnig with legacy exchange 2007 server. In this case I get the following error new-AddressList -name TestAL1 -RecipientContainer "Enterprise.local/TestOU" Error: You can't specify the recipient container because legacy servers are detected. I also tested this on ex2010 new-AddressList -Name 'TestAddresslist' -DisplayName 'TestAddresslist' -RecipientFilter{ (recipienttype -eq 'usermailbox') -and (RecipientContainer -eq 'OU=TestOU,DC=Enterprise,DC=local') } but no success. It runs fine but in EMC i cant see any user in my AL. This means that in RecipientFilter we cant use RecipientContainer with Exchange 2010 too, same case is with ex2007. So I think that only new-AddressList -name TestAL1 -RecipientContainer "Enterprise.local/TestOU" will work on ex2010 with no legacy server. Regards, Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
April 14th, 2010 1:33pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics