豆子最近有个新的项目 须要迁移500多个GSuite的帐号到 Office365里面。PowerShell Gallery已经提供了相关的Gsuite 的模块进行下载。可是Google Admin初始化的配置比Office365 麻烦多了,并且网上的wiki资料过期了,界面彻底对应不上。shell
官网说明,可是这个资料是去年更新的,界面不少地方都对不上号了
https://psgsuite.io/安全
下面看看如何实现。app
首先下载PS的模块,微软半年前升级他的安全标准以后,PS5 默认的 Tls1 已经不支持了,所以我须要手动指定安全协议是 tls2ide
登录 Google API测试
根据提示下一步ui
选择 service account3d
建立新的 service accountcode
输入相关信息blog
Role 选择 Ownerget
Done
Add Key
选择 P12的格式下载
记录一下帐号
Enable service account
而后去 GSuite 的 Security 里面 添加一个新的app
而后在 SSO里面查看一下customer id
最后链接一下
测试一下
$groups=Get-GSGroup foreach($group in $groups){ #$group | select $email=$group.Email write-host $name -ForegroundColor Cyan Get-GSGroupMember -Identity $email | select Group, Email, kind, status | ft -AutoSize } $users=Get-GSUser -Filter * $users | measure $date=(get-date).AddDays(-30) $demo=$users | Where-Object {$_.LastLoginTime -lt $date} $demo | select user,creationtime, lastlogintime | sort lastlogintime -Descending