r/msp•
dbeta

Maintaining OU Structure With PowerShell

Another blog post hot off the presses. This time it is about creating and maintaining a set of standard OUs and security groups across your clients.

This script is pretty much RMM ready. Just modify it to meet your organization's needs, and drop it into the RMM to run against servers with an Active Directory FSMO role like Domain Naming Master, that way it isn't running on multiple domain controllers in a domain.

https://dbeta.com/2021/04/19/PowerShellMaintainOUStructure

Posted Apr 20, 2021, 11:23 AM UTC

269
lot365•

Personally not a fan of the OU structure because it doesn’t allow for access separation by OU. No one wants to manage individual item access levels.

Also creating an OU called Company is redundant and a waste of a click. Three levels is the most you should have. Yes it gets populated with thousands of items quickly but that’s what search/query is for.

Instead, you should have the following top level OUs. One is already there for you.

 Domain Computers
      Servers
      Workstations (no need to go further as you can use groups to manage GPOs)
 Domain Controllers
 Domain Groups
     Access
     Configuration
     Email
     Roles
        Administrator
        Standard
 Domain Users
      Administrators (Add sub OUs if you want to have tiered admins)
      Privileged
      Service Accounts
      Standard
1
dbetaOP•

It depends on the client as to how we do it, this is our base, and then new OUs get created under the categories listed.

I like putting them under the "Company" header because it separates everything we do from stuff that is built in.

There's nothing wrong with your layout though. And it would be pretty easy to modify my script to create that layout for you.

1
TheJadedMSP•

Where’s yours?

0
dasunsrule32•

I'm learning the MSP world here, I'm assuming you're standing up individual domains, then creating/maintaining those using the RMM at the customer sites? If so, I need to read up more on what RMM's do. I got the drift that they were more client side, documentation, ticketing, remote support and policies. Thank you.

1
dbetaOP•

The domains are almost always inherited when we take on the client, very rarely do we get to make one from scratch. But when we take over a client, we like to push the organization of their domain in line with our standard, and these OUs are part of it. The Employees security group that gets created normally replaces "Domain Users" or "Authenticated Users" wherever it is used. The advantage of that is that a service account, computer account, or intern account, wont have full access to anything with the Employees security group.

A lot of people don't realize that Authenticated Users includes Domain Computers. So any computer on the domain can access those resources without a user authenticated.

2
dbetaOP•

Oh, and an RMM is just a tool that both collects data on the client for you, and runs scripts on the computers for you. Normally using some information collected to decide what scripts to run with what settings. For example, you might have a client that needs Chrome installed on every workstation, so your RMM collects installed programs, and when it finds a workstation without Chrome installed, it triggers the chrome install script on the workstation.

2
dasunsrule32•

Yeah, I'm aware of the computer accounts. Thank you for this and the answer below. Been following the sub as I'm looking at starting my own MSP on the future. Just gathering all the info I can.

0
dbetaOP•

Part of the "onboarding" process for clients is looking at their layout, and seeing where we can push them closer to our standard. Sometimes that is for our convenience, like this, and sometimes it is for security, like enabling MFA in M365.

This also helps with security, because many clients have very messy AD when we take them on, hiding things like user accounts in weird places. This helps us "Own" their domain, knowing everything about it, and being ready to control it as needed. Different scales work differently, of course, but if you are an MSP targeting small business, you will get handed some real messes and expected to take care of it.

3
dasunsrule32•

Yep, I was in a poorly run MSP about 14 years ago. I saw quite a few disasters.

0