
ir2cb (ir2cb) asked a question.
Hello,
Currently, we create new users in bulk using OktaAPI PowerShell commands. The script creates and populates a new user account with information such as name, email, department, etc.
My question is, two part: Is there a way to "get" one of those values via PowerShell? "Get-Oktauser" returns all sorts of profile information, but is it possible to get just one attribute, like "lastName" or "manager"? "Get-Oktauser username -getAttribute $value" or something?
Second part is, is there a way to edit one of those values by PowerShell or other means? "Set-Oktauser username -setAttribute $newValue" or similar?
Thanks!

@ir2cb (ir2cb) Thank you for using our community to help you troubleshoot. Your question is important to us. One of our product experts will chime in soon to assist you further.
Hi Paul,
I did make some progress. Basically, I need to fetch the user's manager's email address. Since that isn't a profile attribute, I want to fetch it from a different direction and then write it back to the profile in the form of a custom attribute.
So far, I've put together a PowerShell script that will query the user's manager's name, cross-reference that with Office365, and return the associated email address.
# Get User’s Profile & Cross reference with Office
$userProf = Get-OktaUser userName | select-object profile
Get-Mailbox $userProf.profile.manager | Select-Object PrimarySmtpAddress
And it returns the smtp address. So far, this is great, I have the value we need.
Now that I have it, I just need to write it back to the user's profile as a custom attribute, $managerEmail or similar.
If there is a "Set-Oktauser -property = $value" command or similar, that would solve it!
@ir2cb (ir2cb) Thank you for the update, please see this Okta module for PowerShell and see if provides any inside:
https://toolkit.okta.com/apps/okta-psmodule/