python - 有没有办法使用 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,这样我就可以扩展我现有的脚本。
解决方案
推荐阅读
- c++ - 从单键多值容器访问特定值
- regex - 为什么模式匹配在 Scala 中不起作用?
- windows - 如何使USB驱动器只写并阻止读取访问,只执行并阻止读取访问
- excel - 在Excel中将年份数据列转换为时间序列
- regex - 正则表达式以字符替换结尾
- angularjs - 如何生成与 package.json + tsc 命令匹配的 tsconfig.json?
- angular - 在 Storybook 中使用模板字符串中的图像
- python - 如何迭代字符串中的某些字符而其他字符在python中保持在同一位置
- android - 当我选择一张图片并将其显示在按钮上时应用程序崩溃(KOTLIN ON CREATE)
- react-native - 使用 Expo 进行分组通知