Software Distribution

무료
EPM
분류별 Ivanti | 업데이트됨 a year ago | Manage
모든 자습서로 돌아가기 (3)

Get the Endpoint Manager access token using PowerShell

Use PowerShell to retrieve the access token from the EPM server so you can use it for API calls. Each call to the API endpoint requires this access token.

$body = @{
  'client_id' = '{YourClientId}'
  'client_secret' = '{YourClientSecret}'
  'grant_type' = 'password'
  'scope' = 'openid'
  'username' = '{YourEPMUser}'
  'password' = '{YourEPMUserPassword}'
}
	
$params = @{
  ContentType = 'application/x-www-form-urlencoded'
  Headers = @{'accept'='application/json'}
  Body = $body
  Method = 'Post'
  Uri = 'https://{YourEPMServer}/my.identityserver/identity/connect/token'
}
	
$token = Invoke-RestMethod @params

With the token saved, add “Bearer {$token}” to the Authorization header in your request.