신입 사원과 리소스 공유
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
코딩 수준: 초급
소요 시간: 20분
프로젝트 유형: 이벤트 기반 트리거를 사용한 자동화
목표
- 솔루션의 기능을 이해합니다.
- 솔루션 내에서 Apps Script 서비스가 하는 역할을 이해합니다.
- 스크립트를 설정합니다.
- 스크립트를 실행합니다.
이 솔루션 정보
중요: 이 솔루션을 사용하려면 Google Workspace 관리자여야 합니다.
신규 직원과 리소스를 한 단계로 공유하세요. 이 솔루션은 Google Forms의 양식을 사용하여 Google 그룹의 그룹에 새 직원을 추가합니다. 해당 그룹의 주소와 리소스를 공유하면 신규 직원이 필요한 리소스에 쉽게 액세스할 수 있습니다.
그룹에 사용자를 추가할 권한이 있는 경우 이 솔루션을 사용하여 팀의 다른 구성원에게 책임을 분배할 수 있습니다. 사용자가 양식을 제출하면 이벤트 기반 트리거가 사용자로 스크립트를 실행하고 새 사용자의 이메일을 그룹에 추가합니다.
원하는 경우 누군가 양식을 제출할 때마다 이메일을 받도록 알림을 사용 설정할 수 있습니다.

