Untested, but this should give you ideas on how to go about things...
Dim cons As String = args.ConfirmationRuleArgs.DataUnitText.ConsName
Dim entity As String = args.ConfirmationRuleArgs.DataUnitText.EntityName
Dim scenario As String = args.ConfirmationRuleArgs.DataUnitText.ScenarioName
Dim time As String = args.ConfirmationRuleArgs.DataUnitText.TimeName
Dim cube As String = args.ConfirmationRuleArgs.DataUnitText.CubeName
' we get the dataunit, remove zero and nodata, and then filter it
Dim dbf As DataBuffer = api.Data.GetDataBufferUsingFormula( _
$"FilterMembers(RemoveZero(Cb#{cube}:S#{scenario}:E#{entity}:C#{cons}:T#{time}), " & _
"A#AllAccounts.Descendants.Where(Name StartsWith A), " & _
"U3#00)" )
' hashset are basically lists that just ignore duplicates
Dim badAccounts As New HashSet(Of String)
For Each dbCell As DataBufferCell In dbf.DataBufferCells.Values
' this check is somewhat redundant, also ignoring negatives...
If dbCell.CellAmount > 0 Then
badAccounts.Add(dbCell.GetAccountName(api))
End If
Next
If badAccounts.Count > 0 Then
args.ConfirmationRuleArgs.Info1 = String.Join(", ", badAccounts)
Return False
End If
Return True