Service Manager - Subscription templates sends e-mail in wrong language

We've been looking for a solution to why the subscription template configured as English (United States) sends out e-mails in Swedish.
 
It's pretty basic actually. If the locale variable is not set in Active Directory, the locale field on the user will be empty in Service Manager. Our guess is that SCSM then will base this upon the country variable, which in my case is Sweden. And since we want all e-mail correspondence in English we need to set the locale to English (United States) for all users.
 
To do this, we are creating a management pack with a powershell script scheduled to run once per day. For more information regarding this management pack and powershell script, please see the following links:
 
Powershell Script

Import-Module smlets ; Add-PSSnapIn SMCmdletSnapIn ;

 

#Delete the existing data from the CSV Clear-Content -Path "E:SMAdminCSVUsers.csv"

 

#retrieve all users from the CMDB and cycle through them

$users = (get-scsmclass Microsoft.AD.User$ | get-scsmobject)

foreach ($user in $users)    

{        

$UserName = $user.UserName               #get the username, used to identify the person        

$Domain = $user.Domain                   #get the domain, this is required for a CSV import        

$ID = $user.ID                           #get the users guid, we will use this to create the ID for the settings object         $setPref = 'Pref.'                       #used as a prefix for the localsetting object id        

$setID = $setPref,$ID                 

$setID = [string]::join('',$setID)       #combine the users guid and Pref. to make the id for localesettings        

if ($user.City -like "Shanghai") {$timezone = 'China Standard Time'}        

elseif ($user.City -like "Dhaka") {$timezone = 'Central Asia Standard Time'}        

else {$timezone = 'W. Europe Standard Time'}        

$locale = '1033'                         #setting the locale, in this case it's English (United States)        

$data = $UserName, $Domain, $setID, $timezone, $locale  #put it all into an array        

[string]::join(',',$data) | ForEach-Object {Add-Content -Value $_ -Path "E:SMAdminCSVUsers.csv"};   #convert the array to a string and append to the csv

}

 

#once all users have been added to the csv, import it into the CMDB using the xml mapping file.   

Import-SCSMInstance -DataFileName "E:SMAdminCSVUsers.csv" -FormatFileName "E:SMAdminCSVUserImport.xml"

 

#Remove any automatically created localization settings, the script has create new ones for everybody

get-scsmclass System.UserPreference.Localization$ | get-scsmobject -filter {DisplayName -notlike "%-%"} | remove-scsmobject -force

 

Remove-PSSnapIn SMCmdLetSnapIn;

Remove-Module smlets;

 

Source: http://scservman.wordpress.com/2010/12/05/setting-locale-and-timezone-in-bulk/
 
Management Pack
http://blogs.technet.com/b/servicemanager/archive/2009/12/21/creating-an-ad-connector-using-powershell-and-csv-import.aspx

Kommentarer

Kommentera inlägget här:

Namn:
Kom ihåg mig?

E-postadress: (publiceras ej)

URL/Bloggadress:

Kommentar:

Trackback
RSS 2.0