For anyone interested, below is the full code I used to do the following workflow:
- find all datasets within enterprise sde
- find only the datasets that have versioning applied
- ignore the dataset if it contains the string 'vegetation'
- unregister the dataset as being versioned
arcpy.env.workspace = r'Database Connections\GISADMIN@SDE_Spatial@SDE-DB.sde'
datasets = arcpy.ListDatasets()
for dataset in datasets:
description = arcpy.Describe(dataset)
if 'vegetation' not in dataset:
if description.isVersioned:
arcpy.UnregisterAsVersioned_management(in_dataset=dataset,
compress_default="COMPRESS_DEFAULT"
)
Thanks again for your help Dan.