Import AD powershell module if not already loaded

 


Create an AD group

-groupscope : Domainlocal(0), Global (1), Universal (2). ( LDAP property “groupType”)
-instance ADGroup : Use AdGroup as template

Example 1:

Example 2:

 


Create a new Organizational Unit

Example:

 


Get the AD distinguished name