Re: preferredLanguage Active Directory attribute?

Tech-Archive recommends: Speed Up your PC by fixing your registry



Adding a context menu for Preferred Language in ADUC.

First, create a script to do your work and put it in a accessible location.
--

'Preferred Language
On Error Resume Next
Const ADS_PROPERTY_CLEAR = 1
Set wshArgs = WScript.Arguments
Set objUser = GetObject(wshArgs(0))

strLang = Inputbox("Please enter the Preferred Language for " & objUser.displayName, "Preferred Language", "US English")
If strLang <> "" Then
objUser.Put "preferredLanguage", strLang
objUser.SetInfo
End If

--
I usually put the script in \\domain.com\netlogon\AdminUI (you have to create the AdminUI folder)

Now open ADSIEdit.msc
Go to Configuration -> CN=DisplaySpecifiers -> CN=409 --> Open the Properties for CN=user-Display
In attribute, open adminContextMenu and add the following:
5,Preferred Language, \\domain.com\netlogon\AdminUI\PrefLang.vbs

Once the data has replicated, the next time you open ADUC and right click a user, you can set preferred language.

Thanks,
Allan


"Claude Lachapelle" <ClaudeLachapelle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:0067A576-E81B-4647-B745-842C32E2267D@xxxxxxxxxxxxxxxx
Finally I found a VBscript here (http://www.kouti.com/scripts.htm) for
modifying the EmployeeID field which I modified a little bit to have a list
of languages displayed and selectables, which set the preferredlanguage
attribute.

But, I read that is possible to programmatically change the way ADUC is
displaying objects, how we could accomplish that?

Thanks.

"Allan" wrote:

If you are just going to edit a few users, I would use adsiedit.msc. It is
pretty easy to do it from there.

If you want to do a mass edit, you can use a script like the following:

Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select distinguishedName from 'LDAP://OU=Us,DC=domain,DC=com' " _
& "where objectClass='user' and objectCategory='person'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False

Set rsUsers = objCommand.Execute
rsUsers.MoveFirst
Do Until rsUsers.EOF
Set objUser = GetObject("LDAP://"; &
rsUsers.Fields("distinguishedName").Value)
objUser.Put "preferredLanguage", "US
English"
objUser.SetInfo
Loop

For individual editing from the MMC, you would have to make a similar script
and make a small schema modification. Let me know if this is what you
wanted.

Thanks,
Allan


"Claude Lachapelle" <ClaudeLachapelle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:D14A71D3-825E-41FD-8129-404789C8B68C@xxxxxxxxxxxxxxxx
> Hi!
>
> I need to know where this field is accessible, since I could not find > it
> from ADUC?
>
> We need to populate it with user spoken language (Active Directory will > be
> used by a support application that will uses this field to determine in
> which
> language we should give support to the user).
>
> Actually, I will automatically populate this field with a VBScript > (with
> human resources information), but in the future we will need to > maintain
> this
> field when working with users properties.
>
> Thanks.
>
> Claude Lachapelle
> Systems Administrator, MCSE
>
> Thanks.

.