Windows - Deployment (Infra as code)

1 - About

Infra as code.

How to connect to a Windows machine and execute deployment script.

3 - List

3.1 - psexec

psexec


psexec \\server01 -u domain\user -p [email protected] ipconfig /all 

3.2 - WMI

WMI.NET or Windows Management Instrumentation ( applications in C#, Microsoft® Visual Basic, or Microsoft J#)


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);

3.3 - WINEXE

https://sourceforge.net/projects/winexe/ (Linux to Windows)


winexe -A credentials.cfg //remotehost "command arg"


username=user
password=pass
domain=workplace

3.4 - Powershell

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.

4 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap