N
N
NNS2020-08-12 05:35:33
PowerShell
NNS, 2020-08-12 05:35:33

How to copy/sync containers to AD?

Hello, there is a domain (ws 2012) and units Computers and Users.
Within the subdivision Users subdivisions are created Departments, then the names of departments ( Users-Departments-IT department ). There are many departments.

How to recreate the same structure of departments in the Computers container, and then edit one manually, and synchronize with the other with a script.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MaxKozlov, 2020-08-12
@NNS

A lot of programming :)
get-adobject -filter 'objectclass -eq "organizationunit"' -searchbase 'cn=computers,'dn=site,dn=com' get objects, sort them, then create similar ones in users via new-adobject
with removal can only be problems - if there are users inside ou, you can run into trouble.
P.S. in general, the task is very far-fetched. Why keep two identical structures in different branches? After all, you can keep both users and computers nearby

S
shaytan, 2020-08-20
@shaytan

You create an OU Company at the root of your domain. There you create a tree: Department-Subdivision-Department
In final OU you will create OU Comp, Usr, Grp. You add types in them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question