企業のWindows環境でMozilla Thunderbirdをセットアップする

原則に従います。ユーザーを構成する必要が少ないほど、ユーザーが何かを壊す可能性が低くなります。 ユーザーは自分のパスワードの入力に対処すると思います。







以下を構成する必要があります。



  1. サーバーに接続するための構成ファイル。
  2. LDAPからの連絡先のディレクトリ。
  3. 企業の基準に基づいた書簡内の従業員の署名。


現時点では次のとおりです。



  1. グループポリシーを使用してワークステーションにThunderbirdメールクライアントをインストールしました。
  2. biz.mail.ru上のメール(おそらく別のメール)
  3. i.ivanov@domain.cnの形式のログインを持つADのユーザー


GPOを使用したThunderbirdのインストール

サードパーティの開発者から.msiファイルをダウンロードすることはありません。特にThunderbirdはコマンドラインからサイレントインストールできるため、再パッケージ化されたプログラムは信頼していません。 この利点を活用し、システムが起動するたびに再インストールしないように、レジストリのキーを確認します。

サイトからThunderbirdをダウンロードして、ボールにドロップします(ドメイン内のすべてのPCに対して権利を読み取る必要があります)

スクリプト自体







set VERSION=52.7.0 set SHARE="" if %PROCESSOR_ARCHITECTURE% == x86 ( set REGISTRY_KEY_NAME="HKLM\SOFTWARE\Mozilla\Mozilla Thunderbird" ) else ( set REGISTRY_KEY_NAME="HKLM\SOFTWARE\Wow6432Node\Mozilla\Mozilla Thunderbird" ) reg query %REGISTRY_KEY_NAME% /v CurrentVersion | find "%VERSION% (ru)" if ERRORLEVEL 1 "\\%SHARE%\Thunderbird Setup %VERSION%.exe" -ms
      
      





最初の変数を変更する必要があります。 バージョンとフォルダー。

バージョンはファイル名に対応し、執筆時点では、現在のバージョンは52.7.0です。

Thunderbird Setup 52.7.0.exeファイル名

同じフォルダーに保存し、InstallMozillaThunderbird.batを呼び出してGPOに追加し、システムの起動時にスクリプトを開始します。







PS同じ方法でMozilla Firefoxをインストールできます。







Thunderbirdは起動時に設定します。



Thunderbirdは最初の起動時に、%appdata%\ Thunderbird \ Profiles \フォルダーに123.defaultタイプのフォルダーを生成し、%appdata%\ Thunderbird \ profiles.iniファイルにこのフォルダーへのリンクを作成します。







したがって、ユーザーがログインするときにこれらの設定を以前に作成します。







グループポリシーに進み、ポリシーを作成します。

ユーザー構成=>設定=> Windows構成=> INIファイル。







5つのキーを作成する
ファイルパス セクション名 物件名 プロパティ値
%AppData%\ Thunderbird \ profiles.ini プロフィール0 デフォルト 1
%AppData%\ Thunderbird \ profiles.ini プロフィール0 IsRelative 1
%AppData%\ Thunderbird \ profiles.ini プロフィール0 お名前 %ユーザー名%
%AppData%\ Thunderbird \ profiles.ini プロフィール0 パス プロファイル/%username%.default
%AppData%\ Thunderbird \ profiles.ini 全般 StartWithLastProfile 1


profiles.iniファイルが構成され、Profiles /%username%.defaultフォルダーが作成され、構成ファイルが書き込まれます。







prefs.jsファイルは、Thunderbirdのセットアップを担当します

IMAPおよびKerberOSを介したLDAPへのアクセス用に、データを使用して生成します。







まず、ユーザーがログインしたときにGPOに挿入するPowerShellを作成しました。 ログインしたユーザーとして実行することが重要です。







ユーザー構成=>ポリシー=> Windows構成=>スクリプト(ログイン/ログアウト)=>ログオン=> PowerShellスクリプト







start.ps1







 $profiledir = "$env:APPDATA\Thunderbird\Profiles\$env:UserName.default" md $profiledir #   . powershell "\\domain.cn\NETLOGON\soft\new_prefs.ps1" #   
      
      





