Hello there, I'm hoping someone can help me out with some Role Based Templates I'm trying to create, in the form of .ps1 files
My team creates AD Accounts for users, then applies groups to their profiles based on their role within the company - so far, I've created the following rudimentary script (if you can even call it that):
----------------
Import-Module activedirectory
$Location = "M:\Mailenable"
get-content $location\Groupmembers.txt | add-distributiongroupmember Group1
get-content $location\Groupmembers.txt | add-distributiongroupmember Group2
get-content $location\Groupmembers.txt | add-distributiongroupmember Group3
----------------
However, to get this to work, the Group names are actually the alias to a mail-enabled group, and I don't want to mail enable every group in our AD.
I'd like to do the same kind of function, but use "Add-ADGroupMember" and Add-ADUser if possible, but I can't seem to get anything to work
There's lots of info out there on how to import users from .csv and add to group or multiple groups, but not in this 'role based template' way that I'm looking for
If anyone can offer some insight, it would be greatly appreciated! Thank you