获取运行的服务

Get-Service -computername $i beisen* | where {$_.Status -eq "Running"}|select-object name

get-wmiobject -computername $i -class win32_networkadapterconfiguration -Filter IPEnalbled=true -computername . |select-object -Property IPaddress

获取IP地址

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Format-Table -Property IPAddress

 

获取IIS站点

Import-Module WebAdministration
iis:\
get-childitem iis:\sites | where {$_.State -eq "Started"} |select-object name

获取计算机名

Get-WmiObject -computername -Class Win32_ComputerSystem |select-object name

远程执行脚本
invoke-command -computername machine1, machine2 -filepath c:/Script/script.ps1