Solved

How to create dynamic Groups in Active Directory (not dynamic Distribution List)

Posted on 2006-07-21
8
8,654 Views
Last Modified: 2009-07-01
Hello,

is there a way to create groups dynamically based on office location, department, title etc?

there is solution to create dynamic distribution list, but would need to create dynamic groups.

thanks.
0
Comment
Question by:swisscommerce
[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
8 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17158936
IMHO unless you are talking about using a third party tool, probably syncing AD with a HR system or the like I can't see that working directly.

I suppose you could write some nifty scripts which do LDAP queries onto the directory or query another database for the details and then re-populate the members of a group on a schedule.

Are the attributes you mention already in AD now?  What do you intend to use the groups for?

Can you get a distribution group with all the correct users into it dynamically already?  In which case maybe a simple script to take all the members of distgroupa and update groupb?
0
 
LVL 26

Expert Comment

by:Pber
ID: 17160044
You can't do this for security groups unless you use a 3rd party tool or scripting as dragon-it mentioned.
0
 

Author Comment

by:swisscommerce
ID: 17160297

1. yes, the attributes are already in AD, such as office first name, last name, email, phone, fax, mobile, title, department, office address, city and country for each user.

2. the groups will be used for multiple web based applications, portals etc that require us to create groups. We are able to create dynamic groups directly from those applications with user attributes taken directly from active directory. But instead of creating one and the same group in each application, we prefer to create the group ONCE in AD and have all applications to use the same group from AD. Makes sense?

right now, AD allows you to create groups, however, the group members needs to be added and updated manually as new employees are added or removed, which is very time consuming for larger number of users.

3. yes, we are able to create dynamic distribution groups with the correct users already. But what script can we use to convert those distribution list to create the groups? even if we can run that script once a day to update the groups, it will do the job.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:swisscommerce
ID: 17160363
or can you recommend any 3rd party that does that?
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 17161506
I presume these are standard AD dist groups?  In which case you could do something with a scheduled batch file perhaps?

net group "Your Dist List name" should retutn the members of that group
You can use

net group "groupname" /add name to add them to another group.

If you have spaces in some usernames things could be difficult but if you don't this might work, seems OK in my own quick tests.  You could so similar to delete all group members first too.

@echo off
for /f "skip=6 tokens=*" %%A in ('net group "dist group" ^|find /v "command completed"') do call :process %%A
goto end

:process

set fullline=%*

net group "access group" /add %fullline%

:end

To delete group members:

@echo off
for /f "skip=6 tokens=*" %%A in ('net group "access group" ^|find /v "command completed"') do call :process %%A
goto end

:process

set fullline=%*

net group "access group" /delete %fullline%

:end
0
 

Expert Comment

by:super3
ID: 21918902
the NET GROUP command does not return any Dynamic Distribution Groups.

It only returns security groups.


0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

635 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