0
#!/usr/bin/python
import os

readLine = open('desktops.txt','r')

for line in readLine:
       machineName = line
       query = os.system(r'wmic -U corp.fakedomain.com/domainusername%password //'+machineName+ '"Select * from Win32_UserAccount Where LocalAccount = True"|grep "500|"|cut -d "\\" -f 2|cut -d "|" -f1')

得到......

"示例:wmic -U [domain/]adminuser%password //host "select * from Win32_ComputerSystem" sh: 语法错误:未终止的引号字符串"

如果我用真实 IP 192.168.1.100 替换 \\machineName 变量,它工作正常。

4

0 回答 0