new_prefs.ps1
 #    (  ) $UserName = $env:username $Filter = "(&(objectCategory=User)(samAccountName=$UserName))" $Searcher = New-Object System.DirectoryServices.DirectorySearcher $Searcher.Filter = $Filter $ADUserPath = $Searcher.FindOne() $ADUser = $ADUserPath.GetDirectoryEntry() $ADDisplayName = $ADUser.DisplayName ############################################################################################################################ $domain="mail.ru" #  $imap="imap.mail.ru" #imap  $dc="dc1.domain.cn" #  $bdn="CN=Users,DC=domain,DC=cn" #Base DN $file="$env:appdata\Thunderbird\Profiles\$env:username.default\prefs.js" echo '#######################' | out-file $file -encoding UTF8 echo 'user_pref("ldap_2.autoComplete.directoryServer", "ldap_2.servers.company");' | out-file $file -encoding UTF8 -Append echo 'user_pref("ldap_2.autoComplete.useDirectory", true);' | out-file $file -encoding UTF8 -Append echo 'user_pref("ldap_2.servers.company.auth.dn", "");' | out-file $file -encoding UTF8 -Append echo 'user_pref("ldap_2.servers.company.auth.saslmech", "GSSAPI");' | out-file $file -encoding UTF8 -Append echo 'user_pref("ldap_2.servers.company.description", "company");' | out-file $file -encoding UTF8 -Append echo 'user_pref("ldap_2.servers.company.filename", "ldap.mab");' | out-file $file -encoding UTF8 -Append echo 'user_pref("ldap_2.servers.company.maxHits", 100);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("ldap_2.servers.company.uri", "ldap://' $id2 = echo $dc/$bdn'??sub?(objectclass=*)");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.ab_remote_content.migrated", 1);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.account.account1.identities", "id1");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.account.account1.server", "server1");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.account.account2.server", "server2");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.account.lastKey", 2);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.accountmanager.accounts", "account1,account2");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.accountmanager.defaultaccount", "account1");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.accountmanager.localfoldersserver", "server2");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.append_preconfig_smtpservers.version", 2);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.attachment.store.version", 1);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.default_charsets.migrated", 1);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.folder.views.version", 1);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.font.windows.version", 2);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.identity.id1.draft_folder", "imap://' $id2 = echo $env:username%40$domain@$imap/Drafts'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.attach_signature", true);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.drafts_folder_picker_mode", "0");' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.identity.id1.fcc_folder", "imap://' $id2 = echo $env:username%40$domain@$imap/Sent'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.fcc_folder_picker_mode", "0");' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.identity.id1.fullName", "' $id2 = echo $ADDisplayName'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.htmlSigFormat", true);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.reply_on_top", 1);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.identity.id1.sig_file", "C:\\Users\\' $id2 = echo $env:username\\AppData\\Roaming\\Thunderbird\\Profiles\\$env:username.default\\signature.htm'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.sig_file-rel", "[ProfD]signature.htm");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.sign_mail", false);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.smtpServer", "smtp1");' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.identity.id1.stationery_folder", "imap://' $id2 = echo $env:username%40$domain@$imap/Templates'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.tmpl_folder_picker_mode", "0");' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.identity.id1.useremail", "' $id2 = echo $env:username@$domain'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.identity.id1.valid", true);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.openMessageBehavior.version", 1);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.rights.version", 1);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.root.imap", "C:\\Users\\' $id2 = echo $env:username\\AppData\\Roaming\\Thunderbird\\Profiles\\$env:username.default\\ImapMail'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.root.imap-rel", "[ProfD]ImapMail");' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.root.none", "C:\\Users\\' $id2 = echo $env:username\\AppData\\Roaming\\Thunderbird\\Profiles\\$env:username.default\\Mail'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.root.none-rel", "[ProfD]Mail");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.cacheCapa.acl", false);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.cacheCapa.quota", false);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.canChangeStoreType", true);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.check_new_mail", true);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.server.server1.directory", "C:\\Users\\' $id2 = echo $env:username\\AppData\\Roaming\\Thunderbird\\Profiles\\$env:username.default\\ImapMail\\$imap'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.server.server1.directory-rel", "[ProfD]ImapMail/' $id2 = echo $imap'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.server.server1.hostname", "' $id2 = echo $imap'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.login_at_startup", true);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.max_cached_connections", 5);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.server.server1.name", "' $id2 = echo $env:username@$domain'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.port", 993);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.socketType", 3);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.server.server1.spamActionTargetAccount", "imap://' $id2 = echo $env:username%40$domain@$imap'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.storeContractID", "@mozilla.org/msgstore/berkeleystore;1");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server1.type", "imap");' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.server.server1.userName", "' $id2 = echo $env:username@$domain'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.server.server2.directory", "C:\\Users\\' $id2 = echo $env:username\\AppData\\Roaming\\Thunderbird\\Profiles\\$env:username.default\\Mail\\Local Folders'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server2.directory-rel", "[ProfD]Mail/Local Folders");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server2.hostname", "Local Folders");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server2.name", " ");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server2.storeContractID", "@mozilla.org/msgstore/berkeleystore;1");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server2.type", "none");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.server.server2.userName", "nobody");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.smtpserver.smtp1.authMethod", 3);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.smtpserver.smtp1.description", "mail.ru");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.smtpserver.smtp1.hostname", "smtp.mail.ru");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.smtpserver.smtp1.port", 465);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.smtpserver.smtp1.try_ssl", 3);' | out-file $file -encoding UTF8 -Append $id1 = echo 'user_pref("mail.smtpserver.smtp1.username", "' $id2 = echo $env:username@$domain'");' echo $id1$id2 | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.smtpservers", "smtp1");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.spam.version", 1);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.taskbar.lastgroupid", "8216C80C92C4E828");' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.ui-rdf.version", 15);' | out-file $file -encoding UTF8 -Append echo 'user_pref("mail.winsearch.firstRunDone", true);' | out-file $file -encoding UTF8 -Append
      
      





