Open markkuleinio opened 4 years ago
More information: The Linux is Debian 9 Stretch, and I have installed omi 1.6.0.0:
$ dpkg -l omi
...
ii omi 1.6.0.0 amd64 Open Management Infrastructure
PowerShell Core is installed from Microsoft repo:
$ cat /etc/apt/sources.list.d/microsoft.list
deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main
$ dpkg -l powershell
...
ii powershell 6.2.3-1.debian. amd64 PowerShell is an automation and configuration
Also tested from Windows 10 PowerShell Core, working:
PS C:\Program Files\PowerShell\6> $session = New-PSSession -HostName 10.11.1.11 -UserName administrator
administrator@10.11.1.11's password:
PS C:\Program Files\PowerShell\6> Invoke-Command $session -ScriptBlock { Import-Module -SkipEditionCheck DhcpServer ; Get-DhcpServerv4Scope -ComputerName 10.11.1.10 }
PSComputerName : 10.11.1.11
RunspaceId : 96257596-814f-4c05-8ea6-f7c47e9a9b70
ActivatePolicies : True
Delay : 0
Description :
EndRange : 10.11.1.220
LeaseDuration : 8.00:00:00
MaxBootpClients : 4294967295
Name : 10.11.1.0/24
NapEnable : False
NapProfile :
ScopeId : 10.11.1.0
StartRange : 10.11.1.200
State : Active
SubnetMask : 255.255.255.0
SuperscopeName :
Type : Dhcp
PSComputerName : 10.11.1.11
RunspaceId : 96257596-814f-4c05-8ea6-f7c47e9a9b70
ActivatePolicies : True
Delay : 0
Description :
EndRange : 10.11.2.220
LeaseDuration : 8.00:00:00
MaxBootpClients : 4294967295
Name : 10.11.2.0/24
NapEnable : False
NapProfile :
ScopeId : 10.11.2.0
StartRange : 10.11.2.200
State : Active
SubnetMask : 255.255.255.0
SuperscopeName :
Type : Dhcp
PS C:\Program Files\PowerShell\6>
Hi, I'm not sure if I'm in the correct repo, but I see other somewhat similar keywords here.
I'm trying to command Windows Server 2016 DHCP server with PowerShell Core on Linux. As there is no DhcpServer module for Linux (as I see it, please correct me if I'm wrong), I'm sending the commands from Linux to PowerShell Core on Windows Server 2019 ("middlebox") with Invoke-Command (over SSH, there is OpenSSH server on W2019, installed from Windows features). Thus, the topology is:
PS Core 6.2.3 on Linux (10.11.2.10) -----> PS Core 6.2.3 on W2019 (10.11.1.11) -----> PS 5.1.14393.3053 on W2016 (10.11.1.10) (all firewalls disabled for now, and using the administrator account for now)
The reason for this topology is that we are trying to avoid installing extra non-Microsoft software on the critical DHCP servers, so using the middlebox here is attempted to solve the problem of sending PS commands from Linux.
On Linux I first use:
With Invoke-Command, "general" commands work:
But the problem is when sending the Get-DhcpServerv4Scope command:
So, PS Core on Linux is able to send commands to the W2019 middlebox, but specifically the DHCP server commands cause the error with libmi.so.
The same commands work fine when run on the W2019 middlebox (PS Core):
So, what is this error with libmi.so, and how is that used when sending some commands with Invoke-Command, and not a problem with some other commands?
Thanks for any insight for this.
Markku