Skip to content

th3d00rw4y/PSGestioIP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

About The Project

The idea began when I was introduced to my companys IPAM, which was GestióIP. I quickly realized this would be a perfect chance to try and create something that would eliminate tiresome efforts to manually enter new information into the system. PSGestioIP took shape.

Built With

Getting Started

You will need to manually edit the settings file under .\Settings with your information. The module will keep refering to the settings file when reloaded.

Prerequisites

  • Powershell 5.1
  • Licensed version of GestióIP to get access to the API.
  • At least version 3.5.48 of the Gestió API

Installation

  1. Clone the repo
git clone https://github.com/th3d00rw4y/PSGestioIP.git
  1. Edit the settings file with your information.

  2. Upon first import of the module, you will be prompted to supply a password for the GestióIP user you provided in the settings.csv. This password will be stored in $env:TEMP as a encrypted secure string only readable by the user who created it and only on the machine it was executed on.

Changelog

PSGestioIP is currently only maintained by me. I will try to add as many features as possible.

  • 0.0.6 -2021.04.07
    • Rewrote most of the public functions to work better.
    • Added support to be able to retrieve the network category list from GestióIP API in Sync-GestioCategory and Get-DynamicParameter
      • Thank you Marc Uebel for updating the API in like 15 minutes after I asked the question! 😊
    • Changed name on:
      • Get-GestioSettings -> Get-GestioCategory
      • Sync-GestioSettings -> Sync-GestioCategory
    • Wrote help sections for all functions.
  • 0.0.5 - 2021.04.06
    • Added support for dynamic parameters to be able to use validation sets based on settings files.
    • Reworked how categories and sites settings will be handled.
    • New public functions:
      • Sync-GestioSettings.
        • Synchronizes either Host or Site categories. Or both of them.
        • Categories will be stored in .txt files in $env:TEMP
        • The categories will be used to populate category validation sets in the modules functions.
      • Get-GestioHostList
        • Utilizing the request type "listHosts", this function will retrieve a list of hosts matching the search critera entered in the different parameters.
        • Parameters: [string]Hostname, [string]Comment, [string]Description, [string]Category, [string]Site, [string]Wildcard
          • The wildcard parameter is kinda cool. It will allow you to search for one of the five strings with only a partial string.
      • Get-GestioNetworkList
        • Utilizing the request type "listNetworks", this function will retrieve a list of networks matching the search critera entered in the different parameters.
        • Parameters: [string]Comment, [string]Description, [string]Category, [string]Site, [string]Wildcard
    • New private functions:
      • Get-GestioSettings
        • This function will read the category and site categories from the API and store the sets in .txt files under $env:TEMP
      • Get-DynamicParameter
        • Builds parameters with validation sets based on the categories from the host and site files.
  • 0.0.4 - 2021.04.04
    • New public functions:
      • Add-GestioHost
        • Utilizing the request type 'createHost', this function will create a host on the supplied Ip togehter with information from other parameters used.
        • Parameters: [string]Ip, [string]Hostname, [string]Description, [string]Category, [string], [string]Site, [switch]int_Admin, [string]Comment
      • Remove-GestioHost
        • Utilizing the request type "deleteHost", this function will based on either Ip or Hostname remove a host entry in GestióIP.
        • Parameters: [string]Ip, [string]Hostname
        • Note from the API documentation:
          • [i] IP addresses are unique. Hostnames may not be unique.
          • [i] If there are more than one host with the same hostname found in the database, the first found host will deleted."
          • Conclusion: Use Ip when removing hosts.
    • New private functions:
      • Test-GestioCredential
        • Upon first import of the module, this function kicks in when the password is entered to ensure that it is the correct password.
      • Format-UsedParameters
        • Formats strings passed in parameters to match the API call structure.
  • 0.0.3 - 2021.04.03
    • Changed namne of some files and various fixes.
    • Added this changelog.
    • New public functions:
      • Get-GestioFirstFreeNetworkAddress
        • Utilizing the request type "firstFreeNetworkAddress". This function will based on the Ip address provided retrieve the first free Ip address.
        • Parameters: [string]Ip
      • Get-GestioFreeNetworkAddresses
        • Utilizing the request type "freeNetworkAddresses", This function will retrieve all the free addresses from supplied network address.
        • Parameters: [string]Ip
    • New private function:
      • Format-GestioResponse
        • Sees that you only get what you actually want from the API call.
  • 0.0.2 - 2021.04.02
    • Reworked how default parameter vaules are populated. Cleaner way of getting data from settings.csv.
  • 0.0.1 - 2021.04.01
    • First commit.
    • Available but not finished public functions:
      • Get-GestioHost
        • Utilizing the request type "readHost", this function will retrieve a host based on either Ip address or hostname.
        • Parameters: [string]Ip, [string]Hostname
      • Get-GestioNetwork
        • Utilizing the request type "readNetwork", this function will retrieve information on the network of the Ip address provided.
        • Parameters: [string]Ip
    • Available and kinda finished private functions:
      • Invoke-GestioIP
        • Sort of the heart of it all. Every public function calls this one with it's formatted request string.
      • Save-GestioCredential
        • Upon first import of the module you'll be prompted to enter the password for the user you've supplied in Settings.csv.
        • The secure string will be saved using Export-CliXML in $env:TEMP, readable only by the user importing the module and only on the machine that it was executed on.
      • Get-GestioCredential
        • Retrieves the encrypted secure string previously stored in $env:TEMP
      • Get-PlainText
        • Converts the secure string to plaintext to be able to pass it into the API call. The password will never be written out in plaintext!
      • Get-AuthenticationToken
        • Generates the token for the API call.
    • [-] Trying to learn how github works.

Usage

Get-Help Function-Name -Full

Roadmap

  • Adding compability for handling VLANs

  • Adding compability for handling Networks

  • Adding compability for handling users

Contact

Mail me: Simon Mellergård

Acknowledgements

Marc Uebel who created GestióIP

About

Powershell module to integrate with the GestióIP API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published