You can use the below CLI script to loop through the Storage Accounts. This should return the information required.
# Get a list of all storage accounts in the subscription
storage_accounts=$(az storage account list --query "[].{resourceGroup:resourceGroup, name:name}" --output tsv)
# Loop through the storage accounts and run the az security atp storage show command
while read -r resource_group name; do
echo "Storage Account: $name"
az security atp storage show --resource-group "$resource_group" --storage-account "$name"
echo
done <<< "$storage_accounts"
If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.
If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.
Thank you for helping to improve Microsoft Q&A!