Python OS.System with variables and quotes -
#!/usr/bin/python import os readline = open('desktops.txt','r') line in readline: machinename = line query = os.system(r'wmic -u corp.fakedomain.com/domainusername%password //'+machinename+ '"select * win32_useraccount localaccount = true"|grep "500|"|cut -d "\\" -f 2|cut -d "|" -f1')
getting.....
"example: wmic -u [domain/]adminuser%password //host "select * win32_computersystem" sh: syntax error: unterminated quoted string"
if replace \\machinename variable real ip 192.168.1.100 works fine.
Comments
Post a Comment