0

I have a user in my workplace domain, I want to add him to a specific domain group then assign him some privileges on a specific folder. I wonder how this can be done using command line or a more automated process than doing it step by step as I do this quite often. I'm using AD on windows 10

Looks like dsmod group can be used but I don't know how. Like if I have a user with username userh01 in domain mydom how I can add him automatically to group mydomgroup1?

I've tried this command dsmod group "mydomgroup1" -addmbr "userh01" but I get this error dsmod failed:Value for 'Target object for this command' has incorrect format. Any advice?

Tak
  • 103
  • 5

1 Answers1

1

You should use the ActiveDirectory Module for PowerShell and the Add-ADGroupMember cmdlet

example: Add-ADGroupMember -Identity MyGroup -Members MyUser

Swisstone
  • 6,725
  • 7
  • 22
  • 32