Welcome to my journey of continuous discovery. Enjoy your visit.

Ugli Scripting
Ugli Scripting
  • Home
  • Blog
  • .PY
    • Python 2.7 on Windows
    • Python 2.7 on Ubuntu
    • Python 2.7 IDE Set up
    • Run Python Script via CLI
    • Adding Python Packages
    • Basic REST API
  • .PS1
    • Install AD Module Win 10
    • Connecting to MSO and EOP
    • Storing Script Variables
    • Storing Secure Strings
    • Storing User Credentials
    • Basic REST API
  • Sample Integrations
    • Isolate SEP Clients
    • Force Password Change
    • o365 Account Remediation
    • Threat Response Lists
    • Endpoint Scripts
  • SITQ Lab
    • Lab Resources
    • AD Lab Account Imports
    • DLP Sample
  • More
    • Home
    • Blog
    • .PY
      • Python 2.7 on Windows
      • Python 2.7 on Ubuntu
      • Python 2.7 IDE Set up
      • Run Python Script via CLI
      • Adding Python Packages
      • Basic REST API
    • .PS1
      • Install AD Module Win 10
      • Connecting to MSO and EOP
      • Storing Script Variables
      • Storing Secure Strings
      • Storing User Credentials
      • Basic REST API
    • Sample Integrations
      • Isolate SEP Clients
      • Force Password Change
      • o365 Account Remediation
      • Threat Response Lists
      • Endpoint Scripts
    • SITQ Lab
      • Lab Resources
      • AD Lab Account Imports
      • DLP Sample

  • Home
  • Blog
  • .PY
    • Python 2.7 on Windows
    • Python 2.7 on Ubuntu
    • Python 2.7 IDE Set up
    • Run Python Script via CLI
    • Adding Python Packages
    • Basic REST API
  • .PS1
    • Install AD Module Win 10
    • Connecting to MSO and EOP
    • Storing Script Variables
    • Storing Secure Strings
    • Storing User Credentials
    • Basic REST API
  • Sample Integrations
    • Isolate SEP Clients
    • Force Password Change
    • o365 Account Remediation
    • Threat Response Lists
    • Endpoint Scripts
  • SITQ Lab
    • Lab Resources
    • AD Lab Account Imports
    • DLP Sample

Python 2.7 on Windows

Designate a Windows Python Host or Hosts

Just about every current version of Windows can run Python.  Your deployment will likely depend on the Licenses you have available and you primary Active-Directory environment.


I primarily use Windows 10 Workstation because it supports both MS Active-Directory (on premise) and Azure Active-Directory (MS Online).


If you have Windows Home Edition, you can check the MS Online Store to see if you qualify for an upgrade.



On-premise or Azure Active Directory

If you can do both, do both.  If you can only do one, go with Azure AD

Installing Python 2.7 on Windows

DO NOT INSTALL or UPGRADE to Python 3.x  I'm not clear on all the differences, but all my current testing is done on the latest version of 2.x.


Requirements:

-One or more Windows systems 

-The latest version of Python 2.7 from the Python downloads page.


!IMPORTANT! Customize installation to add Python.exe to Path.


With the exception of the above, double-click the downloaded file and install Python with defaults.  If you have any questions, How To Geek has a very detailed Python 2.7 install guide for Windows.

Install Pip for Python on Windows

Pip is a package management system used to install and manage software packages written in Python.  As our Python scripts become more complex we will need to import modules to extend functionality.  Pip will help us with this and It is super easy to install.  


Instructions:

  1. Download the latest copy of get-pip.py.
  2. Open a Windows command prompt 'as Administrator' 
  3. Navigate to the get-pip.py directory.
  4. Run the following command:

           $ python get-pip.py

Use Pip to install Python 'requests' package

Packages extend the functionality of Python.  One package we will use is the Python 'requests' package.


This package adds the ability to make requests application to applications with Rest APIs. With the request you can either GET, POST or DELETE data to-and-from the application.


Instructions:

  1. Open a Windows command prompt 'as Administrator'.
  2. Navigate to Python Install directory (default is c:\Python27\)
  3. Run the following command:

           $ pip install requests

All done!

You now have a platform to run and develop Python scripts.  Now is a good time to choose an IDE (integrated Development Environment)

Check out PyCharm from JetBrains

Copyright © 2018 Ugli Scripting - All Rights Reserved.

  • Blog
  • CV

Powered by GoDaddy