Solved

Search AD with a command line/sript to list a group and it's "Notes"

Posted on 2014-01-24
7
491 Views
Last Modified: 2014-01-24
Hello,

In our environment, we use the Note's field in AD to store the Owner and Co-Owner information.

I need a command line so that I can get the Note's information out of AD (pertaining to AD groups)
0
Comment
Question by:taartero
7 Comments
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
You might want to take a look at ADFIND, it's a great free tool for getting info out pf AD, lots of options, and output formats, etc.

http://www.joeware.net/freetools/tools/adfind/

~bp
0
 

Author Comment

by:taartero
Comment Utility
See the area in Yellow
temp.png
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
Comment Utility
If you have Windows 2008 R2 or later Domain controller the you can try the following code to get the required details of groups..
Get-ADGroup -Filter * -Properties info | Select Name,info | Export-csv C:\report.csv -nti

Open in new window

0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
With ADFIND, you can try a specific group like this:

adfind -f "&(objectcategory=group)(name=your-group-name)(info=*)" name info

Do you want to extract all groups, or just one or a subset?  Also, what format do you want the output in?

~bp
0
 

Author Closing Comment

by:taartero
Comment Utility
Your command gets the info I was looking for.
I changed it to be like this:
Get-ADGroup -filter * -Properties info | ? {$_.info -ne $null} | Export-Csv "C:\backup\1.csv"

this also gets the info:
Get-ADGroup -filter * -Properties info | ? {$_.info -ne $null} | fl name, info

unfortunately this doesn't since it only gives the 1st row in the Notes section:
Get-ADGroup -filter * -Properties info | ? {$_.info -ne $null} | ft -auto name, info

Before I saw your reply I was looking at this:
https://www.maxpowersoft.com/

looks pretty cool, but spendy
0
 

Author Comment

by:taartero
Comment Utility
of course this is going to lead to my next question:
Powershell allows for Format Table, even with   -auto  for columnwidth

but what about  a way to use   FT      where number of rows is also AUTO
0
 
LVL 5

Expert Comment

by:alicain
Comment Utility
You can add a -wrap onto that to get multiple lines from the info field :
  Get-ADGroup -filter * -Properties info | ? {$_.info -ne $null} | ft -auto -wrap name, info

Regards,
Alastair.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now