Create User in AD with extensionAttributes set

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:27 PM
I've copied the "ActionCreateUser_AD_v2.ps1" to include other fields as per my organizations requirements; See attached file. It works fine until I try to include extensionAttributes4 where it fails with the message of
"A parameter cannot be found that matches parameter name 'extensionAttribute4'"
Part of script that is attempting to set extensionAttribute4
If($BusinessUnit){
$params['extensionAttribute4'] = $BusinessUnit
}
Please help me with the correct way to set extensionAttributes when creating new users in AD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 09:58 PM
You need to tweak your script a bit. You can either make use of -otherattributes in your cmdlet or you can set the attributes using Set-AdUser cmdlet with -add switch. Refer below links :
https://stackoverflow.com/questions/49622393/ad-custom-attribute-new-aduser-powershell
https://stackoverflow.com/questions/44266220/adding-users-to-ad-using-new-aduser-and-splatting
https://stackoverflow.com/questions/15807496/adding-and-removing-extensionattribute-to-ad-object
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.