共用方式為


PowerTip: Set Custom Attributes in Active Directory

Summary: Use the Set-ADUser cmdet to modify custom attributes.

Hey, Scripting Guy! Question How can I use Windows PowerShell to modify a custom attribute in Active Directory?

Hey, Scripting Guy! Answer Use the Set-ADUser cmdlet and it’s  –add-replace, and  –remove parameters to adjust custom attributes.

For example, to update the Info attribute in Active Directory and replace it with a new value:

SET-ADUSER john.smith –replace @{info=”John Smith is a Temporary Contractor”}