Im trying to update active directory users info and I added a new custom attribute to users, the new attribute calls certificate, and I was able to modify all attribute via powershell Set-Aduser excpet my new attribute. here is my powershell code and error: Code:
$user = Get-ADUser -Filter "SamAccountName -eq '$($Object.UserName)'" -Server $server -Credential $credential
Set-ADUser -Identity $user -HomePage $Object.HomePage `
-Description $Object.Description`
-Title $Object.Title`
-Officephone $Object.PhoneNumber`
-Mobilephone $Object.Mobile`
-Postalcode $Object.PostalCode`
-City $Object.City`
-State $Object.State`
-Streetaddress $Object.StreetAddress`
-Department $Object.Department`
-Company $Object.Company
-Certificat $Object.Certificat
Error:
Set-ADUser: Unable to bind the "Certificates" parameter. Unable to convert the value "Study Study" from type "System.String" to type
"System.Collections.Hashtable".
Au caractère C:\Users\test\Desktop\PP\AdInfoUpdater.ps1:40 : 43
+ -Certificat $Object.Certificat
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument : (:) [Set-ADUser], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.ActiveDirectory.Management.Commands.SetADUser