Avatar of Kelly Garcia
Kelly Garcia
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Active Directory Automation

Hi All,

when we create users, we have to manually put the user in the in the correct OU based on the location of the user, e.g. the user is based in Singapore, we put the user in the Singapore ou. we also have to add the user to specific groups etc.

is there a way to automate this process?

thank you in advance,
* AutomationActive DirectoryPowershell

Avatar of undefined
Last Comment
Sam Bloom

8/22/2022 - Mon
Irwin W.

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

If you always fill out identifying fields in AD like location, you can run a scrript to evaluate that and perform the necessary changes.
Kelly Garcia

the problem is we will have to run these scripts manually, is there a way the script is automatically triggered as soon as the account is created?

You always trigger that manually in one or the other way. But you cannot trigger something automatically if a user is created.
Your best choice is to use a script to create the user and perform all necessary operations, similar to what nappy_d showed.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Irwin W.

Agreed with @Qlemo.

You would have some planning to do but based on the start I've sampled in my original post, it would be best if you had nested security, as well as role-based permissions, for your security groups.

This would assist with the script for creation of new users.

I can also show you how you can implement if statements for a feature command called if member.
Kelly Garcia

I know there are utitlies like active roles, that  run scripts upon user creation. are there any others that you will recommend?
Irwin W.

Quest makes some great tools but this is not one that I've used.
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Sam Bloom

It really depends on the complexity of the task that you want to automate. If it's a small environment, a PowerShell script can be perfectly ok, but if you have long provisioning procedures with lots of rules to follow, there are advanced tools that let you put it all together.