Git Product home page Git Product logo

azglue's Introduction

Hi there ๐Ÿ‘‹

I'm Kelvin Tegelaar, Also known as "Lime" or Lime-TeGek" in some parts. I enjoy long walks on github pages and PowerShelling a lot.

  • ๐Ÿ”ญ Iโ€™m currently working on ... My PowerShell blogs on https://cyberdrain.com
  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on ... Any project I have on my Github. I love collabing!
  • ๐Ÿ’ฌ Ask me about PowerShell, Monitoring, Automation, and how much fun it is to run a MSP.
  • ๐Ÿ“ซ How to reach me: kelvin {at} cyberdrain.com or twitter @KelvinTegelaar
  • โšก Fun fact: I specialize in monitoring using RMM systems, they actually are a big hobby of mine. This is also why I like speaking at events such as Dattocon, Solarwinds Empower MSP :)
  • ๐Ÿ˜I'm proud of the following projects:
    • my RunAsUser Module, which allows you to execute scripts as the currently logged on user, while the script host was started as SYSTEM.
    • My AutotaskAPI project for creating a fast method of connecting to the REST API
    • My Automatic Documentation blogs, as I strongly believe that automatic documentation is the only correct documentation.
    • And a lot more projects to mention here... :)

azglue's People

Contributors

anguswarren avatar kelvintegelaar avatar smood922 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

azglue's Issues

Getting a error when running "run.ps1" in VSC

After that we re-ran the script and got the following error:
The term 'enter path or command to execute e.g.: C:\Users\MYNAME\MYCOMPANY\Coding - General\AZGlue/src/foo.ps1 or Invoke-Pester' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
+ CategoryInfo : ObjectNotFound: (enter path or c...r Invoke-Pester:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException

Cannot get past step 5 in the README.txt

Updating flexible asset fails

I'm running your DHCP documenting script through this Azure secure setup, i've added the proper traits to the yaml whitelist document.
### Used for "DHCP - Autodoc" dhcp-server-name: string dhcp-server-settings: string dhcp-server-database-information: string dhcp-domain-authorisation: string dhcp-scopes: string dhcp-scope-information: string dhcp-statistics: string

The script runs successfully and adds the data to the flexible asset for the organization in IT Glue, the problem comes in when you run it again, it does not update the existing flexible asset it creates a new duplicate entry.

It comes down to this line
$ExistingFlexAsset = (Get-ITGlueFlexibleAssets -filter_flexible_asset_type_id $filterID.ID -filter_organization_id $orgID).data | Where-Object { $_.attributes.traits.'DHCP-Server-Name' -eq "$env:computername" }

Running this alone, and replacing the variables with the real information, if run not through Azure it returns the proper value, if run through Azure it returns nothing.
Removing the Where-Object it returns the proper flexible asset.
Im not sure what is happening through this azure function app that is removing the ability for it to return the filtered result, especially when this exact same code works in the Active Directory documentation script run through Azure to update flexible assets.

The remote server returned an error: (401) Unauthorized.

When I attempt to test this after deployment in our Azure tenant via PowerShell, I continually get this error after trying to run any cmdlet with the ITGlueAPI PS Module.

PS C:\Users\USERNAME> Get-ITGlueOrganizations
Get-ITGlueOrganizations : The remote server returned an error: (401) Unauthorized.
At line:1 char:1
+ Get-ITGlueOrganizations
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ITGlueOrganizations

I've verified I'm using the full, correct, Function App URL. Navigating to it directly in a browser executes the run.ps1 script and fails out as expected.

I've tried changing the API Key for AzGlue in the event that was the issue the first time, and no dice there in case it was some kind of incompatibility there.

Any thoughts on what could be going on here? It's as if the ITGlueAPI Module doesn't want to play nice with this Azure Function App URL.

Add this for when there's no organization allow list - I overlooked this before

($_.type -eq "organizations" -and $_.id -in $allowedOrgs.ITGlueOrgID) -or

Insert
($DISABLE_ORGLIST_CSV) -or

at line 159

Test should read

# For organization specific data, only return records linked to the authorized client.
if ($itgRequest.data.type -contains "organizations" -or 
    $itgRequest.data[0].attributes.'organization-id') {

    $itgRequest.data = $itgRequest.data | Where-Object {
        ($DISABLE_ORGLIST_CSV) -or
        ($_.type -eq "organizations" -and $_.id -in $allowedOrgs.ITGlueOrgID) -or
        ($_.attributes.'organization-id' -in $allowedOrgs.ITGlueOrgID)
    }
}

@Links for output

Not sure what I did wrong but when I run:

Import-Module ITGlueAPI
$functionSite = "test-itglue"
$functionName = "AzGlueForwarder"
$functionToken = "removed for security"


# note that the base Uri should end with the = sign.
Add-ITGlueBaseUri "https://${functionSite}.azurewebsites.net/api/${functionName}?code=${functionToken}&ResourceURI="
Add-ITGlueApiKey "removedforsecurity"

Get-ITGlueOrganizations 

I get the following result:

Get-ITGlueOrganizations

meta                                                                                   links                                                                                                                
----                                                                                   -----                                                                                                                
@{current-page=1; next-page=2; prev-page=; total-pages=51; total-count=2501; filters=} @{self=https://api.itglue.com/organizations?page%5Bnumber%5D=1&page%5Bsize%5D=50; next=https://api.itglue.com/orga...
 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.