PSGSuite kurulumu için öncelikle Google Console üzerinden bir proje oluşturmamız gerekmektedir. Proje oluşturulduktan sonra APIs & Services -> Credentials sekmesi altından servis hesabı oluşturacağız.
Create Credentials -> Service Account menüsüne giriş yapılır.
Service account için isim atanıp, create and continue diyerek devam ediyoruz,
Service accountumuz için bu proje üzerinde ne yetkisi vermemiz gerektiğini belirtiyoruz, Owner yektisi verip continue diyerek ilerleyelim,
Done diyerek hesabımızı oluşturma işlemini tamamlayalım.
Oluşturulan hesabın Action alanından Manage keys seçeneğine tıklayalım,
Add Key alanından, Create new key diyerek keyimizi oluşturalım.
Oluşturmuş olduğumuz keyimizi p12 formatında oluştur diyelim,
Close diyerek sayfamızı kapatalım,
Keys sekmesinden Details alanına giriş yapalım, Advanced Settings alanı altında bulunan ClientID mizi kopyalayalım, view google workspace admin console seçeneğine tıklayalım
Google Admin panelinden ekranda görüldüğü gibi domaine wide delegation sekmesi altında Manage Domain Wide Delegation seçeneğine giriş yapalım,
Add New seçeneğine tıklayip, Client ID bilgimizi bu alana yapıştıralım ve OAuth scopes alanına aşağıdaki scopelar için yetki tanımlayalım,
https://apps-apis.google.com/a/feeds/emailsettings/2.0/, https://mail.google.com/, https://sites.google.com/feeds, https://www.google.com/m8/feeds/contacts, https://www.googleapis.com/auth/activity, https://www.googleapis.com/auth/admin.datatransfer, https://www.googleapis.com/auth/admin.directory.customer, https://www.googleapis.com/auth/admin.directory.device.chromeos, https://www.googleapis.com/auth/admin.directory.device.mobile, https://www.googleapis.com/auth/admin.directory.domain, https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.orgunit, https://www.googleapis.com/auth/admin.directory.resource.calendar, https://www.googleapis.com/auth/admin.directory.rolemanagement, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly, https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.user.security, https://www.googleapis.com/auth/admin.directory.userschema, https://www.googleapis.com/auth/admin.reports.audit.readonly, https://www.googleapis.com/auth/admin.reports.usage.readonly, https://www.googleapis.com/auth/apps.groups.settings, https://www.googleapis.com/auth/apps.licensing, https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/chat.bot, https://www.googleapis.com/auth/classroom.announcements, https://www.googleapis.com/auth/classroom.courses, https://www.googleapis.com/auth/classroom.coursework.me, https://www.googleapis.com/auth/classroom.coursework.students, https://www.googleapis.com/auth/classroom.guardianlinks.students, https://www.googleapis.com/auth/classroom.profile.emails, https://www.googleapis.com/auth/classroom.profile.photos, https://www.googleapis.com/auth/classroom.push-notifications, https://www.googleapis.com/auth/classroom.rosters, https://www.googleapis.com/auth/classroom.rosters.readonly, https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/gmail.settings.basic, https://www.googleapis.com/auth/gmail.settings.sharing, https://www.googleapis.com/auth/plus.login, https://www.googleapis.com/auth/plus.me, https://www.googleapis.com/auth/tasks, https://www.googleapis.com/auth/tasks.readonly, https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/userinfo.profile
Virgülle ayrılmış alanlar şeklinde scope tanımlayip Authorize diyerek yetkilendirmemizi yapalım,
GSuite Admin panelinden ilgili yetkilendirme yapıldıktan sonra Google Cloud Platform sayfasından ilgili projemiz içerisinde APIs & Services alanından + Enable APIS and Services diyerek,
Aşağıdaki API’leri aktifleştirmemiz gerekiyor.
- Admin SDK
- Apps Activity API
- Contacts API
- Drive Activity API
- Enterprise License Manager API
- Gmail API
- Google Calendar API
- Google Classroom API
- Google Docs API
- Google Drive API
- Google Sheets API
- Google Slides API
- Groups Settings API
- Hangouts Chat API
- People API
- Tasks API
API leri aktifleştirdikten sonra GSuite sayfası üzerinden account settings bölümünden CustomerID bilgimizi alalım.
İşlemlerimiz tamamlandı artık PSGSuite modülümüzü yükleyip, işlemleri gerçekleştireceğimiz
Install-Module Configuration Install-Module -Name PSGSuite Import-Module PSGSuite
Modül kurulumları gerçekleştirildikten sonra PSGSuite için konfigurasyon dosyası oluşturmamız gerekmektedir. Aşağıdaki işlemleri gerçekleştirdikten sonra scriptimizi bir kere çalıştırmamız yeterli olacaktır.
$ConfigName = "GSuite" $P12KeyPath = "C:\PSGSuite\psgsuite-xxxxxxxxxxxxxxxxxxx.p12" #keyfile $AppEmail = "psgsuite@xxxxxxxxxxxxxxxxxxxx.iam.gxxxx.com" #serviceaccount $AdminEmail = "admin@babur.com" #yetkili mail bilgisi $CustomerID = "461Xxxxx" #customerid $Domain = "babur.com" #domain bilgisi $ServiceAccountClientID = "xxxxx465646465" #clientid bilgisi Set-PSGSuiteConfig -ConfigName $ConfigName ` -P12KeyPath $P12KeyPath -AppEmail $AppEmail ` -AdminEmail $AdminEmail -CustomerID $CustomerID ` -Domain $Domain -ServiceAccountClientID $ServiceAccountClientID
İşlem gerçekleştirildikten sonra ilk deneme cmdletimiz ile tüm kullanıcılarımızı çekelim,
Get-GSUserList | Select User
Kullanılabilecek komutları aşağıdaki şekilde listeleyebiliriz,
Get-Command -Module PSGSuite CommandType Name Version Source ----------- ---- ------- ------ Alias Add-GSDriveFilePermissions 2.36.4 PSGSuite Alias Export-PSGSuiteConfiguration 2.36.4 PSGSuite Alias Get-GSCalendarEventList 2.36.4 PSGSuite Alias Get-GSCalendarResourceList 2.36.4 PSGSuite Alias Get-GSDataTransferApplicationList 2.36.4 PSGSuite Alias Get-GSDriveFileInfo 2.36.4 PSGSuite Alias Get-GSDriveFilePermissionsList 2.36.4 PSGSuite Alias Get-GSGmailDelegates 2.36.4 PSGSuite Alias Get-GSGmailFilterList 2.36.4 PSGSuite Alias Get-GSGmailLabelList 2.36.4 PSGSuite Alias Get-GSGmailMessageInfo 2.36.4 PSGSuite Alias Get-GSGmailSendAsSettings 2.36.4 PSGSuite Alias Get-GSGmailSignature 2.36.4 PSGSuite Alias Get-GSGroupList 2.36.4 PSGSuite Alias Get-GSGroupMemberList 2.36.4 PSGSuite Alias Get-GSMobileDeviceList 2.36.4 PSGSuite Alias Get-GSOrganizationalUnitList 2.36.4 PSGSuite Alias Get-GSOrgUnit 2.36.4 PSGSuite Alias Get-GSOrgUnitList 2.36.4 PSGSuite Alias Get-GSOU 2.36.4 PSGSuite Alias Get-GSResourceList 2.36.4 PSGSuite Alias Get-GSTeamDrive 2.36.4 PSGSuite Alias Get-GSTeamDrivesList 2.36.4 PSGSuite Alias Get-GSUserASPList 2.36.4 PSGSuite Alias Get-GSUserLicenseInfo 2.36.4 PSGSuite Alias Get-GSUserLicenseList 2.36.4 PSGSuite Alias Get-GSUserList 2.36.4 PSGSuite Alias Get-GSUserSchemaInfo 2.36.4 PSGSuite Alias Get-GSUserSchemaList 2.36.4 PSGSuite Alias Get-GSUserTokenList 2.36.4 PSGSuite Alias Import-PSGSuiteConfiguration 2.36.4 PSGSuite Alias Move-GSGmailMessageToTrash 2.36.4 PSGSuite Alias New-GSCalendarResource 2.36.4 PSGSuite Alias New-GSTeamDrive 2.36.4 PSGSuite Alias Remove-GSGmailMessageFromTrash 2.36.4 PSGSuite Alias Remove-GSTeamDrive 2.36.4 PSGSuite Alias Set-PSGSuiteDefaultDomain 2.36.4 PSGSuite Alias Switch-PSGSuiteDomain 2.36.4 PSGSuite Alias Update-GSCalendarResource 2.36.4 PSGSuite Alias Update-GSGmailSendAsSettings 2.36.4 PSGSuite Alias Update-GSSheetValue 2.36.4 PSGSuite Alias Update-GSTeamDrive 2.36.4 PSGSuite Function Add-GSCalendarEventReminder 2.36.4 PSGSuite Function Add-GSCalendarNotification 2.36.4 PSGSuite Function Add-GSCalendarSubscription 2.36.4 PSGSuite Function Add-GSChatButton 2.36.4 PSGSuite Function Add-GSChatCard 2.36.4 PSGSuite Function Add-GSChatCardAction 2.36.4 PSGSuite Function Add-GSChatCardSection 2.36.4 PSGSuite Function Add-GSChatImage 2.36.4 PSGSuite Function Add-GSChatKeyValue 2.36.4 PSGSuite Function Add-GSChatOnClick 2.36.4 PSGSuite Function Add-GSChatTextParagraph 2.36.4 PSGSuite Function Add-GSCourseParticipant 2.36.4 PSGSuite Function Add-GSCustomerPostalAddress 2.36.4 PSGSuite Function Add-GSDocContent 2.36.4 PSGSuite Function Add-GSDrivePermission 2.36.4 PSGSuite Function Add-GSEventAttendee 2.36.4 PSGSuite Function Add-GSGmailDelegate 2.36.4 PSGSuite Function Add-GSGmailFilter 2.36.4 PSGSuite Function Add-GSGmailForwardingAddress 2.36.4 PSGSuite Function Add-GSGmailSmtpMsa 2.36.4 PSGSuite Function Add-GSGroupMember 2.36.4 PSGSuite Function Add-GSPrincipalGroupMembership 2.36.4 PSGSuite Function Add-GSSheetValues 2.36.4 PSGSuite Function Add-GSUserAddress 2.36.4 PSGSuite Function Add-GSUserEmail 2.36.4 PSGSuite Function Add-GSUserExternalId 2.36.4 PSGSuite Function Add-GSUserIm 2.36.4 PSGSuite Function Add-GSUserLocation 2.36.4 PSGSuite Function Add-GSUserOrganization 2.36.4 PSGSuite Function Add-GSUserPhone 2.36.4 PSGSuite Function Add-GSUserRelation 2.36.4 PSGSuite Function Add-GSUserSchemaField 2.36.4 PSGSuite Function Block-CoreCLREncryptionWarning 2.36.4 PSGSuite Function Clear-GSSheet 2.36.4 PSGSuite Function Clear-PSGSuiteServiceCache 2.36.4 PSGSuite Function Compare-ModuleVersion 2.36.4 PSGSuite Function Confirm-GSCourseInvitation 2.36.4 PSGSuite Function Copy-GSDriveFile 2.36.4 PSGSuite Function Copy-GSSheet 2.36.4 PSGSuite Function Export-GSDriveFile 2.36.4 PSGSuite Function Export-GSSheet 2.36.4 PSGSuite Function Export-PSGSuiteConfig 2.36.4 PSGSuite Function Get-GSActivityReport 2.36.4 PSGSuite Function Get-GSAdminRole 2.36.4 PSGSuite Function Get-GSAdminRoleAssignment 2.36.4 PSGSuite Function Get-GSCalendar 2.36.4 PSGSuite Function Get-GSCalendarAcl 2.36.4 PSGSuite Function Get-GSCalendarEvent 2.36.4 PSGSuite Function Get-GSCalendarSubscription 2.36.4 PSGSuite Function Get-GSChatConfig 2.36.4 PSGSuite Function Get-GSChatMember 2.36.4 PSGSuite Function Get-GSChatMessage 2.36.4 PSGSuite Function Get-GSChatSpace 2.36.4 PSGSuite Function Get-GSChromeOSDevice 2.36.4 PSGSuite Function Get-GSClassroomUserProfile 2.36.4 PSGSuite Function Get-GSContactList 2.36.4 PSGSuite Function Get-GSCourse 2.36.4 PSGSuite Function Get-GSCourseAlias 2.36.4 PSGSuite Function Get-GSCourseInvitation 2.36.4 PSGSuite Function Get-GSCourseParticipant 2.36.4 PSGSuite Function Get-GSCustomer 2.36.4 PSGSuite Function Get-GSDataTransfer 2.36.4 PSGSuite Function Get-GSDataTransferApplication 2.36.4 PSGSuite Function Get-GSDocContent 2.36.4 PSGSuite Function Get-GSDomain 2.36.4 PSGSuite Function Get-GSDomainAlias 2.36.4 PSGSuite Function Get-GSDrive 2.36.4 PSGSuite Function Get-GSDriveFile 2.36.4 PSGSuite Function Get-GSDriveFileList 2.36.4 PSGSuite Function Get-GSDriveFileUploadStatus 2.36.4 PSGSuite Function Get-GSDriveFolderSize 2.36.4 PSGSuite Function Get-GSDrivePermission 2.36.4 PSGSuite Function Get-GSDriveProfile 2.36.4 PSGSuite Function Get-GSDriveRevision 2.36.4 PSGSuite Function Get-GSGmailAutoForwardingSettings 2.36.4 PSGSuite Function Get-GSGmailDelegate 2.36.4 PSGSuite Function Get-GSGmailFilter 2.36.4 PSGSuite Function Get-GSGmailForwardingAddress 2.36.4 PSGSuite Function Get-GSGmailImapSettings 2.36.4 PSGSuite Function Get-GSGmailLabel 2.36.4 PSGSuite Function Get-GSGmailLanguageSettings 2.36.4 PSGSuite Function Get-GSGmailMessage 2.36.4 PSGSuite Function Get-GSGmailMessageList 2.36.4 PSGSuite Function Get-GSGmailPopSettings 2.36.4 PSGSuite Function Get-GSGmailProfile 2.36.4 PSGSuite Function Get-GSGmailSendAsAlias 2.36.4 PSGSuite Function Get-GSGmailSMIMEInfo 2.36.4 PSGSuite Function Get-GSGmailVacationSettings 2.36.4 PSGSuite Function Get-GSGroup 2.36.4 PSGSuite Function Get-GSGroupAlias 2.36.4 PSGSuite Function Get-GSGroupMember 2.36.4 PSGSuite Function Get-GSGroupSettings 2.36.4 PSGSuite Function Get-GSMobileDevice 2.36.4 PSGSuite Function Get-GSOrganizationalUnit 2.36.4 PSGSuite Function Get-GSResource 2.36.4 PSGSuite Function Get-GSSheetInfo 2.36.4 PSGSuite Function Get-GSStudentGuardian 2.36.4 PSGSuite Function Get-GSStudentGuardianInvitation 2.36.4 PSGSuite Function Get-GSToken 2.36.4 PSGSuite Function Get-GSUsageReport 2.36.4 PSGSuite Function Get-GSUser 2.36.4 PSGSuite Function Get-GSUserAlias 2.36.4 PSGSuite Function Get-GSUserASP 2.36.4 PSGSuite Function Get-GSUserLicense 2.36.4 PSGSuite Function Get-GSUserPhoto 2.36.4 PSGSuite Function Get-GSUserSchema 2.36.4 PSGSuite Function Get-GSUserToken 2.36.4 PSGSuite Function Get-GSUserVerificationCodes 2.36.4 PSGSuite Function Get-PSGSuiteConfig 2.36.4 PSGSuite Function Get-PSGSuiteServiceCache 2.36.4 PSGSuite Function Hide-GSDrive 2.36.4 PSGSuite Function Import-GSSheet 2.36.4 PSGSuite Function Import-PSGSuiteConfig 2.36.4 PSGSuite Function Invoke-GSUserOffboarding 2.36.4 PSGSuite Function New-GoogleService 2.36.4 PSGSuite Function New-GSAdminRole 2.36.4 PSGSuite Function New-GSAdminRoleAssignment 2.36.4 PSGSuite Function New-GSCalendarAcl 2.36.4 PSGSuite Function New-GSCalendarEvent 2.36.4 PSGSuite Function New-GSCourse 2.36.4 PSGSuite Function New-GSCourseAlias 2.36.4 PSGSuite Function New-GSCourseInvitation 2.36.4 PSGSuite Function New-GSDomain 2.36.4 PSGSuite Function New-GSDomainAlias 2.36.4 PSGSuite Function New-GSDrive 2.36.4 PSGSuite Function New-GSDriveFile 2.36.4 PSGSuite Function New-GSGmailLabel 2.36.4 PSGSuite Function New-GSGmailSendAsAlias 2.36.4 PSGSuite Function New-GSGmailSMIMEInfo 2.36.4 PSGSuite Function New-GSGroup 2.36.4 PSGSuite Function New-GSGroupAlias 2.36.4 PSGSuite Function New-GSOrganizationalUnit 2.36.4 PSGSuite Function New-GSResource 2.36.4 PSGSuite Function New-GSSheet 2.36.4 PSGSuite Function New-GSStudentGuardianInvitation 2.36.4 PSGSuite Function New-GSUser 2.36.4 PSGSuite Function New-GSUserAlias 2.36.4 PSGSuite Function New-GSUserSchema 2.36.4 PSGSuite Function New-GSUserVerificationCodes 2.36.4 PSGSuite Function Remove-GSAdminRole 2.36.4 PSGSuite Function Remove-GSAdminRoleAssignment 2.36.4 PSGSuite Function Remove-GSCalendarAcl 2.36.4 PSGSuite Function Remove-GSCalendarEvent 2.36.4 PSGSuite Function Remove-GSCalendarSubscription 2.36.4 PSGSuite Function Remove-GSChatMessage 2.36.4 PSGSuite Function Remove-GSContact 2.36.4 PSGSuite Function Remove-GSCourse 2.36.4 PSGSuite Function Remove-GSCourseAlias 2.36.4 PSGSuite Function Remove-GSCourseInvitation 2.36.4 PSGSuite Function Remove-GSCourseParticipant 2.36.4 PSGSuite Function Remove-GSDomain 2.36.4 PSGSuite Function Remove-GSDomainAlias 2.36.4 PSGSuite Function Remove-GSDrive 2.36.4 PSGSuite Function Remove-GSDriveFile 2.36.4 PSGSuite Function Remove-GSDrivePermission 2.36.4 PSGSuite Function Remove-GSDriveRevision 2.36.4 PSGSuite Function Remove-GSGmailDelegate 2.36.4 PSGSuite Function Remove-GSGmailFilter 2.36.4 PSGSuite Function Remove-GSGmailLabel 2.36.4 PSGSuite Function Remove-GSGmailMessage 2.36.4 PSGSuite Function Remove-GSGmailSendAsAlias 2.36.4 PSGSuite Function Remove-GSGmailSMIMEInfo 2.36.4 PSGSuite Function Remove-GSGroup 2.36.4 PSGSuite Function Remove-GSGroupAlias 2.36.4 PSGSuite Function Remove-GSGroupMember 2.36.4 PSGSuite Function Remove-GSMobileDevice 2.36.4 PSGSuite Function Remove-GSOrganizationalUnit 2.36.4 PSGSuite Function Remove-GSPrincipalGroupMembership 2.36.4 PSGSuite Function Remove-GSResource 2.36.4 PSGSuite Function Remove-GSStudentGuardian 2.36.4 PSGSuite Function Remove-GSUser 2.36.4 PSGSuite Function Remove-GSUserAlias 2.36.4 PSGSuite Function Remove-GSUserASP 2.36.4 PSGSuite Function Remove-GSUserLicense 2.36.4 PSGSuite Function Remove-GSUserPhoto 2.36.4 PSGSuite Function Remove-GSUserSchema 2.36.4 PSGSuite Function Remove-GSUserToken 2.36.4 PSGSuite Function Restore-GSGmailMessage 2.36.4 PSGSuite Function Restore-GSUser 2.36.4 PSGSuite Function Revoke-GSStudentGuardianInvitation 2.36.4 PSGSuite Function Revoke-GSUserVerificationCodes 2.36.4 PSGSuite Function Send-GmailMessage 2.36.4 PSGSuite Function Send-GSChatMessage 2.36.4 PSGSuite Function Send-GSGmailSendAsConfirmation 2.36.4 PSGSuite Function Set-GSDocContent 2.36.4 PSGSuite Function Set-GSGroupSettings 2.36.4 PSGSuite Function Set-GSUserLicense 2.36.4 PSGSuite Function Set-GSUserSchema 2.36.4 PSGSuite Function Set-PSGSuiteConfig 2.36.4 PSGSuite Function Show-GSDrive 2.36.4 PSGSuite Function Show-PSGSuiteConfig 2.36.4 PSGSuite Function Start-GSDataTransfer 2.36.4 PSGSuite Function Start-GSDriveFileUpload 2.36.4 PSGSuite Function Stop-GSDriveFileUpload 2.36.4 PSGSuite Function Switch-PSGSuiteConfig 2.36.4 PSGSuite Function Sync-GSUserCache 2.36.4 PSGSuite Function Test-GSGroupMembership 2.36.4 PSGSuite Function Unblock-CoreCLREncryptionWarning 2.36.4 PSGSuite Function Update-GSAdminRole 2.36.4 PSGSuite Function Update-GSCalendarEvent 2.36.4 PSGSuite Function Update-GSCalendarSubscription 2.36.4 PSGSuite Function Update-GSChatMessage 2.36.4 PSGSuite Function Update-GSChromeOSDevice 2.36.4 PSGSuite Function Update-GSCourse 2.36.4 PSGSuite Function Update-GSCustomer 2.36.4 PSGSuite Function Update-GSDrive 2.36.4 PSGSuite Function Update-GSDriveFile 2.36.4 PSGSuite Function Update-GSDriveRevision 2.36.4 PSGSuite Function Update-GSGmailAutoForwardingSettings 2.36.4 PSGSuite Function Update-GSGmailImapSettings 2.36.4 PSGSuite Function Update-GSGmailLabel 2.36.4 PSGSuite Function Update-GSGmailLanguageSettings 2.36.4 PSGSuite Function Update-GSGmailMessageLabels 2.36.4 PSGSuite Function Update-GSGmailPopSettings 2.36.4 PSGSuite Function Update-GSGmailSendAsAlias 2.36.4 PSGSuite Function Update-GSGmailSignature 2.36.4 PSGSuite Function Update-GSGmailVacationSettings 2.36.4 PSGSuite Function Update-GSGroupMember 2.36.4 PSGSuite Function Update-GSGroupSettings 2.36.4 PSGSuite Function Update-GSMobileDevice 2.36.4 PSGSuite Function Update-GSOrganizationalUnit 2.36.4 PSGSuite Function Update-GSResource 2.36.4 PSGSuite Function Update-GSUser 2.36.4 PSGSuite Function Update-GSUserLicense 2.36.4 PSGSuite Function Update-GSUserPhoto 2.36.4 PSGSuite Function Update-GSUserSchema 2.36.4 PSGSuite Function Watch-GSDriveUpload 2.36.4 PSGSuite