AD GPO sys265 - DefiantCoder/Tech-Journals GitHub Wiki

  • Creating an OU via powershell

NEW-ADOrganizationalUnit “OUnamehere”

  • Deleting an OU via powershell (and any issues)

Remove-ADOrganizationalUnit -Identity "OU=OUnamehere,DC=domain,DC=Local"

If you checked the 'protect form accidential deletion' box you need too run this command

$ou = "OU=OUnameHere,DC=domain,DC=Local" Set-ADOrganizationalUnit -Identity $ou -ProtectedFromAccidentalDeletion $false Remove-ADOrganizationalUnit -Identity $ou -Confirm:$false -Verbose

  • Moving Items to a new OU (via powershell or gui)

To move an Item to a new OU right click on the item and select 'move' then from the file path choose your destination OU and click ok.

You can also use the Move-Item command to accomplish this

  • Searching the Event Log using Powershell

The Get-EventLog command and it's modifiers can allow you to find whatever event logs you need but make sure you have the basic information to narrow your search.

Event Log Commands Powershell