Created
March 29, 2019 13:33
-
-
Save vexx32/168243502b61e286b1cc7448b09943b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$LiveCred = Get-Credential | |
$Results = Invoke-Command -ComputerName ComputerA -ScriptBlock { | |
[PSCustomObject]@{ | |
IP = Get-NetIPConfiguration | | |
Where-Object { $_.IPv4DefaultGateway -and $_.NetAdapter.Status -ne "Disconnected" } | | |
ForEach-Object { | |
$_.IPv4Address.IPAddress | |
} | |
LastBoot = (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime | |
} -Credential $LiveCred | |
$IP = $Results.IP | |
$LastBoot = $Results.LastBoot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment