Dynamic groups Exchange 2013

Hi all,
our company uses an Exchange 2013 server in a hosted server structure. I have to set up some simple dynamic e-mail groups, based on the organizational unit the respective users are in. I can do that without using PowerShell, just configuring 'membership' in web administration.
Now one of our bosses needs to be included in some (but not all) of those groups, but he's located in another OU. Since the basic rule for user membership is 'users with exchange post offices' (sorry, translated from german), I think I can't use any link to that boss like a contact or the like.
Is it possible to leave all the bosses in their own OU but include some of them in such simple group?
If not, what's the easiest way to use PowerShell commands from a file (I never did this in the past) and save successful commands into a file?

Btw, I searched the Microsoft pages for a good documentation of their Exchange management by PowerShell, but I didn't find any...

TIA
Michael
mkmkoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Marwan OsmanCommented:
Hi

1-  open powershell on active directory

2-  run
     Import-module activedirectory

3-  run
     Add-ADGroupMember -Identity "group name" -Members yourbossAccount
0
mkmkoAuthor Commented:
Ok, I will try this. What syntax I have to use for correct group names? If I just enter "name-of-my-group", it won't be found. I guess I'll have to prefix it with the AD path , but I can't get it working (like '_groups\name-of-my-group').
Also, the docs tell me something about viewing members of dynamic groups, but I can't find it within the web administration. Maybe there's a simple command for powershell listing the currently active members...

TIA,
Michael
0
mkmkoAuthor Commented:
Addendum:
I found the following commands to list members of dynamic groups/lists:

$members = Get-DynamicDistributionGroup -Identity "name-of-my-group"
Get-Recipient -RecipientPreviewFilter $members.RecipientFilter | select Displayname,PrimarySmtpAddress

When I run these commands, I always get a list of all my users (counting the list always gives me 56, regardless of the list). When I'm looking in the exchange web management console, then at the right there's a text like '<n> users received the last mail...' (sorry, translated), and this correctly reflects the number of users to be in the group. So it seems that my above commands are incomplete (although I got it from this forum).

Michael
0
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.

Marwan OsmanCommented:
I have a group named ALL Eng users, and a user account named stony

I ran:

Add-ADGroupMember -Identity "all eng users" -Members stony

I went to stony properties in active directory to see his membership and found that he was added to All eng users

please try it and inform me if it works or not
0
mkmkoAuthor Commented:
Seems thet it doesn't work with dynamic distribution groups - still the same error (translated): No object with ID "name-of-my-group" can be found in "DC=domain,DC=local". Also, dynamic distribution groups won't be displayed in user membership, and users won't be listed in dynamic distribution group members (in fact, there's no 'members' tab on these objects).

Do we speak about the same things - a group I created within the EMC as 'dynamic' and also set the basic attributes in EMC?
Maybe I didn't tell it clear enough....

TIA,
Michael
0
Marwan OsmanCommented:
since the memberships is added based on the rules you set, there is no option to add a user to those groups unless you change the rules to others criteria to be compatible with the boss.

to work around the issue, you can create a rule ( in EAC go to mail flow and create it) and put the conditions as below:

1- Apply this rule if...  (select the recipient is..... and add the smtp addresses of all of the group(s) where the boss needs to have membership)

2- Do the following... ( select add recipient to the to box and add the email address of the boss)

3- save the rule


note: the "add recipient to..." is hidden, you can see it after clicking more options
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mkmkoAuthor Commented:
In the end, I find that I can't go further with only using the EMC. I can't figure out why my RecipientContainer doesn't work in a powershell script. But I finally used one of the CustomAttributeXX values for simulating the container association. And then I can build my basic condition, adding single users with '-or' - thanks to your links.

Accepted as solution, thanks a lot :)

Michael
0
Marwan OsmanCommented:
where is the or option??, I was going to tell you that you have to add rule and select a custom attribute, but I noticed that the condition will be the first rule and the new rule (not or) so the users will lose their membership
0
mkmkoAuthor Commented:
Ok, I tried this, but Exchange tells me that I need to have an Enterprise CAL for every user when I'm using this extended functionality. I have to check that with our hosting company.
If we do have the needed CALs, this would be a much better solution than mine :)

Again - thanks a lot for you help and saving me much time!

Michael
0
Marwan OsmanCommented:
You are welcome Mr. Micheal
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.