Admin operations on remote computers using PowerShell
Find Command and Help Command
#Find command
Get-Command -Module ChangeMe
#help Command
Help changeMe
Prior to any engagements ensure Remote Signed Policy is on
Set-ExecutionPolicy RemoteSigned
Enable Remote Incomming Connections
Enable-PSremoting
List the commands that contain session configuration
help *sessionconfiguration*
<# use code below to view the session configs of the PC#>
Get-PSSessionConfiguration
To establish a one-to-one connection to a PC
Enter-PSSession -ComputerName "PC_NAME"
#Make the connection persistent
$sessionOption = New-PSSessionOption -IdleTimeout 86400 # Set an idle timeout of 24 hours (86400 seconds)
$PcConn = New-PSSession –ComputerName 'PC_Here' -SessionOption $sessionOption
#To verify connectivity type the variable name and it will provide the connection session
$PcConn
To exit a session
Exit-PSSession
To run a command on remote computers by means of remoting and executing the command Get-NetAdapter : Note (Change the -ScriptBlock [theCommand you want executed])