I have some PowerShell scripts, which remotely collect some info form Windows machines via WMI and then return result in JSON format. Now, for these goal i have windows machine, which has all my scripts on it and has remote access to all my windows machines. All machines are domain machines. The goal is to move the functionality of PowerShell script execution to some linux OS based machine (Debian in prefer). Some example of PowerShell code:
$User = "User"
$Password = "VerySecurePassword"
$Computer = "192.168.0.101"
$s_password = $password | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($user, $s_password)
get-wmiobject Win32_Product -Computer $Computer -Credential $Cred | Sort Name
I saw some PowerShell stuff for Linux, but remote WMI calls is not working for them. I see a workaround to use Ansible for send scripts to machines and execute it localy, but Ansible needs WinRM support, which need to be set up on each of Windows machine firstly. What is the best practice for these stuff? Python solution in prefer
help about_Remote,help about_Remote_Requirements