Script repository
The script returns $true if home folder of a user is empty. To execute the script, use the If PowerShell script returns true condition in a business rule, custom command or scheduled task configured for the User object type.
$homeFolderPath = "%homeDirectory%"
if ([System.String]::IsNullOrEMpty($homeFolderPath))
{
$Context.ConditionIsMet = $False
return
}
$directoryInfo = Get-ChildItem -Path $homeFolderPath | Measure-Object
$Context.ConditionIsMet = $directoryInfo.Count -eq 0
Comments 0
You must be signed in to comment.