?
Solved

new-DynamicDistributionGroup

Posted on 2014-12-02
3
Medium Priority
?
444 Views
Last Modified: 2014-12-02
Trying to get a DDL set up that excludes a group of people based on there custom attribute see the command below and error I am getting

Command

new-DynamicDistributionGroup -Name 'All Test DL' -RecipientContainer 'contso.com/new' -IncludedRecipients 'MailboxUsers' -ConditionalCustomAttribute9 -notlike 'NOALL' -OrganizationalUnit 'contso.com/new' -Alias 'AllTestDL'


Error

A positional parameter cannot be found that accepts argument 'NOALL'.
    + CategoryInfo          : InvalidArgument: (:) [New-DynamicDistributionGroup], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,New-DynamicDistributionGroup


Please let me know what I am missing
0
Comment
Question by:SEHC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Expert Comment

by:Jamie McKillop
ID: 40476798
Hello,

You can't use an operator with switches. So, if you are going to use the -ConditionalCustomAttribute switches, they need to equal the value you set. If you want to use an operator, you need to use a recipient filter.

Like this:

New-DynamicDistributionGroup -Name 'All Test DL' -RecipientContainer 'contso.com/new' -IncludedRecipients 'MailboxUsers'  -OrganizationalUnit 'contso.com/new' -Alias 'AllTestDL' -RecipientFilter {(CustomAttribute9 -notlike 'NOALL*')} 

Open in new window


-JJ
0
 
LVL 4

Author Comment

by:SEHC
ID: 40476811
getting this error now

Parameter set cannot be resolved using the specified named parameters.
    + CategoryInfo          : InvalidArgument: (:) [New-DynamicDistributionGroup], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,New-DynamicDistributionGroup
0
 
LVL 37

Accepted Solution

by:
Jamie McKillop earned 2000 total points
ID: 40476854
Sorry, you need to remove the -includedrecipients switch when using the -recipientfilter switch.

-JJ
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question