Comments (7)
It clearly sais "unauthorized". So something is wrong in auth.
In my scripts I mainly use Set-Info to set the auth and be able to skip the overhead when pulling data from snipe.
Eg:
# Set connection details for Snipe-IT
Set-Info -URL $config.url -apiKey $config.apikey
# get all the Snipe Users into an array
$SnipeitUsers = Get-User -limit 1000
from snipeitps.
Correct, but i'm not sure what to look for when it's unauthorized.
from snipeitps.
What error message do you receive when running Set-Info? make sure your API token is not cut. My one is extremely long and contains characters the "double-click to copy" feature will stop copying.
Alternatively I can only imagine youre querying something you're not permission#ed to. E.g. an asset for another company, etc.
Good luck
from snipeitps.
Set-Info i don't have any errors. I have made sure to copy the complete key, multiple different ways. I am a SuperUser, which i have also created a API Token from the original administrator account and neither has worked.
All i am trying to do is Get-User command at this point, but clearly it something to do with API Token permissions, I just don't know where else to look.
Example:
$apikey = 'Very Long API Token'
$url = "http://snipeit/"
Set-Info -url $url -apiKey $apikey
Get-User -search "shadowwolfing"
I have also tried not using variables and input the website and key directly into Set-Info
Any other suggestions?
Thank you for taking time MrMontesa
from snipeitps.
@Shadowwolfing Are you using https?
And just to be sure, can you confirm that you are using your own snipeit url instead of "http://snipeit/" ?
from snipeitps.
And are you using self signed certificates?
from snipeitps.
Closing this for inactivity. Reopen if needed.
from snipeitps.
Related Issues (20)
- Issues with Set-SnipeITAsset HOT 2
- Set-SnipeitConsumable HOT 2
- Password required when making new user HOT 3
- Script stops before for loop is completed. Limit exceeded? HOT 3
- Using v1.10.222 with Snipe-IT v6.0.1 HOT 1
- Unable to access server once moved to https HOT 3
- Will not connect to on-prem non-SSL setup? HOT 1
- API Request throttling HOT 1
- Unable to Connect to SnipeItPS HOT 1
- Connect-SnipeitPS is erroring out HOT 1
- New-SnipeITuser returns 422 HOT 4
- Licence Checkout without specifying the seat id. HOT 3
- Update Status ID on Set-SnipeITAssetOwner HOT 1
- Create Functionality to Create and Modify Fieldsets
- Return MAC Address (custom fieldset) with "Get-SnipeITAsset -status 'Deployed'" HOT 1
- New-SnipeitUser -deleted param
- New-SnipeitLicense fails when license_email parameter provided
- Issue with Set-SnipeITAsset
- Issue with New-SnipeitAsset
- Forbidden: New-SnipeItAsset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snipeitps.