from Libraries.computer_lists import build_pos_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt
from os import system
from os.path import exists

if __name__ == "__main__":

    username, password = user_pass_prompt()

    output_file = open('delete_results.txt', 'w+')
    file_name_to_delete = '"POS Manual.pdf.lnk"'
    for comp in build_pos_list():
        create_key_results, err = Popen_background('cmdkey /add:' + comp +
                                                   ' /user:'******' /password:'******'\\\\' + comp +
                   '\\c$\\Users\\Public\\Desktop\\POS Manual.pdf.lnk')):
            print 'file found'
            delete_result, err = Popen_background(
                'del \\\\' + comp +
                '\\c$\\Users\\Public\\Desktop\\"POS Manual.pdf.lnk"')
            delete_result = 'deleted'
        else:
            delete_result = ''

        output_file.write(comp + ' = ' + delete_result + '\n')

        print comp + ' = ' + delete_result

    output_file.close()
from os.path import exists
from os import makedirs
from os import system

if __name__ == "__main__":

    username, password = user_pass_prompt()

    output_file = open('copy_results.txt', 'w+')
    for comp in build_hq01_comp_list():
        archive_path = '\\\\xxxxxxx' + comp + '\\'
        source_path = '\\\\' + comp + 'xxxxxx'
        comp_c_directory = '\\\\' + comp + '\\c$'

        create_key_results, err = Popen_background('cmdkey /add:' + comp +
                                                   ' /user:'******' /password:'******'xcopy /s /y ' + source_path +
                                                '* ' + archive_path)
            output_file.write(comp + ' = ' + copy_result + '\n')
            print comp + ' = ' + copy_result
        else:
            output_file.write(comp + ' = computer off \n')
            print comp + ' = computer off'

    output_file.close()
Exemplo n.º 3
0
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt
from os import system

if __name__ == '__main__':
    username, password = user_pass_prompt()

    for comp in build_stores_list():
        arch_results, err = Popen_background('wmic /node:' + comp + ' /user:'******' /password:'******' os get osarchitecture')
        os_results, err = Popen_background('wmic /node:' + comp + ' /user:'******' /password:'******' os get name')
        print comp
        print '-------------------'
        try :
            if 'Microsoft Windows 7' in str(filter(None, os_results.splitlines())[1]):
                if str(filter(None, arch_results.splitlines())[1]).strip() == '32-bit':
                    print str(filter(None, arch_results.splitlines())[1]).strip()
                    mkdir_results, err = Popen_background('..\\..\\Libraries\\PSTools\\psexec -s \\\\' + comp + ' mkdir C:\\KB4012212\\')
                    print mkdir_results
                    xcopy_results, err = Popen_background('xcopy /-y /d "xxxxxx\\windows6.1-kb4012212-x86_6bb04d3971bb58ae4bac44219e7169812914df3f.msu" \\\\' + comp + '\\c$\\KB4012212\\')
                    print xcopy_results
                    extract_results, err = Popen_background('..\\..\\Libraries\\PSTools\\psexec -s \\\\' + comp + ' wusa.exe C:\\KB4012212\\windows6.1-kb4012212-x86_6bb04d3971bb58ae4bac44219e7169812914df3f.msu /extract:C:\\KB4012212\\')
                    print extract_results
                    install_results, err = Popen_background('..\\..\\Libraries\\PSTools\\psexec -s \\\\' + comp + ' dism.exe /online /add-package /PackagePath:C:\\KB4012212\\KB4012212.cab')
                    print install_results
                    print '\n\n'
                elif str(filter(None, arch_results.splitlines())[1]).strip() == '64-bit':
                    print str(filter(None, arch_results.splitlines())[1]).strip()
                    mkdir_results, err = Popen_background('..\\..\\Libraries\\PSTools\\psexec -s \\\\' + comp + ' mkdir C:\\KB4012212\\')
                    print mkdir_results
                    xcopy_results, err = Popen_background('xcopy /-y /d "\\\\ctc-hq-fs01\\it\\INSTALL\\Microsoft\\KB4012212\\windows6.1-kb4012212-x64_2decefaa02e2058dcd965702509a992d8c4e92b3.msu" \\\\' + comp + '\\c$\\KB4012212\\')
if __name__ == "__main__":

    username, password = user_pass_prompt()

    output_file = open('copy_results.txt', 'w+')

    remote_dest1 = 'xxxxxx'
    remote_dest2 = 'xxxxxx'
    remote_dest3 = 'xxxxxx'
    remote_dest4 = 'xxxxxx'

    for comp in build_pos_list() + build_buy_list():

        create_key_results, err = Popen_background('cmdkey /add:' + comp +
                                                   ' /user:'******' /password:'******''

        if exists('\\\\' + comp + remote_dest1):
            copy_result, err = Popen_background(
                'xcopy /k /i /y registrymodifications.xcu \\\\' + comp +
                remote_dest1)
        elif exists('\\\\' + comp + remote_dest2):
            copy_result, err = Popen_background(
                'xcopy /k /i /y registrymodifications.xcu \\\\' + comp +
                remote_dest2)
        elif exists('\\\\' + comp + remote_dest3):
            copy_result, err = Popen_background(
                'xcopy /k /i /y registrymodifications.xcu \\\\' + comp +
                remote_dest3)
from Libraries.computer_lists import build_mgr_list
from Libraries.Popen_background import Popen_background

if __name__ == "__main__":

    output_file = open('copy_results.txt', 'w+')
    for comp in build_mgr_list():
        copy_result, err = Popen_background(
            'xcopy /k /i /y "Troubleshooting Store Internet.pdf" \\\\' + comp +
            '\c$\Users\Public\Desktop')
        output_file.write(comp + ' = ' + copy_result + '\n')
        print comp + ' = ' + copy_result

    output_file.close()
def chunks(list, n):
    #Yield successive n-sized chunks from l.
    for i in range(0, len(list), n):
        yield list[i:i + n]


if __name__ == '__main__':
    KB_ID = 'xxxxxx'
    OS_ARCH_DATA_INDEX = 1
    
    username, password = user_pass_prompt()
    output_file = open('check_for_certain_update.txt', 'w+')
    leftovers_file = open('leftovers_file.txt', 'w+')
    
    for comp in build_stores_list():
        arch_results, err = Popen_background('wmic /node:' + comp + ' /user:'******' /password:'******' os get osarchitecture')
        os_results, err = Popen_background('wmic /node:' + comp + ' /user:'******' /password:'******' os get name')
        wuauclt_results, err = Popen_background('wmic /node:' + comp + ' /user:'******' /password: '******' qfe where "HotfixID = \'' + KB_ID + '\'" get HotfixID,InstalledOn')

        output_file.write(comp + '\n' + '--------------------------' + '\n')
        print comp + '\n' + '--------------------------' + '\n'
        
        if arch_results.strip() != '':
            arch_results = str(filter(None, arch_results.splitlines())[OS_ARCH_DATA_INDEX]).strip()
            output_file.write(arch_results + '\n')
            print arch_results
        else:
            print 'Could not gather arch number' + '\n'
        if os_results.strip() != '':
            os_results = str(filter(None, os_results.splitlines())[OS_ARCH_DATA_INDEX][:len('Microsoft Windows ##')].strip())
            output_file.write(os_results + '\n')
Exemplo n.º 7
0
from Libraries.computer_lists import build_computer_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt


CHARS_IN_SERIAL_NUM = 7
LEN_INIT_TEXT = len('SerialNumber    ')


if __name__ == "__main__":
    username, password = user_pass_prompt()
    
    output_file = open('serial_numbers_stores.txt', 'w+')
    for comp in build_computer_list():
        serial_num, err = Popen_background('wmic /user:"******" /password:'******' /node:"' + comp + '" bios get serialnumber')
        output_file.write(comp + ' =' + serial_num[LEN_INIT_TEXT : LEN_INIT_TEXT + CHARS_IN_SERIAL_NUM] + '\n\n')
        print comp + ' =' + serial_num[LEN_INIT_TEXT : LEN_INIT_TEXT + CHARS_IN_SERIAL_NUM] + '\n\n'

    output_file.close()
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background
from os import system

if __name__ == '__main__':
    for comp in build_stores_list():
        remote_wuauclt_results, err = Popen_background(
            '..\\..\\Libraries\\PSTools\\psexec \\\\' + comp +
            ' -s reg query "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\Results\\Detect" -v LastSuccessTime'
        )
        print comp + '\n' + remote_wuauclt_results + '\n'
        system('pause')
Exemplo n.º 9
0
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background
from os import system

if __name__ == '__main__':
    for comp in build_stores_list():
        remote_wuauclt_results, err = Popen_background(
            '..\..\Libraries\PSTools\psexec \\' + comp +
            '-s reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install" -v LastSuccessTime'
        )
        print comp + '\n' + remote_wuauclt_results + '\n'
        system('pause')
Exemplo n.º 10
0
from Libraries.computer_lists import build_computer_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt
from os import system

if __name__ == "__main__":

    username, password = user_pass_prompt()

    output_file = open('copy_results.txt', 'w+')

    for comp in build_computer_list():
        create_key_results, err = Popen_background('cmdkey /add:' + comp +
                                                   ' /user:'******' /password:'******'xcopy /k /i /y "Support Ticket Form.url" \\\\' + comp +
            '\c$\Users\Public\Desktop')
        output_file.write(comp + ' = ' + copy_result + '\n')

        print comp + ' = ' + copy_result

    output_file.close()

    system('pause')
from Libraries.computer_lists import build_pos_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt
from os import system

if __name__ == "__main__":

    username, password = user_pass_prompt()

    output_file = open('copy_results.txt', 'w+')

    for comp in build_pos_list():
        create_key_results, err = Popen_background('cmdkey /add:' + comp +
                                                   ' /user:'******' /password:'******'xcopy /k /i /y "Pay Out & Pay-In Categories.pdf.lnk" \\\\' +
            comp + '\c$\Users\Public\Desktop')
        output_file.write(comp + ' = ' + copy_result + '\n')

        print comp + ' = ' + copy_result

    output_file.close()

    system('pause')
Exemplo n.º 12
0
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background

if __name__ == '__main__':
    for comp in build_stores_list():
        install_winrm_results, err = Popen_background(
            '..\\..\\Libraries\\PSTools\\psexec \\\\' + comp +
            ' -s "C:\\Windows\\System32\\winrm.cmd quickconfig -q"')
        print comp
        print '-------------------'
        print install_winrm_results
Exemplo n.º 13
0
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background
from os import system

if __name__ == '__main__':
    output_file = open('check_enabled_winrm.txt', 'w+')

    for comp in build_stores_list():
        check_enabled_winrm, err = Popen_background('winrs -r:' + comp +
                                                    ' hostname')
        if check_enabled_winrm.strip() == comp:
            output_file.write(comp + '\tenabled\n')
            print comp + '\tenabled'
        else:
            output_file.write(comp + '\tdisabled\n')
            print comp + '\tdisabled\n'

    output_file.close()
    system('pause')
Exemplo n.º 14
0
from Libraries.computer_lists import build_computer_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt

LEN_EXTRA_SPACE = 8
LEN_INIT_TEXT = len('Name          ')

if __name__ == "__main__":
    username, password = user_pass_prompt()
    output_file = open('comp_models_stores.txt', 'w+')

    for comp in build_computer_list():
        serial_num, err = Popen_background('wmic /user:"******" /password:'******' /node:"' + comp +
                                           '" csproduct get name')
        output_file.write(comp + ' =' +
                          serial_num[LEN_INIT_TEXT:-LEN_EXTRA_SPACE] + '\n\n')
        print comp + ' =' + serial_num[LEN_INIT_TEXT:-LEN_EXTRA_SPACE] + '\n\n'

    output_file.close()
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt
from os import system
import csv
import sys

if __name__ == "__main__":
    username, password = user_pass_prompt()

    output_file = open('adobe_reader_installed.txt', 'w+')
    for comp in build_stores_list():
        software_list, err = Popen_background('wmic /user: "******" /password:"******" /node:"' + comp +
                                              '" product get name')
        adobe_reader_index = software_list.find('Adobe Reader XI')

        if adobe_reader_index != -1:
            reader_installed = software_list[
                adobe_reader_index:adobe_reader_index + len('Adobe Reader XI')]
        else:
            reader_installed = None

        output_file.write(comp + ' = ' + str(reader_installed) + '\n')
        print comp + ' = ' + str(reader_installed)

    output_file.close()
    system('pause')
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt

if __name__ == "__main__":
    username, password = user_pass_prompt()

    output_file = open('disable_balloon_tips.txt', 'w+')
    for comp in build_stores_list():
        disable_results, err = Popen_background(
            'winrs -r:"' + comp + '" -u:' + username + ' -p:' + password +
            ' reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v EnableBalloonTips /t REG_DWORD /d 0'
        )
        output_file.write(comp + '\n----------------\n' + disable_results +
                          '\n\n')
        print comp + '\n----------------\n' + disable_results + '\n\n'
from Libraries.computer_lists import build_stores_list
from Libraries.Popen_background import Popen_background
from os import system

if __name__ == '__main__':
    for comp in build_stores_list():
        remote_wuauclt_results, err = Popen_background(
            '"C:\Users\khall\Documents\Automation Scripts\Libraries\PSTools\psexec" \\'
            + comp + '-s wuauclt.exe /updatenow')
    system('pause')
Exemplo n.º 18
0
from Libraries.computer_lists import build_computer_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt
from os import system, remove
from os.path import exists

if __name__ == "__main__":

    username, password = user_pass_prompt()

    output_file = open('results.txt', 'w+')

    for comp in build_computer_list():
        create_key_results, err = Popen_background('cmdkey /add:' + comp +
                                                   ' /user:'******' /password:'******'\\\\' + comp + '\\c$\\Users\\Public\\Desktop\\Support Ticket Form.url'
        if exists('\\\\' + comp + '\\c$'):
            if exists(file_path):
                print comp + ' File Exists, removed'
                remove(file_path)
                output_file.write(comp + ' File Exists, removed')
            else:
                print comp + ' No File Exists'
                output_file.write(comp + ' File Does Not Exist')
        else:
            print comp + ' Cant connect'
            output_file.write(comp + ' Cant connect')

    output_file.close()
from Libraries.computer_lists import build_mgr_list
from Libraries.Popen_background import Popen_background
from Libraries.user_pass_prompt import user_pass_prompt
import csv
import sys

if __name__ == "__main__":
    username, password = user_pass_prompt()

    output_file = open('ms_office_versions.txt', 'w+')
    for comp in build_mgr_list():
        software_list, err = Popen_background('wmic /user: "******" /password:"******" /node:"' + comp +
                                              '" product get name')
        ms_ver_index = software_list.find('Microsoft Office Standard')
        if ms_ver_index != -1:
            office_version = software_list[ms_ver_index:ms_ver_index +
                                           len('Microsoft Office Standard xxxx'
                                               )]
        else:
            office_version = None
        output_file.write(comp + ' = ' + str(office_version) + '\n')
        print comp + ' = ' + str(office_version)

    output_file.close()