New Active Directory Documents for IT Pros Printing results from an Active Directory Administrative Center query - Active Directory Documentation Team - Site Home - TechNet Blogs

Active Directory Documentation Team

Information for IT Professionals who work with Active Directory. All blog posts are provided "AS IS" with no warranties, and confer no rights.

Printing results from an Active Directory Administrative Center query

Printing results from an Active Directory Administrative Center query

  • Comments 3
  • Likes

Recently a question was asked on the blog regarding printing queries from Active Directory Administrative Center (ADAC).  There is no native functionality for printing queries performed in ADAC, but there is a workaround.

1.  Open ADAC and create a query:

Global Search query

 

2.  Convert the query to LDAP:

Convert query to LDAP

 

3.  Open the Active Directory module for Windows PowerShell and copy the filter into the Windows PowerShell command window:

Windows PowerShell cmd

You can now print the corresponding text file that contains the results of your query.

Comments
  • I think that's a cool method for getting a better understanding of LDAP query syntax.  The only thing I would add is the use of the 'out-printer' cmdlet if you wanted to just send the output directly to the printer without creating a new text file.

  • PS C:\> import-module activedirectory PS C:\> Get-ADObject -LDAPFilter (&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803: =2)(|(lastLogonTimestamp<=130291128000000000)(!lastlogontimestamp=*))) missing="" expression="" after="" unary="" operator="" '!'.="" at="" line:1="" char:71="" +="" get-adobject="" -ldapfilter="" (&(objectcategory="person)(objectClass=user)(!">< useraccountcontrol:1.2.840.113556.1.4.803="" :=""><=130291128000000000)(!lastlogontimestamp=*))) +="" categoryinfo="" :="" parsererror:="" (!:string)="" [],="" parentcontainserrorrecordexception="" +="" fullyqualifiederrorid="" :="">

  • This is what I get when I try it, see above

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment