Q:

grep output of command and display all lines that match a string

I'm trying to display all disabled accounts from the command:
ipa user-find --all

The basic output of the command shows something like this:
dn: uid=johnd,cn=users,cn=accounts,dc=mydomain,dc=com
User login: johnd
First Name: John
Last Name: Doe
Full Name: John Doe
Home directory: /home/johnd
GECOS field: John Doe
Login shell: /bin/bash
Kerberos principal: johnd@DOMAIN.COM
Email address: johnd@domain.com
UID: 501
GID: 1022
Account disabled: True
Password: True
Member of groups: ipausers
Kerberos keys available: False
ipauniqueid: 75732ha-482x82l-13xa-d820-0120xbba142
objectclass: ipaobject, krbticketpolicyaux, etc. 

If I run:
ipa user-find --all | grep "Account disabled: True"

I will get:
  Account disabled: True
  Account disabled: True
  Account disabled: True
  Account disabled: True

For all disabled accounts.   Is there a way I can have it display all the fields that match "Account disabled: True"?  

A:

And an awk solution that doesn't depend on order and/or presence of all attributes [and given my knowledge of ldif I'll safely assume that DN: is always on the first line]:
awk 'BEGIN{RS="\n\n";FS="\n"}/Account disabled: True/{print $1}'

