I made a simple batch file to get a list of machines belonging to
certain groups, save it to a file then open it in Excel.
See below:
dsget group "cn=AdobeAcrobat9,ou=*,ou=Groups,ou=*,DC=*,DC=*" -members -
expand | sort > "c:\documents and settings\%username%\desktop
\spreadsheetname.xls
start excel.exe "c:\documents and settings\%username%\desktop
\spreadsheetname.xls
It works but the output is ugly with it displaying a bunch of info
about the path that to the OU that I don't need to look at, and, at
the same time, there is a bit more info I want that I can't get it to
display.
It has the following problems.
1. Excel fails to seperate the OU info into seperate cells despite
the info being seperated by commas. (I'd like to solve this comma
seperation or just not show this info).
2. I need to get the "description" field of the computers, but when I
try to add "desc" to dsget it gives the description field of the
AdobeAcrobat9 group instead the description field of each of the
members of the group.
3. I really don't need it to display all the OU info. All I'd like
it do is save a list of the machine names that belong to the
AdobeAcrobat9 group in a format Excel can display elegantly and in
alphabetical order. The description field of each of the member
computers should be displayed in the same row as the computer name.
How can this be done?
Can it be done with a simple bat file or does it have to be a vbs
script?