| Crates.io | librust-winrm |
| lib.rs | librust-winrm |
| version | 0.1.1 |
| created_at | 2025-12-05 12:26:32.914386+00 |
| updated_at | 2025-12-05 12:39:53.907376+00 |
| description | WinRM client library for Rust - NTLM authentication, command execution, file transfer |
| homepage | https://github.com/oktay454/librust-winrm |
| repository | https://github.com/oktay454/librust-winrm |
| max_upload_size | |
| id | 1968091 |
| size | 133,226 |
WinRM (Windows Remote Management) client library for Rust.
Add to Cargo.toml:
[dependencies]
librust-winrm = "0.1.0"
use librust_winrm::WinRMClient;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create client
let mut client = WinRMClient::new(
"https://10.0.3.203:5986/wsman",
"administrator",
"password",
"ntlm",
true, // insecure (skip SSL verification)
None, // CA cert path
)?;
// Open shell
let shell_id = client.open_shell()?;
// Run command
let command_id = client.run_command(&shell_id, "whoami")?;
let (stdout, stderr, exit_code) = client.get_command_output(&shell_id, &command_id)?;
println!("Output: {}", stdout);
// Close shell
client.close_shell(&shell_id)?;
Ok(())
}
use librust_winrm::{WinRMClient, upload_file, download_file};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut client = WinRMClient::new(/* ... */)?;
let shell_id = client.open_shell()?;
// Upload
upload_file(&mut client, &shell_id, "local.txt", "C:\\\\remote.txt")?;
// Download
download_file(&mut client, &shell_id, "C:\\\\file.txt", "./local.txt")?;
client.close_shell(&shell_id)?;
Ok(())
}
Full API documentation: docs.rs/librust-winrm
GPL-3.0-or-later
MIT