deleteOrganizationalUnit

Deletes an organizational unit (OU) from a root or another OU. You must first remove all accounts and child OUs from the OU that you want to delete.

You can only call this operation from the management account.

Samples


fun main() { 
   //sampleStart 
   // The following example shows how to delete an OU. The example assumes that you previously removed all
// accounts and other OUs from the OU
organizationsClient.deleteOrganizationalUnit {
    organizationalUnitId = "ou-examplerootid111-exampleouid111"
} 
   //sampleEnd
}