taartero
asked on
Search AD with a command line/sript to list a group and it's "Notes"
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)
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)
ASKER
See the area in Yellow
temp.png
temp.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
With ADFIND, you can try a specific group like this:
adfind -f "&(objectcategory=group)(n ame=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
adfind -f "&(objectcategory=group)(n
Do you want to extract all groups, or just one or a subset? Also, what format do you want the output in?
~bp
ASKER
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
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
ASKER
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
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
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.
Get-ADGroup -filter * -Properties info | ? {$_.info -ne $null} | ft -auto -wrap name, info
Regards,
Alastair.
http://www.joeware.net/freetools/tools/adfind/
~bp