AutotaskAPI
AutotaskAPI copied to clipboard
Connecting to the Autotask API failed. The remote server returned an error: (401) Unauthorized.
Any idea why 'Get-Credential' (and enter credentials manually) works but using this code doesn't?
$ApiUser = "[API-username]" $ApiSecret = ConvertTo-SecureString "[API-password]" -AsPlainText -Force $Creds = New-Object System.Management.Automation.PSCredential ($ApiUser, $ApiSecret)
Connection looks succesfull but as soon as I run a command like "Get-AutotaskAPIResource -Resource Companies -ID 1899" I get the error as mentioned in the title.