Bulk change preferredLanguage on-premise Active Directory

Copper Contributor

Hi all,

 

I need to change preferredLanguage (Attribute Editor) on our on-premise AD for all users to nl-NL.

 

I'm searching Google for over one hour, but only find a lot of information related to O365 (Azure AD).

 

 

I should start with the GET-command below to 'find' all users.

Get-ADOrganizationalUnit -Filter { name -like '*users*' }

 

 

What script should i use to change attribute preferredLanguage to nl-NL?

 

Already big thanks for your support!

1 Reply

Hello @TDJNL2006,

To change attribute for Active Directory objects you should use Set-ADObject cmdlet.

Once you get users then loop trough the collection and set required attribute:

$AllUsers=Get-ADUser -Filter *

foreach ($u in $AllUsers){
    Set-ADObject -Identity $u.DistinguishedName -replace @{preferredLanguage="nl-NL"}
}

Hope that helps.