title: How to run powershell script under specific OU?
body: <p>I am trying to bulk delete AD groups with the following powershell script:</p>
  <pre><code>$OU = &quot;OU&quot;
  
  $groups = get-content &quot;path to csv&quot; | Get-ADGroup -Properties ProtectedFromAccidentalDeletion
  
  $groups | Set-ADObject -ProtectedFromAccidentalDeletion $false
  
  $groups | Remove-ADGroup –whatif
  </code></pre>
  <p>However, I need this script to run under a specific OU in the domain. Tried to look it up but couldn't find anything that worked for me.
  Any ideas?</p>
  <p>Thanks!</p>