Add-LocalGroupMember is not recognized as a cmdlet , function , script or file on windows server 2012

Viewed 8031

Is there a way to add addlocalgroupmember module on windows server 2012? I didnot find any. I need to add AD account on local admin group but i couldn't find a way.

The closest i was able to reach is to install activedirectory-powershell feature using the following command but that too didn't help.

Basically i need to find a way to run a powershell command similar to the below one on win server 2012 -

Add-LocalGroupMember -Group "Administrators" -Member "domain\user"
2 Answers

You don't really need to complicate things much here. In reality you can achieve what you want with a one-line without installing any module since you're not modifying AD you can simply use.

net localgroup Administrators /add domain\username

Related