首页 > 解决方案 > 有没有办法使用 Python 而不是 Powershell 查询 Windows Server DHCP?

问题描述

原因是我在 Linux 上运行了一个 Python 脚本,它需要访问我们在 Windows 服务器上的 DHCP。我知道我可以通过以下命令使用 Powersell 来做到这一点:

Get-DhcpServerv4Lease -ComputerName WinServer -ScopeId 192.168.0.0 | Select-Object -Property ClientID, HostName, IPAddress

但我更喜欢在 Linux 上使用 Python,这样我就可以扩展我现有的脚本。

标签: pythonlinuxpowershellactive-directorydhcp

解决方案


推荐阅读