작동 방식
사용자의 이메일과 사용자가 추가되어야 하는 그룹을 사용하여 누군가 양식을 제출하면 스크립트에서 해당 사용자가 이미 해당 그룹에 속해 있는지 확인합니다. 이미 그룹에 속해 있는 경우 사용자에게 그룹에 이미 속해 있음을 확인하는 이메일이 전송됩니다. 그렇지 않으면 스크립트가 사용자를 그룹에 추가하고 환영 이메일을 전송합니다.
Apps Script 서비스
이 솔루션은 다음 서비스를 사용합니다.
- 스크립트 서비스: 누군가 양식을 제출할 때마다 스크립트를 실행하는 트리거를 만듭니다.
- Groups 서비스–양식에 제출된 이메일이 이미 그룹의 회원인지 확인합니다.
- Admin SDK 디렉터리 고급 서비스 - 양식에 제출된 이메일을 그룹에 추가합니다.
- 메일 서비스: 그룹 회원 자격을 확인하거나 그룹 가입을 환영하기 위해 양식에 제출된 이메일 주소로 이메일을 보냅니다.
- 스프레드시트 서비스: 사용자의 상태를 양식 응답 스프레드시트에 추가합니다. 상태는 이미 그룹에 있음 또는 새로 추가됨입니다.
- URL 가져오기 서비스: Google Docs 문서를 HTML 문자열로 가져옵니다. 문서에는 스크립트가 전송하는 이메일의 콘텐츠가 포함됩니다.
기본 요건
스크립트 설정
다음 버튼을 클릭하여 신입 사원과 리소스 공유 스프레드시트를 복사합니다. 이 솔루션의 Apps Script 프로젝트가 스프레드시트에 첨부되어 있습니다.
사본 만들기
확장 프로그램 > Apps Script를 클릭합니다.
서비스에서 AdminDirectory 서비스가 나열되어 있는지 확인합니다. 그렇다면 6단계로 건너뜁니다. 아니라면 다음 단계로 진행합니다.
서비스 옆에 있는 서비스 추가 add를 클릭합니다.
대화상자에서 Admin SDK API를 선택하고 추가를 클릭합니다.
함수 드롭다운에서 installTrigger를 선택합니다.
실행을 클릭합니다.
메시지가 표시되면 스크립트를 승인합니다.
OAuth 동의 화면에 이 앱은 인증되지 않았습니다라는 경고가 표시되면 고급 >
{프로젝트 이름} (안전하지 않음)으로 이동을 선택하여 계속합니다.
중요: 이 함수를 두 번 이상 실행하면 트리거가 여러 개 생성되어 이메일이 중복으로 전송됩니다. 추가 트리거를 삭제하려면 다음 단계를 따르세요.
- 트리거
을 클릭합니다.
- 트리거 옆에 있는 더보기
> 트리거 삭제를 클릭합니다.
스크립트 실행
- 스프레드시트로 돌아가 도구
> 양식 관리
> 실시간 양식으로 이동을 클릭합니다.
- 이메일 주소와 회원 자격을 관리할 권한이 있는 그룹을 사용하여 양식을 작성하고 제출을 클릭합니다.
- 스프레드시트로 돌아가 양식 항목을 확인합니다. 상태 열에는 이메일 주소가 그룹에 추가되었는지 또는 이미 그룹의 회원인지가 표시됩니다.
- 이메일에서 환영 이메일 또는 그룹 회원 자격 확인 이메일을 확인합니다.
참여자
이 샘플은 Google Developer Expert의 도움을 받아 Google에서 유지관리합니다.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eThis solution allows Google Workspace administrators to easily share resources with new employees by automatically adding them to a Google Group.\u003c/p\u003e\n"],["\u003cp\u003eThe script uses an event-driven trigger to add new employees to a group when their information is submitted via a Google Form.\u003c/p\u003e\n"],["\u003cp\u003eThe script utilizes various Apps Script services including Groups, Admin SDK Directory, Mail, and Spreadsheet to manage group memberships and communicate with users.\u003c/p\u003e\n"],["\u003cp\u003eSetup requires copying a spreadsheet, enabling the AdminDirectory service, and authorizing the script to run.\u003c/p\u003e\n"],["\u003cp\u003eRunning the script involves submitting a form with the new employee's email and desired group, triggering the automatic addition and email notifications.\u003c/p\u003e\n"]]],["This solution automates sharing resources with new hires using Google Workspace. It utilizes a Google Form submission to trigger a script that adds new employees to a specified Google Group. The script checks for existing membership, adds the user if necessary, and sends either a welcome or confirmation email. It leverages Apps Script services, including Script, Groups, Admin SDK Directory, Mail, Spreadsheet, and URL Fetch to manage triggers, check group membership, add users, send emails, and update form response spreadsheet with user status.\n"],null,["# Share resources with new hires\n\n**Coding level** : Beginner \n\n**Duration** : 20 minutes \n\n**Project type** : Automation with an [event-driven trigger](/apps-script/guides/triggers/installable#event-driven_triggers)\n\nObjectives\n----------\n\n- Understand what the solution does.\n- Understand what the Apps Script services do within the solution.\n- Set up the script.\n- Run the script.\n\nAbout this solution\n-------------------\n\n**Important**: You must be a Google Workspace Administrator to use this\nsolution.\n\nShare resources with incoming employees in one step. This solution uses a form\nin Google Forms to add new employees to a group in Google Groups. By sharing\nresources with that group's address, you can easily give new hires access to the\nresources they need.\n\nIf you have permission to add users to a group, you can use this solution to\ndistribute the responsibility to other members of your team. When they submit\nthe form, the event-driven trigger runs the script as you and adds the new\nperson's email to the group.\n\nOptionally, you can turn on notifications to [get an email every time someone\nsubmits the form](https://support.google.com/a/users/answer/9308874).\n\n### How it works\n\nWhen someone submits a form with a user's email and the group the user should be\nadded to, the script checks whether or not the person already belongs to that\ngroup. If they do, the user receives an email confirming that they're already in\nthe group. Otherwise, the script adds the user to the group and sends them a\nwelcome email.\n\n### Apps Script services\n\nThis solution uses the following services:\n\n- [Script service](/apps-script/reference/script)--Creates the trigger that fires the script each time someone submits a form.\n- [Groups service](/apps-script/reference/groups)--Checks whether the email submitted on the form is already a member of the group.\n- [Admin SDK Directory advanced service](/apps-script/advanced/admin-sdk-directory)--Adds the email submitted on the form to the group.\n- [Mail service](/apps-script/reference/mail)--Sends an email to the email address submitted on the form to either confirm their group membership or welcome them to the group.\n- [Spreadsheet service](/apps-script/reference/spreadsheet)--Adds the user's status to the form responses spreadsheet. The status is either **Already in\n group** or **Newly added**.\n- [URL Fetch service](/apps-script/reference/url-fetch)--Fetches a Google Docs document as an HTML string. The document contains the content of the email that the script sends.\n\nPrerequisites\n-------------\n\n- A [Google Workspace account](https://workspace.google.com/features/)\n- You must be a Google Workspace Administrator\n\nSet up the script\n-----------------\n\n1. Click the following button to copy the **Share resources with new hires**\n spreadsheet. The Apps Script\n project for this solution is attached to the spreadsheet.\n\n [Make a copy](https://docs.google.com/spreadsheets/d/1IK9nIanIOxInnvUtaY9lsXHAqokkA9xqcC43VRxQ-fo/copy?usp=sharing)\n\n2. Click **Extensions** \\\u003e **Apps Script**.\n\n3. Under **Services** , make sure the **AdminDirectory** service is\n listed. If it is, skip to step 6. If it's not, continue to the next step.\n\n4. Next to **Services** , click Add a service add.\n\n5. In the dialog, select **Admin SDK API** and click **Add**.\n\n6. In the function dropdown, select **installTrigger**.\n\n7. Click **Run**.\n\n8. When prompted, authorize the script.\n If the OAuth consent screen displays the warning, **This app isn't verified** ,\n continue by selecting **Advanced** \\\u003e\n **Go to {Project Name} (unsafe)**.\n\n**Important**: If you run this function more than once, it generates multiple\ntriggers and will send duplicate emails. To delete extra triggers, take the\nfollowing steps:\n\n1. Click **Triggers** .\n2. Next to the trigger, click More \\\u003e **Delete trigger**.\n\nRun the script\n--------------\n\n1. Return to the spreadsheet and click **Tools** \\\u003e **Manage form** \\\u003e **Go to live form**.\n2. Fill out the form with your email address and a group that you have permission to manage the membership for and click **Submit**.\n3. Return to the spreadsheet and view the form entry. The status column shows whether your email address was added to or already a member of the group.\n4. Check your email for either a welcome email or confirmation of your group membership.\n\nContributors\n------------\n\nThis sample is maintained by Google with the help of Google Developer Experts.\n\nNext steps\n----------\n\n- [Event-driven triggers](/apps-script/guides/triggers/installable#event-driven_triggers)\n- [Extend Google Sheets](/apps-script/guides/sheets)"]]