Windows - Deployment

> Operating System - Kernel (Windows, Unix, Linux) > Windows (and utilities)

1 - About

Infra as code. How to connect to a Windows machine and execute deployment script.

3 - List

psexec \\server01 -u domain\user -p P@ssw0rd ipconfig /all 
var processToRun = new[] { "notepad.exe" };
var connection = new ConnectionOptions();
connection.Username = "username";
connection.Password = "password";
var wmiScope = new ManagementScope(String.Format("\\\\{0}\\root\\cimv2", REMOTE_COMPUTER_NAME), connection);
var wmiProcess = new ManagementClass(wmiScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
wmiProcess.InvokeMethod("Create", processToRun);
winexe -A credentials.cfg //remotehost "command arg"
credentials.cfg
username=user
password=pass
domain=workplace
  • Powershell can be used to manage remote computers from a CLI using WMI (Windows Management Instrumentation). PowerShell remoting allows the execution of Powershell scripts and commands on remote computers.
Advertising

4 - Documentation / Reference