#!/usr/bin/python
import os
readLine = open('desktops.txt','r')
for line in readLine:
machineName = line
query = os.system('wmic -U corp.fakedomain.com/domainusername%password //192.168.1.100 "Select * from Win32_UserAccount Where LocalAccount = True"|grep "500|"|cut -d "\\" -f 2|cut -d "|" -f1')
I am receiving the following error...
myhostname:~# ./getLocalAdminNames.py sh: Syntax error: Unterminated quoted string sh: Syntax error: Unterminated quoted string sh: Syntax error: Unterminated quoted string sh: Syntax error: Unterminated quoted string sh: Syntax error: Unterminated quoted string
Then after I resolve the error I would like to substitute the IP with machineName variable.
Any help would be greatly appreciated.