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

DHCP Script doesn't update config file or ITGlue #3

Open
globier opened this issue Dec 21, 2017 · 14 comments
Open

DHCP Script doesn't update config file or ITGlue #3

globier opened this issue Dec 21, 2017 · 14 comments

Comments

@globier
Copy link

globier commented Dec 21, 2017

I've just started to test the scripts, the Active directory script works well.
But when I run the DHCP script , it outputs the correct information to screen but I've found that the $api variable isn't initiated.

I've added it to the parameters section which got past that but now I'm getting
Method invocation failed because [System.Net.IPAddress] does not contain a method named 'op_Addition'.
\DHCP\DHCP.ps1:121 char:5

I'm not great with powershell so any help appreciated.

@arpeake
Copy link

arpeake commented Dec 21, 2017 via email

@CalebAlbers
Copy link
Collaborator

CalebAlbers commented Dec 21, 2017 via email

@globier
Copy link
Author

globier commented Dec 21, 2017

I've made sure I updated so
Major Minor Build Revision


5 1 14409 1005

Thanks Guys

@globier
Copy link
Author

globier commented Dec 21, 2017

Server 2012 R2

@CalebAlbers
Copy link
Collaborator

CalebAlbers commented Dec 27, 2017 via email

@jhill777
Copy link

jhill777 commented Apr 2, 2018

Hello,
Is this supposed to be functioning correctly yet? Mine displays all the correct scopes and stuff but doesn't update ITG.

Thanks in advance.

@Andrewconcisemsp
Copy link

I get the same problem.

@dmiller90
Copy link

dmiller90 commented Jun 14, 2018

@globier
@jhill777
@Andrewconcisemsp
change the $api__body from
$api__body = @{
data = @{
type = "flexible_assets"
attributes = @{
organization_id = $api__org_id
flexible_asset_type_id = $api_config.flexible_asset_type_id
traits = @{
$api__key_name_ScopeName = $Name
$api__key_name_Server = $api__Server_id
$api__key_name_ScopeBounds = $Start + "-" + $End
}
}
}
}

to....
$api__body = @{
data = @{
type = "flexible_assets"
attributes = @{
organization_id = $api__org_id
flexible_asset_type_id = $api_config.flexible_asset_type_id
traits = @{
$api__key_name_ScopeName = $Name
$api__key_name_Server = $api__Server_id
$api__key_name_ScopeBounds = "$Start-$End"
}
}
}
}

its the $api__key_name_ScopeBounds line causing the error, the + signs

@Andrewconcisemsp
Copy link

@dmiller90 thanks for that. I Still get the same issue. It finds the correct information and display's it but then never updates IT Glue.

@dmiller90
Copy link

@Andrewconcisemsp can you send me the error you are seeing

@Andrewconcisemsp
Copy link

Andrewconcisemsp commented Jul 10, 2018

Hi @dmiller90 thanks for replying. I do not get an error. It runs ok, shows all the relevant information as seen below but then never updates the flexible asset. See powershell commands and all relevant files attached also.
api_config-DHCP.zip

capture

Let me know if you need anything else.

@dmiller90
Copy link

dmiller90 commented Jul 10, 2018

@Andrewconcisemsp Do you have a flex asset type for DHCP? i dont see the ID in your config file nor do i see one listed?

Or are you trying to post this info under your AD asset type? If so fill in flexible_asset_type_id = '' with
flexible_asset_type_id = '412206168932595' in your config file

Daniel

@Andrewconcisemsp
Copy link

Hi @dmiller90 Apologies for the delay in getting back to you.
I am putting it into the AD Asset Type.
I filled in the ID and the asset still does not get updated.
I have also filled in the correct org_id manually and still get the same problem. It finds all the relevant information but the flexible asset never gets updated.
Andrew

@jbusschers
Copy link

I think two thinks are missing in the code:

[string]$api = "", and change $api__key_name_ScopeBounds = $Start + "-" + $End to $api__key_name_ScopeBounds = "$Start-$End" so dmiller says.

But with these changes there is no error on the script, but the information is not updating in IT Glue

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

7 participants