Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • I appreciate your suggestion however The file does output to a csv file, just not in the format I would like it. You suggestion above runs but provides no CSV output which is a requirement. Commented Aug 5, 2013 at 19:29
  • @user2654059 Now it does. Commented Aug 5, 2013 at 20:27
  • the output file is 9 lines ling with a comma in each line, no other data. #Export data out and give feedback #--------------------------------------------------------------------------------------------------------- Get-Admins | group { $_.Computer } | % { '{0},{1}' -f @($_.Group.Computer)[0], ($_.Group.AdminGroupMembers -join ',') } | Out-File 'c:\scripts\adm.csv' Write-Host "`n Script completed for online systems" Commented Aug 5, 2013 at 21:04
  • It seems you're still using PowerShell v2. See updated answer. Commented Aug 5, 2013 at 21:24
  • Updated the powershell to ver 3. Pre last edit change produced a 9 line list with the computer name and a comma but no admin names. Incorporating the latest changes I get this error 43 times: At C:\Scripts\test.ps1:44 char:27 + $admins = ($_.Group | select -Expand AdminGroupMembers) -join ',' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (System.Object:PSObject) [Select-Object], PSArgumentException + FullyQualifiedErrorId : ExpandPropertyNotFound,Microsoft.PowerShell.Commands.SelectObjectCommand Commented Aug 5, 2013 at 22:36