Yönetici SDK'sı Gruplar Taşıma Hizmeti
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Yönetici SDK'sı Gruplar Taşıma hizmeti, Apps Script'te Yönetici SDK'sının Gruplar Taşıma API'sini kullanmanıza olanak tanır. Bu API, Google Workspace alanlarının yöneticilerine (bayiler dahil) ortak klasörlerdeki ve dağıtım listelerindeki e-postaları Google Gruplar tartışma arşivlerine taşıma olanağı tanır.
Referans
Bu hizmet hakkında ayrıntılı bilgi için Yönetici SDK'sı Groups Migration API'nin referans belgelerine bakın. Apps Script'teki tüm gelişmiş hizmetler gibi, Admin SDK Grupları Taşıma hizmeti de genel API ile aynı nesneleri, yöntemleri ve parametreleri kullanır. Daha fazla bilgi için Yöntem imzaları nasıl belirlenir? başlıklı makaleyi inceleyin.
Sorunları bildirmek ve diğer destek seçeneklerini öğrenmek için Admin SDK Groups Migration destek kılavuzuna bakın.
Örnek kod
Aşağıdaki örnek kodda API'nin 1. sürümü kullanılmaktadır.
E-postaları Gmail'den Google Grubu'na taşıma
Bu örnek, kullanıcının Gmail gelen kutusundaki son üç ileti dizisinden RFC 822 biçimli üç ileti alır, e-posta içeriğinden (ekler dahil) bir blob oluşturur ve bunu alandaki bir Google Grubu'na ekler.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-31 UTC.
[null,null,["Son güncelleme tarihi: 2025-08-31 UTC."],[[["\u003cp\u003eThe Admin SDK Groups Migration service enables administrators to migrate emails from public folders and distribution lists to Google Groups using Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eThis advanced service requires prior enabling in Google Workspace domains (including resellers) before use.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage the Admin SDK Groups Migration API to programmatically manage email migration workflows.\u003c/p\u003e\n"],["\u003cp\u003eSample code provided demonstrates how to migrate RFC 822 formatted emails from Gmail to a designated Google Group.\u003c/p\u003e\n"],["\u003cp\u003eComprehensive documentation and support resources are available to guide developers in utilizing the service effectively.\u003c/p\u003e\n"]]],[],null,["# Admin SDK Groups Migration Service\n\nThe Admin SDK Groups Migration service allows you to use the Admin SDK's\n[Groups Migration API](/admin-sdk/groups-migration) in Apps Script. This\nAPI gives administrators of Google Workspace domains\n(including resellers) the\nability to migrate emails from public folders and distribution lists to\nGoogle Groups discussion archives.\n| **Note:** This is an advanced service that must be [enabled before use](/apps-script/guides/services/advanced).\n\nReference\n---------\n\nFor detailed information on this service, see the\n[reference documentation](/admin-sdk/groups-migration/v1/reference)\nfor the Admin SDK Groups Migration API. Like all advanced services in Apps\nScript, the Admin SDK Groups Migration service uses the same objects, methods,\nand parameters as the public API. For more information, see [How method signatures are determined](/apps-script/guides/services/advanced#how_method_signatures_are_determined).\n\nTo report issues and find other support, see the\n[Admin SDK Groups Migration support guide](/admin-sdk/groups-migration/support).\n\nSample code\n-----------\n\nThe sample code below uses [version 1](/admin-sdk/groups-migration/v1/reference)\nof the API.\n\n### Migrate emails from Gmail to a Google Group\n\nThis sample gets three RFC 822 formatted messages from the each of the latest\nthree threads in the user's Gmail inbox, creates a blob from the email content\n(including attachments), and inserts it in a Google Group in the domain. \nadvanced/adminSDK.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/advanced/adminSDK.gs) \n\n```javascript\n/**\n * Gets three RFC822 formatted messages from the each of the latest three\n * threads in the user's Gmail inbox, creates a blob from the email content\n * (including attachments), and inserts it in a Google Group in the domain.\n */\nfunction migrateMessages() {\n // TODO (developer) - Replace groupId value with yours\n const groupId = 'exampleGroup@example.com';\n const messagesToMigrate = getRecentMessagesContent();\n for (const messageContent of messagesToMigrate) {\n const contentBlob = Utilities.newBlob(messageContent, 'message/rfc822');\n AdminGroupsMigration.Archive.insert(groupId, contentBlob);\n }\n}\n\n/**\n * Gets a list of recent messages' content from the user's Gmail account.\n * By default, fetches 3 messages from the latest 3 threads.\n *\n * @return {Array} the messages' content.\n */\nfunction getRecentMessagesContent() {\n const NUM_THREADS = 3;\n const NUM_MESSAGES = 3;\n const threads = GmailApp.getInboxThreads(0, NUM_THREADS);\n const messages = GmailApp.getMessagesForThreads(threads);\n const messagesContent = [];\n for (let i = 0; i \u003c messages.length; i++) {\n for (let j = 0; j \u003c NUM_MESSAGES; j++) {\n const message = messages[i][j];\n if (message) {\n messagesContent.push(message.getRawContent());\n }\n }\n }\n return messagesContent;\n}\n```"]]