Giter VIP home page Giter VIP logo

wmiexec's Introduction

WmiExec.ps1

Remote execution tools for Windows that rely only on WMI and PowerShell.

Execute console commands remotely and capture stdout/stderr streams without relying on PowerShell Remoting, WinRM or PsExec.

Examples

Blog post and video about this technique.

The example below shows you how WmiExec can accept the command string as a value from the pipeline.

PS C:\ "Get-ChildItem C:\" | .\WmiExec.ps1 -ComputerName "server1"
Running the following command on: server1...
Get-ChildItem C:\
PID: 5580 - Waiting for remote command to finish...
PID: 5580 - Waiting for remote command to finish...
Result...


    Directory: C:\


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       28.06.2018     15:16                PerfLogs
d-r---       09.09.2019     15:19                Program Files
d-r---       07.10.2019     08:36                Program Files (x86)
d-r---       10.10.2019     10:51                Users
d-----       10.10.2019     16:00                Windows

The example below shows you the object type that is returned.

PS C:\ $result = .\WmiExec.ps1 -ComputerName "server1" -Command "Get-ChildItem C:\"
Running the following command on: server1...
Get-ChildItem C:\
PID: 5580 - Waiting for remote command to finish...
PID: 5580 - Waiting for remote command to finish...
Result...
PS C:\ $result.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     String                                   System.Object

Twitter https://twitter.com/OneScripter

Do even more cool stuff like create web GUIs for your PowerShell scripts that leverage RBAC, using System Frontier. https://systemfrontier.com/powershell

wmiexec's People

Contributors

onescripter avatar codaamok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.