Here I go with another post on PowerShell. This time, I would like to share a PowerShell command that will help you to export list of users of
particular AD (Active Directory) group to a CSV file.
Run PowerShell and type following commands:
# This will import ActiveDirectory module
Import-Module ActiveDirectory
# This
command will export list of users from GroupName to a CSV file
Get-ADGroupMember -Identity "GroupName"
-server "TestDomain"
-recursive |
get-aduser -Properties
mail |select name,samaccountname
|export-csv
-path c:\Script\report.csv
-NoTypeInformation
In above command, replace GroupName with the Group you want to retrieve members
list. Type your domain name in place of TestDomain. Once you run above command, it will create a
CSV file “Report.CSV” and save it in C:\Script folder.
I hope you find this post very useful.
Disclaimer:
www.TechieTalks.co.uk does not conceal the possibility of error and
shortcomings due to human or technical factors. www.TechieTalks.co.uk does not
bear responsibility upon any loss or damage arising from conduct or activities
related to the use of data and information contained in this blog.
Import-Module ActiveDirectory doesn't work on my CPU. I just get a read text message.
ReplyDeleteCan you please send us error message?
ReplyDeleteHi. I have a problem similar to this. I need to extract data from an old microfisch system. Is there a shellvpower script that will allow me to pull the data from the acetate and save in windows?
ReplyDeleteHi,
ReplyDeleteTo assist further, can you please provide us more info on your current setup?
Regards,
TechieTalks team
yes its a microfisch system that i need to extract the data from the 5.5 acetate.
DeleteHow can i upload this CSV style sheet onto my html website?
ReplyDeleteThanks,
Geoff
Hi,
DeleteYou can export output to HTML file directly instead of CSV file. Use command ConvertTo-HTML instead of Export-CSV.
Delete Export-CSV -path c:\Script\report.csv -NoTypeInformation
Replace above line with ConvertTo-HTMl | Out-File c:\Script\report.html
Regards,
TechieTalks Team
Hi TechieTalks Team,
DeleteThanks for the fast reply.
I don't understand sorry. I want to put a CSV style sheet onto my website.
I went on internet and it said a CSV (Cascading Style Sheets) will let me alter the colors and fonts of my website.
Thanks friend,
Geoff
http://www.convertcsv.com/csv-to-html.htm
DeleteDear Sir/Madam, Glad to send you this business letter, I found you need RFID/NFC card after check your company webpage. Waiting for your kind inquiry! Best regards!
ReplyDelete