Skip to content

Instantly share code, notes, and snippets.

@jespernohr
Created July 29, 2016 10:43
Show Gist options
  • Save jespernohr/1c9090419c336e8f6af0bdecc3bb078a to your computer and use it in GitHub Desktop.
Save jespernohr/1c9090419c336e8f6af0bdecc3bb078a to your computer and use it in GitHub Desktop.
<#
.Synopsis
Get systeminfo on remote computer
.Description
These commands save your administrator credentials in a variable and make use of invoke command to run systeminfo on a remote computer
#>
$cred = Get-Credential
Invoke-Command –ScriptBlock {systeminfo} –ComputerName computer1.contoso.com -Credential $cred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment