Advertisement
Eliel_Sec

PowerShell_listar nome e ipv4 das maquinas

Aug 31st, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##retornar nome e endereço das maquinas ligadas
  2.  
  3. ##lista de computadores desejada.
  4. $computers = Get-Content C:\Users\eliel\Desktop\scritps_powershell\labin_c_pcs.txt
  5.  
  6.  
  7. $resultado = foreach ( $pc in $computers )
  8. {
  9.          Test-Connection $pc -Verbose -ErrorAction Ignore | Sort-Object -Unique
  10.          
  11. }
  12.  
  13.  
  14. $resultado | Format-Table address, IPV4Address -AutoSize | Out-File -FilePath C:\Users\seu_usuario\Desktop\nome_arquivo_de_saida.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement