Solved

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

Posted on 2014-01-24
7
494 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 53

Expert Comment

by:Bill Prew
ID: 39807155
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
ID: 39807157
See the area in Yellow
temp.png
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39807165
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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 53

Expert Comment

by:Bill Prew
ID: 39807224
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
ID: 39807394
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
ID: 39807406
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
ID: 39807974
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
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 …

828 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