title: Powershell - Get-ADOrganizationalUnit Groups
body: <p>I'm starting to get my head around powershell. But then again maybe not!
  Can someone please tell me how to list all security groups within a OU? </p>
  
  <p>I am able to list all the members within a group, for example:</p>
  
  <pre><code>get-adgroupmember "groupName" | select-object name
  </code></pre>
  
  <p>In the following, I am trying to list all security groups within an OU:</p>
  
  <pre><code>Import-Module ActiveDirectory
  Get-ADOrganizationalUnit -Identity 'ou=OUName'
  
  ERROR: Cannot find object with identity: ......
  </code></pre>
  
  <p>I would like to remove all members from all security groups in a particular OU. Then I would like to add group members from a text file.</p>