Member of local administrators group from multiple servers in csv
team,
i found script:
-------------
invoke-command {
$members = net localgroup administrators |
where {$_ -and $_ -notmatch "command completed successfully"} |
select -skip 4
new-object psobject -property @{
computername = $env:computername
group = "administrators"
members=$members
}
} -computer chi-fp01,chi-win8-01,chi-ex01 -hidecomputername |
select * -excludeproperty runspaceid
---------
question - above computer name inserted manually, got 1000+ servers copied in csv, have command modified call csv file input -computer variable.
thanks
inderjit
try one:
https://gallery.technet.microsoft.com/scriptcenter/gather-local-group-0d0a85ad
call this:
$servers = get-content servers.lst $path = "c:\temp\serverlst_output.csv" get-remotegroupmembership -computername $servers | export-csv -path $path -notypeinformation
Windows Server > Windows PowerShell
Comments
Post a Comment