Skip to content

Imports devices to SnipeIT from Microsoft Endpoint/Intune

Notifications You must be signed in to change notification settings

OfficeRat/SnipeIT-Import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SNIPE-IT Import

Description

This project automates the import and update process of device information into a Snipe-IT asset management system using data from an external API. It is designed to run periodically with a cron job, ensuring that the Snipe-IT system stays up-to-date with the latest device information.

Table of Contents

Installation

  1. Clone the repository:
git clone https://github.com/your-username/project-name.git
cd project-name
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Set up the configuration file:
cp .env.example .env

Update the values in the .env file with your specific configurations.

Usage

Run the main script to start the import and update process:

python main.py

The script will fetch device information from microsft graph api, process the data, and update the Snipe-IT asset management system accordingly.

Configuration

Configure the application by modifying the .env file. This file contains environment variables necessary for the proper functioning of the script. Update the following variables:

  • SNIPE_API_KEY: API key for authenticating with the Snipe-IT API.
  • MICROSOFT_CLIENT_ID: Client ID for authenticating with the Microsoft API.
  • MICROSOFT_CLIENT_SECRET: Client secret for authenticating with the Microsoft API.
  • SNIPE_URL: URL of the Snipe-IT instance.
  • SNIPE_API_URL: Snipe-IT API URL.
  • MICROSOFT_URL: Microsoft API URL.
  • SLACK_URL: Slack webhook URL for sending notifications.
  • DEVICE_PREFIX: Prefixes of supported devices, separated by commas.

Cron Job

To set up a cron job for periodic execution, add the following line to your crontab file:

0 0 * * * /path/to/python /path/to/project-name/main.py

This example runs the script every day at midnight. Adjust the timing as needed.

Dependencies

requests: HTTP library for making API requests.
dotenv: Loads environment variables from a file.

About

Imports devices to SnipeIT from Microsoft Endpoint/Intune

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages