{"id":83327,"date":"2020-03-27T21:31:23","date_gmt":"2020-03-27T20:31:23","guid":{"rendered":"http:\/\/actualites.neomytic.be\/?p=83327"},"modified":"2024-05-19T20:05:17","modified_gmt":"2024-05-19T18:05:17","slug":"office-365-dfinir-la-langue-et-les-paramtres-rgionaux-pour-tous-vos-utilisateurs","status":"publish","type":"post","link":"https:\/\/blog.teamy.be\/index.php\/2020\/03\/27\/office-365-dfinir-la-langue-et-les-paramtres-rgionaux-pour-tous-vos-utilisateurs\/","title":{"rendered":"Office 365, d&eacute;finir la langue et les param&egrave;tres r&eacute;gionaux pour tous vos utilisateurs"},"content":{"rendered":"<p><a href=\"http:\/\/actualites.neomytic.be\/wp-content\/uploads\/2020\/03\/clip_image001-1.gif\"><img fetchpriority=\"high\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"clip_image001\" src=\"http:\/\/actualites.neomytic.be\/wp-content\/uploads\/2020\/03\/clip_image001_thumb.gif\" alt=\"clip_image001\" width=\"772\" height=\"423\" border=\"0\" \/><\/a><\/p>\n<p>D\u00e9finir les param\u00e8tres de langues et param\u00e8tres r\u00e9gionaux de vos utilisateurs Office 365 peut devenir une t\u00e2che complexe, surtout si vous le faite manuellement.<br \/>\nJe vous propose ici un script PowerShell qui va mettre \u00e0 jour l&rsquo;ensemble de vos utilisateurs selon votre convention !<\/p>\n<p>Pour comprendre un minimum PowerShell, je vous renvoies vers un article pr\u00e9c\u00e9dent :<br \/>\n<a href=\"http:\/\/actualites.neomytic.be\/index.php\/2020\/03\/25\/office-365-powershell-les-bases\/\">http:\/\/actualites.neomytic.be\/index.php\/2020\/03\/25\/office-365-powershell-les-bases\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>D&rsquo;abord il faut vous authentifier pour ouvrir par la suite une session sur Exchange Online<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$AdminLogin = \"admin@contoso.com\" \r\n$AdminPassword = Read-Host -Prompt \"Enter your Office 365 Password\" -AsSecureString \r\n$credential = new-object System.Management.Automation.PSCredential $AdminLogin, $AdminPassword<\/pre>\n<p>Il est clair qu&rsquo;il faut changer la valeur du param\u00e8tres $AdminLogin avec un identifiant qui vous est personnel et qui vous donne un acc\u00e8s en administration \u00e0 Exchange Online<\/p>\n<p>Ensuite on ouvre une session sur Exchange Online et on importe les libraires de commandes<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri \"https:\/\/outlook.office365.com\/powershell-liveid\/\" -Credential $credential -Authentication Basic -AllowRedirection \r\nImport-PSSession $Session -DisableNameChecking -ErrorAction SilentlyContinue<\/pre>\n<p>Une premi\u00e8re commande \u00ab\u00a0Get-mailbox\u00a0\u00bb qui va nous renvoyer toutes les boites mails existantes et une deuxi\u00e8me \u00a0\u00bb Set-MailboxRegionalConfiguration\u00a0\u00bb qui nous permet de mettre \u00e0 jour certains param\u00e8tres de ces boites mails. Il suffit d&rsquo;appliquer la seconde commande sur le r\u00e9sultat de la premi\u00e8re. Ce qui donne !<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Get-mailbox -ResultSize unlimited | Set-MailboxRegionalConfiguration -DateFormat \"$DateFormat\" -TimeFormat \"$TimeFormat\" -TimeZone \"$TimeZone\" -Language \"$Language\"<\/pre>\n<p>Ensuite pour faire les choses correctement, on ferme la session ouverte sur Exchange Online<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Get-PSSession | Remove-PSSession<\/pre>\n<p>&nbsp;<\/p>\n<p>Le script complet est donc<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">#Authentification Parameters\r\n$AdminLogin = \"admin@contoso.com\"\r\n$AdminPassword = Read-Host -Prompt \"Enter your Office 365 Password\" -AsSecureString\r\n$credential = new-object System.Management.Automation.PSCredential $AdminLogin, $AdminPassword\r\n\r\n#Script Parameters\r\n$TimeZone = \"Romance Standard Time\" #GMT +01:00 Brussels Time Zone : https:\/\/support.microsoft.com\/en-us\/help\/973627\/microsoft-time-zone-index-values\r\n$DateFormat = \"dd\/MM\/yyyy\"\r\n$TimeFormat = \"HH:mm\"\r\n$Language = \"fr-BE\"\r\n\r\n#Exchange Session Connection and Import\r\n$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri \"https:\/\/outlook.office365.com\/powershell-liveid\/\" -Credential $credential -Authentication Basic -AllowRedirection\r\nImport-PSSession $Session -DisableNameChecking -ErrorAction SilentlyContinue\r\n\r\nGet-mailbox -ResultSize unlimited | Set-MailboxRegionalConfiguration -DateFormat \"$DateFormat\" -TimeFormat \"$TimeFormat\" -TimeZone \"$TimeZone\" -Language \"$Language\" \r\n\r\nGet-PSSession | Remove-PSSession<\/pre>\n<p>&nbsp;<\/p>\n<p>En esp\u00e9rant que cela puisse en aider certains<\/p>\n","protected":false},"excerpt":{"rendered":"<p>D\u00e9finir les param\u00e8tres de langues et param\u00e8tres r\u00e9gionaux de vos utilisateurs Office 365 peut devenir une t\u00e2che complexe, surtout si<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_layout":"default_layout","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[22,166],"tags":[213],"class_list":["post-83327","post","type-post","status-publish","format-standard","hentry","category-microsoft-365","category-powershell","tag-post"],"views":2433,"_links":{"self":[{"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/posts\/83327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/comments?post=83327"}],"version-history":[{"count":1,"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/posts\/83327\/revisions"}],"predecessor-version":[{"id":86056,"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/posts\/83327\/revisions\/86056"}],"wp:attachment":[{"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/media?parent=83327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/categories?post=83327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.teamy.be\/index.php\/wp-json\/wp\/v2\/tags?post=83327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}