Forum Discussion
Thedarkpools
May 07, 2021Copper Contributor
Export/Import Users/Groups from AD to Test AD
I'm trying to compile a script that will help in my project. Project scope: Mirror Prod to Dev AD. Export all users and security group membership (including nested groups) to a csv. Users live in...
SteveMacNZ
May 11, 2021Iron Contributor
restoring domain controllers and other critical servers into a segregated environment is normally the best method - as recreating the server / users is not a true representation of the production domain, and would potentially lead to non predictable results - things like SIDs etc will be different and the potential for configuring differences between Prod and Test is greater.
As for requiring access to SSO and Office365 if you are using the same namespace/forest/domain/upn trying to connect to the same tenant you will run into issues regardless of the approach (PowerShell verses cloned/restored). Typically we would have the test domain going into a test tenant...
if forest/domain namespaces are different then you could connect both domains into the same tenant - with AD Connect in Production network connecting to the test network (Two different domains in one Office 365 tenant - Microsoft Tech Community) for more information. But again if your user details UPNs etc are the same you will run into issues and potentially have your production users soft-matched to the test domain user account
Thedarkpools
May 12, 2021Copper Contributor
That makes sense and I hear what you are saying. This is a test Office tenant, and test AD, the only thing that is the same is the username, and security groups, albeit going from john.doe@mycompany.com to john.doe@testcompany.com I just simply want to match the user and security groups. So far, what I have tested does work but this is only a few OU's and a few Users. I didn't think this would be that difficult to obtain as seems there are tons of PS commands to make this happen, but I just am stuck on OU specific and not the full AD structure.
Would it make it easier to paste what script I have and then try to see if someone can modify?
Would it make it easier to paste what script I have and then try to see if someone can modify?