6 Manage groups like a boss

 

This chapter covers:

  • The basics of utilizing conditional logic in our scripts
  • Identifying the Active Directory Groups any User in our Domain is a member of
  • Using an existing user as template to copy group membership to anyone with a single script

It’s common in today’s environments to manage file access with the concepts of least privilege and Role Based Access Controls (RBAC).  This prevents anyone without a need to access specific company data from accessing the data.  This is exactly what Active Directory groups were created for. 

But managing groups and making sure that new users have all the file access they need can be cumbersome at best and a true nightmare at worst.  This Tiny PowerShell Project will throw admins a lifeline in this regard. 

Traditionally, when you want to create a new user in a department you look for the groups that they will need to be a member of.  Few things are more frustrating to users and their managers than waiting days to get their new employee a login then waiting weeks before that employee can actually start doing what they were hired to do. 

This usually entails:

6.1 Using Conditional Logic

6.1.1 If

6.1.2 If / Else

6.2 More Active Directory Methods and Cmdlets

6.2.1 Get-ADUser

6.2.2 Add-ADGroupMember

6.3 Putting it all together

6.3.1 Creating a Menu

6.3.2 Confirming with the IF/Else statement

6.3.3 Create a variable containing the groups

6.3.4 Loop through the list

6.4 Summary