これで、Thunderbirdを起動すると、メールパスワードのみが要求されます。

このスクリプトは、imapサーバーimap.mail.ruで確実に機能します。 私は他の人とそれを試したことはありません、それを完了する必要があるかもしれません。







prefs.jsの生成中に、prefs.jsと同じフォルダーにあるsignature.htmファイルから署名を取得するように指示したことに気づいたかもしれません。 ここで署名を作成します。







メールの署名を設定します。



美しい署名を作成するには、署名を生成できるサービスが必要です。それに基づいて、ユーザーの署名を作成します。

mailsigサービス(ドット)を使用しました(広告ではありません)

同じHTMLで署名することもできますが、私は面倒でした。







出力はコードです







start.ps1に別の行を追加します







 powershell "\\domain.cn\NETLOGON\soft\signature.ps1" #   
      
      





もちろん、すべてを1つのファイルにすぐに配置することは可能ですが、残念なことに、すべてがその場所にある場合は気に入っています。 はい。ファイルが作成されたファイルと同じ名前で呼び出されると、理解しやすくなります。







signature.ps1
 #     AD $UserName = $env:username $Filter = "(&(objectCategory=User)(samAccountName=$UserName))" $Searcher = New-Object System.DirectoryServices.DirectorySearcher $Searcher.Filter = $Filter $ADUserPath = $Searcher.FindOne() $ADUser = $ADUserPath.GetDirectoryEntry() $ADDisplayName = $ADUser.DisplayName $ADEmailAddress = $ADUser.mail $ADInfo = $ADUser.otherMailbox $ADTitle = $ADUser.title $ADTelePhoneNumber = $ADUser.TelephoneNumber $ADipPhone = $ADUser.ipPhone $ADOffice = $ADUser.physicalDeliveryOfficeName #  $ADompany = $ADUser.company $ADOffice = $ADUser.physicalDeliveryOfficeName ############################################################################################################ $Site="http://mail.ru" $Logo="http://mail.ru/logo.png" #85*85px $Banner="http://mail.ru/banner.png" #440*58px !            (  ) $BannerSite="http://mail.ru/" #      . $Tel="84951234567" $Fax="84951234567" $Address=". ,   . 3" $signature = "$env:appdata\Thunderbird\Profiles\$env:username.default\signature.htm" #    $html = '<table border="0" cellpadding="0" cellspacing="0" style="margin:0;padding:0;width:440px;"><tr><td style="font-size:14px;line-height:16px;font-weight:bold;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:14px;line-height:16px;font-weight:bold;color:#333333;font-weight:bold;">'+$ADDisplayName+'</span></td></tr><tr><td style="font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;">'+$ADTitle+'</span></td></tr><tr><td style="height:7px;line-height:7px;"></td></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" style="margin:0;padding:0;width:440px;border-top-style:solid;border-top-width:2px;border-bottom-style:solid;border-bottom-width:2px;border-color:#1b5cbd"><tr><td colspan="3" style="height:8px;line-height:8px;"></td></tr><tr><td style="width:100px;min-height:85px;vertical-align:middle;border-right-style:solid;border-right-width:1px;border-right-color:#333333"><a href="'+$Site+'" target="_blank"><img src="'+$Logo+'" width="85" height="85" border="0" style="display:block;" nosend="1" alt=""/></a></td><td style="width: 15px;"></td><td style="width:325px;vertical-align:top;"><table border="0" cellpadding="0" cellspacing="0" style="margin:0;padding:0;width:325px;border:0 none;"><tr><td style="font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;font-weight: bold;">.: </span><a href="tel:'+$ADTelePhoneNumber+'" style="font-family:Verdana,Geneva,sans-serif;color:#333333 !important;text-decoration:none !important;font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;">'+$ADTelePhoneNumber+'</span></a></td></tr><tr><td style="font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;font-weight: bold;">Email: </span><a href="mailto:'+$ADEmailAddress+'" style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#1b5cbd !important;text-decoration:none !important;outline:none;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#1b5cbd !important;">'+$ADEmailAddress+'</span></a></td></tr><tr><td style="height:4px;line-height:4px;"></td></tr><tr><td style="font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;font-weight: bold;">'+$ADompany+'</span></td></tr><tr><td style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;">: </span><a href="tel:'+$Tel+'" style="font-family:Verdana,Geneva,sans-serif;color:#333333 !important;text-decoration:none !important;font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;">'+$Tel+'</span></a><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;"> / </span><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;">: '+$Fax+'</span></td></tr><tr><td style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;"><a href="https://yandex.ru/maps/?text='+$Address+'&l=map" style="font-family:Verdana,Geneva,sans-serif;color:#333333 !important;text-decoration:none !important;font-size:12px;line-height:14px;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#333333;">'+$Address+'  '+$ADOffice+'</span></a></td></tr><tr><td style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;"><a href="'+$Site+'" style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#0043a6 !important;text-decoration:none !important;outline:none;"><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;line-height:14px;color:#0043a6 !important;text-decoration:none !important;outline:none;">'+$Site+'</span></a></td></tr></table></td></tr><tr><td colspan="3" style="height:8px;line-height:8px;"></td></tr></table></td></tr><tr><td style="height:5px;line-height:5px;"> </td></tr><tr><td><a target="_blank" href="'+$BannerSite+'" style="display:block;width:440px;height:58px;"><img src="'+$Banner+'" width="440" height="58" alt="" border="0" nosend="1"/></a></td></tr><tr style="height: 4px;"><td style="height: 4px;line-height: 4px;"></td></tr><tr><td style="font-size: 10px;line-height: 11px;"></td></tr></table><span style="font-family:Verdana,Geneva,sans-serif;color:#000000;font-size: 10px;line-height: 11px;">        ,   .      ,        -,  .      ,  , ,           .      , ,                   .</br></br>The information contained in this communication is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It may contain confidential or legally privileged information. The contents may not be disclosed or used by anyone other than the addressee. If you are not the intended recipient(s), any use, disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you have received this communication in error please notify us immediately by responding to this email and then delete the e-mail and all attachments and any copies thereof.</span>' echo $html | out-file $signature -encoding UTF8
      
      





3つのファイルを取得する必要があります。

start.ps1-ユーザーがログインしたときに開始します。

new_prefs.ps1-Thunderbirdフォルダーにprefs.jsを作成します。

signature.ps1-メールに署名を作成します。







PowerShellのセキュリティ設定によっては、スクリプトが実行されない場合があります。 スクリプトにデジタル署名がないというエラーが表示された場合は、 このマニュアルを読んで問題を解決してください。








All Articles