Skip to content

Repository files navigation

GLPI PowerShell License

Welcome to GLPI-Scripts 👋

This repo contains 3 scripts and a JSON configuration file that can be connected to Azure, Active Directory and Intune.

🔍Requirements

  • Rights : sudo, Application Administrator for Azure
  • GLPI : Those scripts actually work on GLPI 11.0.5
  • PowerShell : You will need to install PowerShell on your server if it's a Linux server via :
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
sudo apt-get update

sudo apt-get install -y powershell
# To use PowerShell on the shell
pwsh

📄The Conf_Android_GLPI-Agent.json file

This file contains the configuration to GLPI Agent for Android.

This file asks to GLPI Agent to retrieve the right Serial Number of the Phone and add it to GLPI.

The configuration allows to GLPI Agent to start an inventory every day.

The content of this file needs to be added into the configuration of your GLPI APP on Intune.

Don't forget to add a group to push the app and the configuration on Android Devices (it can be the same).

📄The Synchro_Intune_GLPI_Android.ps1 file

This file is "connected" to the previous one.

It compares the phone on GLPI to your phone present in your Intune.

It receives the user on Intune and add it into your GLPI.

Also it modifies the name of the phone on GLPI as modelOfThePhone_de_UserName

This file can be stored wherever you want and can be start with :

pwsh

./Synchro_Intune_GLPI_Android.ps1

📄The Backup_GLPI_DB.sh file

It creates a backup of your database on your server.

Make sure to configure the destination path and database credentials inside the script before running it.

This file can be stored wherever you want and can be start with :

./Backup_GLPI_DB.sh

📄The Setup_GLPI-Agent_1.16.ps1 file

This script is for Windows endpoint.

This file can be added to an Intune Package, which contains the .msi file of the GLPI Agent and the script.

This script scans the endpoint looking for a previous installation of GLPI Agent.

If there is a previous installation it deletes it, installs the new version with the configuration and create a flag to avoid a useless reinstallation.

If there is no previous installation, it install it with the configuration and create a flag to avoid useless reinstallation.

The script can be modified to be adapted to newer version of GLPI Agent.

On your Application Install command, you can use this command :

powershell.exe -ExecutionPolicy Bypass -NoProfile -File .\setup_glpi_agent_<version>.ps1

And this one for Uninstall command :

powershell.exe -ExecutionPolicy Bypass -NoProfile -File .\setup_glpi_agent_1.16.ps1 -UninstallOnly

💡Advices

All of those script can be used with cron to do an automation.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages