Python OS.System with variables and quotes
#!/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')
Getting.....
"Example: wmic -U [domain/]adminuser%password //host "select * from
Win32_ComputerSystem" sh: Syntax error: Unterminated quoted string"
If i replace the \\machineName variable with a real IP 192.168.1.100 it
works fine.