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

paid programming for this library #28

Open
eightsixeight opened this issue Dec 18, 2023 · 11 comments
Open

paid programming for this library #28

eightsixeight opened this issue Dec 18, 2023 · 11 comments

Comments

@eightsixeight
Copy link

Would like to hire you to complete a function in your powershell for ninja one..

seems ninja doesnt want to help at all.

please contact me for more information

@homotechsual
Copy link
Owner

We're committed to having complete parity with the NinjaOne API without anyone needing to pay-per-function.

Let me know what function/endpoint you're looking for and I'm happy to let you know whether it's something we're already adding - we're working on everything added in 5.6 at the moment for the 2.0.0 stable release this week.

@homotechsual
Copy link
Owner

So we can't do things the Ninja API doesn't support, as it stands now the device/{id}/script/run endpoint requires authorization_code authentication. Ninja can enable sliding refresh tokens which allows you to do interactive authentication once and then reuse / refresh the token as long as it doesn't expire fully. (30 days from memory) which is the workaround we use currently for running scripts from HaloPSA.

@eightsixeight
Copy link
Author

eightsixeight commented Dec 18, 2023 via email

@homotechsual
Copy link
Owner

You'll need to reach out to your NinjaOne account manager and ask them to enable sliding refresh tokens. I'll get our documentation improved tomorrow as it doesn't currently cover Token auth and it should.

@eightsixeight
Copy link
Author

ok once done, can you point me to next steps once i get these to perform a run script ?

@eightsixeight
Copy link
Author

got the sliding refresh, what is next ?

@xasz
Copy link

xasz commented Jan 11, 2024

@eightsixeight - what exactly do want to accomplish. I cannot work it out from the information in this issue.
Can you give a quick description of your goal ?

@eightsixeight
Copy link
Author

@xasz simply call the API to run SCRIPT x on device Y....

@xasz
Copy link

xasz commented Jan 15, 2024

As you have credentials you can connect via Connect-NinjaOne and then use the cmdlet Invoke-NinjaOneDeviceScript

Do you know that you can schedule a script in ninja?
I think you should ask this in the NinjaOne Discord.

@eightsixeight
Copy link
Author

eightsixeight commented Jan 15, 2024

yes i dont want to scedule it.. i want another powershell to call this on demand.

$whois = Get-NinjaOneDeviceLastLoggedOnUser -deviceId 443 
foreach ($userinfo in $whois.userName) {

    Write-Host " User is $userinfo"

}
Invoke-NinjaOneDeviceScript -deviceId 443 -type 'SCRIPT' -scriptId 20 -runAs $userinfo -Debug -Verbose 

results in powershell spitting out, Requested for script blah on device blah successfuly...

spits out on ninja..

Result: Failed. Unable to retrieved credential information.

need to run as system or logged in or whatever....

@xasz
Copy link

xasz commented Jan 16, 2024

Please provide an working example and the full error message.
Please use the correct code formatting markdown.

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

3 participants