Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating flexible asset fails #8

Open
bstets1 opened this issue Apr 23, 2021 · 0 comments
Open

Updating flexible asset fails #8

bstets1 opened this issue Apr 23, 2021 · 0 comments

Comments

@bstets1
Copy link

bstets1 commented Apr 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant