![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Re: uploading script results to a csv file You can try Export-Csv: Get-QADGroupMember Get-QADGroupMember 'domain\group name' | Export-Csv -path pathToFilename.csv ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: > Hi guys . > > when i use the powershell to extract the active directory users of a > certain group i use the command > > Get-QADGroupMember Get-QADGroupMember 'domain\group name ' > > my question is how do i upload the results on a csv file (excel > format) from within the script > > is there a line i can add into this script to export it directly to a > csv file ? > > tnx in advance > |
My System Specs![]() |
| | #2 (permalink) |
| | uploading script results to a csv file Hi guys . when i use the powershell to extract the active directory users of a certain group i use the command Get-QADGroupMember Get-QADGroupMember 'domain\group name ' my question is how do i upload the results on a csv file (excel format) from within the script is there a line i can add into this script to export it directly to a csv file ? tnx in advance |
My System Specs![]() |
| | #3 (permalink) |
| | Re: uploading script results to a csv file Hey don5, my guess (without having tested it) would be: Get-QADGroupMember 'domain\group name ' | Export-CSV 'c:\test\adusers.csv' Best Regards, Jacob Saaby Nielsen mailto:jacob.saaby@xxxxxx Quote: > Hi guys . > > when i use the powershell to extract the active directory users of a > certain group i use the command > > Get-QADGroupMember Get-QADGroupMember 'domain\group name ' > > my question is how do i upload the results on a csv file (excel > format) from within the script > > is there a line i can add into this script to export it directly to a > csv file ? > > tnx in advance > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: uploading script results to a csv file Hey don5, oh yeah - I forgot the -path parameter, so use Shay's example instead ![]() Best Regards, Jacob Saaby Nielsen http://www.pipforhelvede.net jacob DOT saaby AT gmail (same at hotmail for IM) Quote: > You can try Export-Csv: > > Get-QADGroupMember Get-QADGroupMember 'domain\group name' | Export-Csv > -path pathToFilename.csv > > ----- > Shay Levi > $cript Fanatic > http://scriptolog.blogspot.com > Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: >> Hi guys . >> >> when i use the powershell to extract the active directory users of a >> certain group i use the command >> >> Get-QADGroupMember Get-QADGroupMember 'domain\group name ' >> >> my question is how do i upload the results on a csv file (excel >> format) from within the script >> >> is there a line i can add into this script to export it directly to a >> csv file ? >> >> tnx in advance >> |
My System Specs![]() |
| | #5 (permalink) |
| | RE: uploading script results to a csv file hi shay , i tried the "export-csv" and the problem is that i get a list of numbers in the csv file rather then the names that were supposed to be . what i used was like this : function get-members{ param($groupName) Get-QADGroupMember -Identity $groupName | foreach { if($_.type -eq "user") {$_.name} elseif($_.type -eq "group") {$_.name; get-members -groupName $_.CanonicalName} } } get-members "rwn\Retalix Raanana (Tia)" |export-csv c:\msh\users.csv "don5" wrote: Quote: > Hi guys . > > when i use the powershell to extract the active directory users of a certain > group i use the command > > Get-QADGroupMember Get-QADGroupMember 'domain\group name ' > > my question is how do i upload the results on a csv file (excel format) from > within the script > > is there a line i can add into this script to export it directly to a csv > file ? > > tnx in advance |
My System Specs![]() |
| | #6 (permalink) |
| | RE: uploading script results to a csv file OK Raanana ;-) For some reason, still need to figure out why, the output numbers you see are the length of each name.. To overcome it, use a calculated property (on select-string) to rebuild the name column: # the full syntax is @{name="stringName";expression={<expression>}} # it can be shortend to @{n="...";e={...}} # the -NoTypeInformation Omits the #TYPE header from the CSV file get-members "rwn\Retalix Raanana (Tia)" | select @{n="name";e={$_}} | Export-Csv ..\users.csv -NoTypeInformation In addition, be aware that nested groups can cause your script to (e.g group A contains group B contains group C contains group A) as Kirk warned. ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: > hi shay , i tried the "export-csv" and the problem is that i get a > list of numbers in the csv file rather then the names that were > supposed to be . what i used was like this : > > function get-members{ param($groupName) > > Get-QADGroupMember -Identity $groupName | foreach { if($_.type -eq > "user") {$_.name} elseif($_.type -eq "group") {$_.name; get-members > -groupName $_.CanonicalName} > > } } > > get-members "rwn\Retalix Raanana (Tia)" |export-csv c:\msh\users.csv > > "don5" wrote: > Quote: >> Hi guys . >> >> when i use the powershell to extract the active directory users of a >> certain group i use the command >> >> Get-QADGroupMember Get-QADGroupMember 'domain\group name ' >> >> my question is how do i upload the results on a csv file (excel >> format) from within the script >> >> is there a line i can add into this script to export it directly to a >> csv file ? >> >> tnx in advance >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Export results of script with cmd command to csv | PowerShell | |||
| Echo results of script to file | PowerShell | |||
| exporting results/text of powershell script to a file as it is run | PowerShell | |||
| Re: checking for results when executing a script | PowerShell | |||
| Need help in uploading audio file to WMM/legitimately purchased mu | Vista music pictures video | |||