Jump to content

Recommended Posts

Posted

Hi all,

 

Hope you are well.

 

I was wondering has anyone setup SnipeIT automated inventory using the API?

 

There is a SnipeIT powershell wrapper for the API, has anyone tried this?

 

Thanks

Posted

You're a star thanks so much.

 

Sorry not much of a programmer, quick question if you don't mind. I notice that the script check the existence of the assets by the asset tag, which is the device serial number, as we put barcodes of 5 digit numbers as asset tags, so it wouldn't be the serial number.

 

Is there a way to change the check to the serial number? Again sorry for basic question.

Posted

Sorry, I am getting this when it tries to connect to the SnipeIT Website. Any ideas?

 

Invoke-SnipeitMethod : Cannot connect to Snipe It: Unauthorized.

At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.10.227\Private\Test-SnipeitPSConnection.ps1:10 char:16

+ $contest = Invoke-SnipeitMethod @Parameters

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException

+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod

 

Cannot verify connection to snipe it. For the start try to check url and provided apikey or credential parameters

At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.10.227\Public\Connect-SnipeitPS.ps1:146 char:13

+ throw "Cannot verify connection to snipe it. For the star ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OperationStopped: (Cannot verify c...tial parameters:String) [], RuntimeException

+ FullyQualifiedErrorId : Cannot verify connection to snipe it. For the start try to check url and provided apikey

or credential parameters

Posted
Sorry, I am getting this when it tries to connect to the SnipeIT Website. Any ideas?

 

Invoke-SnipeitMethod : Cannot connect to Snipe It: Unauthorized.

At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.10.227\Private\Test-SnipeitPSConnection.ps1:10 char:16

+ $contest = Invoke-SnipeitMethod @Parameters

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException

+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod

 

Cannot verify connection to snipe it. For the start try to check url and provided apikey or credential parameters

At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.10.227\Public\Connect-SnipeitPS.ps1:146 char:13

+ throw "Cannot verify connection to snipe it. For the star ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OperationStopped: (Cannot verify c...tial parameters:String) [], RuntimeException

+ FullyQualifiedErrorId : Cannot verify connection to snipe it. For the start try to check url and provided apikey

or credential parameters

 

Sorry I obviously don't know the difference between APP key and API key. :(

Posted
You're a star thanks so much.

 

Sorry not much of a programmer, quick question if you don't mind. I notice that the script check the existence of the assets by the asset tag, which is the device serial number, as we put barcodes of 5 digit numbers as asset tags, so it wouldn't be the serial number.

 

Is there a way to change the check to the serial number? Again sorry for basic question.

 

Ignore I have managed to sort this as well. AssetTag is a required field, so I added it so that both assettag and serialnumber get populated with the same thing, then I can manually edit the assettag. Not great but better than it could have been, so thanks so much for passing this on.

Posted

Hi all,

 

I just stumbled across this thread and thought I would give it a try in our environment as we have snipe-it setup. I can get it to connect using the url and the apikey but I keep getting the following error any ideas or did you come across this?

 

Get detailsInvoke-SnipeitMethod : manufacturer_id --------------- {The selected manufacturer id is invalid.}At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.10.227\Public\New-SnipeitModel.ps1:102 char:23+ $result = Invoke-SnipeitMethod @Parameters+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod

 

 

Admittedly my knowledge is pretty basic, but I am working my way through it, it says WriteError soi I was thinking permissions but where?

Posted
I think that's the bit I am struggling with, we have lots of manufacturers already created, I dont seem to be able to match them up. At a minimum I would like to be able to pull OS information and then update that into Snipe!
Posted
Thanks, I will double check the manufacturers, although I have a sneeky suspision I am going down the wrong route and it might be easier to try and start again and uncomplicate things.
  • 2 weeks later...
Posted

Hi,

 

Really odd, I have started to get this error. I assume it is something about the model numbers in SnipeIT?

 

New-SnipeitAsset : Cannot process argument transformation on parameter 'model_id'. Cannot convert the "System.Object[]" value of

type "System.Object[]" to type "System.Int32".

At C:\Program Files\SnipeIT\AssetInventory_SnipeIT.ps1:70 char:83

+ ... Name -tag $assetTag -serial $serial -Model_id $modelSelection -Status ...

+ ~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidData: (:) [New-SnipeitAsset], ParameterBindingArgumentTransformationException

+ FullyQualifiedErrorId : ParameterArgumentTransformationError,New-SnipeitAsset

Posted (edited)
Hi,

 

Really odd, I have started to get this error. I assume it is something about the model numbers in SnipeIT?

 

New-SnipeitAsset : Cannot process argument transformation on parameter 'model_id'. Cannot convert the "System.Object[]" value of

type "System.Object[]" to type "System.Int32".

At C:\Program Files\SnipeIT\AssetInventory_SnipeIT.ps1:70 char:83

+ ... Name -tag $assetTag -serial $serial -Model_id $modelSelection -Status ...

+ ~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidData: (:) [New-SnipeitAsset], ParameterBindingArgumentTransformationException

+ FullyQualifiedErrorId : ParameterArgumentTransformationError,New-SnipeitAsset

 

Ok ignore the previous post seemed to be an issue with the Asset Models. Now though each model is being created as a Monitor. Any ideas? - Found I just needed to change the category numbers...... I am going home. :)

Edited by Theldron
Posted
I should have added comments! bad mavhc

 

No not you mate, I appreciate your help, more muppet Theldron. :) Making things too complicated.

 

Out of interest how do you deploy the script, it only seems to work for me when somebody is logged in?

Posted
No not you mate, I appreciate your help, more muppet Theldron. :) Making things too complicated.

 

Out of interest how do you deploy the script, it only seems to work for me when somebody is logged in?

 

gpo startup script, run as system user

Posted
Hmmmm.... doesn't seem to work for me that way for me. Mind you we are using Sophos firewall with AD sync, and with it downloading the API wrapper etc. It might be that.
  • 2 weeks later...
Posted

Hi all, having another weird thing, with the automation script. Even though I manually entered the models for the devices, it is generating duplicate models but not linking anything to them. Problem is with the duplicate models, it is causing the script to error and not run. When I remove the duplicates and run the script manually it works, but then the duplicates get generated again and it stops working.....

Any ideas?

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...