Creation of user though powershell without password option and active Skip to main content
https://support.okta.com/help/answers?id=9062a000000bm9qqaq&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Ravi KambamRavi Kambam 

Creation of user though powershell without password option and active

I am trying to create the user without password option to authenticate with other SAML provider but not able to. JIT causing issues for me, want to create the user locally and and give them access...any suggestions.
Organization AdminOrganization Admin
Have you looked at the user operation for create user with authentication provider? That is exactly what it does unless I am miss understanding your question.
http://developer.okta.com/docs/api/resources/users.html#create-user-with-authentication-provider
Ravi KambamRavi Kambam
Hi I am new to Okta, I am seeing the easy way to create though powershell using https://github.com/okta/oktasdk-csharp/tree/master/Okta.Core.Automation When I specify through this as well it is not happening.
Organization AdminOrganization Admin
I stated using the PowerShell Modules that Okta had but quickly got to needing to do things not included in their module. I just started to write my own code because it was easy enough and I could do anything I wanted to do.
Here is powershell code that does what the Okta example does (this is ran on PowerShell version 4 so if you are on lower versions you may get errors about the headers.

$baseUri = "https://YOURSUBDOMAIN.okta.com/api/v1"
$token = "APITOKENHERE"
$headers = @{"Accept"="application/json"; "Content-Type"="application/json"; "Authorization"="SSWS ${token}"}


$body = @{}
$body['profile'] = @{}
$body.profile['firstName'] = "Isaac"
$body.profile['lastName'] = "Brock"
$body.profile['email'] = "isaac.brock@example.com"
$body.profile['login'] = "isaac.brock@example.com"
$body.profile['mobilePhone'] = "555-415-1337"
$body['credentials'] = @{}
$body.credentials['provider'] = @{}
$body.credentials.provider['type'] = "FEDERATION"
$body.credentials.provider['name'] = "FEDERATION"

"Request body: "
ConvertTo-Json $body -Depth 100

$response = Invoke-RestMethod -Headers $headers -Method Post -Uri ($baseUri + "/users?provider=true") -Body (ConvertTo-Json $body -Depth 100)

"Response: "
ConvertTo-Json $response -Depth 100