This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

meraki_group_policy_device_assignment

Script to dynamically assign group policies to IOS or Android clients.

Contacts

  • Jorge Banegas

Solution Components

Installation/Configuration

  1. Generate a Meraki API Key - https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API#:~:text=Enable%20API%20access,-For%20access%20to&text=After%20enabling%20the%20API%2C%20go,API%20key%20on%20your%20profile.

  2. Create a Webex Teams Bot key - https://developer.webex.com/docs/bots

  3. Create the Webex Teams Room ID - https://developer.webex.com/docs/api/v1/rooms/list-rooms (add the bot to the desired space)

  4. Pull down the project into a python virtual environment

git clone https://github.com/gve-sw/meraki_group_policy_device_assignment.git
  1. Install the required packages
pip install -r requirements.txt
  1. Edit the credentials files to include the api key, room id and the access token for Webex and Meraki
api_key = ""
access_token = ""
room_id = ""
  1. Edit the policy name in which you want to provision for the clients (line 44)
provision_policy = "SmartPhone Group Policy"
  1. Run the main.py script
python app.py

Running this script in a repetitive interval

Visit the link below if you need intructions to run this script in a timed interval (make sure to make edits to select the org id without user input)

https://phoenixnap.com/kb/set-up-cron-job-linux

Screenshots

  • This is a client's page before running the script

alt text

  • Step 1 : Script will ask user to select the organization to provision

alt text

  • Step 2 : Script will look at all the clients (last 24 hrs) and apply the policy to those needed clients

alt text

  • Client's page after running the script

alt text

  • Client's policy page

alt text

  • Webex Message

alt text

LICENSE

Provided under Cisco Sample Code License, for details see LICENSE

CODE_OF_CONDUCT

Our code of conduct is available here

CONTRIBUTING

See our contributing guidelines here

DISCLAIMER:

Please note: This script is meant for demo purposes only. All tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use.
You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.