PSScripts/Monitor-ADRecycleBin.ps1

7 lines
267 B
PowerShell
Raw Permalink Normal View History

2023-12-18 18:01:36 +00:00
# Monitors whether Active Directory Recycle bin feature is active
$Recycler = Get-ADOptionalFeature -Filter 'name -like "Recycle Bin Feature"'
if(!$Recycler.EnabledScopes){Write-Host "Active Directory Recycle Bin is not enabled"; exit 1}
else{Write-Host "Healthy"}