Hello, I am scripting user creation. I have created a custom command where an end user will submit info for the user to be created from: Here is the scirpt:
# Import the Adaxes module
Import-Module Adaxes
# User details
$userName = "%param-LastName:lower,4%%param-FirstName:lower,3%%param-Initial:lower,1%o"
$firstName = "%param-FirstName%"
$initial = "%param-Initial%"
$lastName = "%param-LastName%"
$displayName = "%param-LastName%,%param-FirstName%"
$employeeType = "%param-EmployeeType%"
$City = "%param-City%"
$Title = "%param-Title%"
$Manager = "%param-Manager%"
$EndDate = "%param-EndDate%"
$ouPath = "OU=ADX Test,DC=E,DC=BENEFIS,DC=ORG"
# Generate a random password
$passwordLength = 10
$validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$^&`*()_-=+[]{}|;:',.<>/?~"
$password = -join ((Get-Random -Count $passwordLength -InputObject $validChars) -join "")
# Create the new user
Try{
$newUserParams = @{
'Name' = $userName
'GivenName' = $firstName
'Surname' = $lastName
'Initials' = $initial
'DisplayName' = $displayName
'employeeType' = $employeeType
'City' = $City
'title' = $Title
'Path' = $ouPath
'AccountPassword' = (ConvertTo-SecureString $password -AsPlainText -Force)
'Enabled' = $true
'AccountExpirationDate' = $EndDate
}
$user = New-AdmUser @newUserParams -AdaxesService localhost -ErrorAction Stop -Verbose
$Context.LogMessage("$displayName was created", "Information")
}
Catch{
$Context.LogMessage("$displayName failed Error "+$_.Exception.Message, "Error")
}
I get this error:
Full Error Text: Flinstone,Jake failed Error A parameter cannot be found that matches parameter name 'employeeType'.
This attribute is both in AD and ADaxes Schema.
I have tried using "Employee Type" as in the screen shot above but same error.