Hi,
Yesterday one of my users asked me to create a few user group for him. Normally to create a new group i open "DSA.MSC" or "Active Directory users and computers" and create a desired group. This time i thought i would create a new group using PowerShell.
To create a new group in Active Directory make sure you have RSAT installed.
Lets Start.
Make sure you have "RSAT" installed on you laptop.
Now Import the Active Directory module.
Import-Module ActiveDirectory
..
ok, Module is imported,,
we are going to use "New-ADGroup" cmdlet.
I want a group Name to be "Singers", i my OU "Testing", the Group category in my case is "Security" and the Group Scope is "Global". I choose a -Server parameter because my main DC in located outside of Delhi and then using -Credential we are providing domain administrator username and password becasue you need administrator privileges to create a group in Active Directory.
The command should be like below.
New-ADGroup -Path "OU=testing,DC=localdc,DC=com" -Name "Singers" -GroupCategory Security -GroupScope Global -Server "local-dc" -Credential localdomain\administrator
After run the Command it is asking for Domain Administrator Credentials. Provide them.
Thanks
Aman Dhally
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.