This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
目前无法使用 GAM 获取网站的已发布 URL。 GAM 依赖于 Google 的 API,并且没有可用于新站点的 API:
尽管 Google 一再保证新协作平台能够实现经典协作平台所做的一切,但七年的时间只是众多未填补的空白之一。
如果您只对具有“自定义网址”的网站感兴趣,可以在 Google Workspace 管理员中的“应用”→“Google Workspace”→“网站”→“自定义网址”下轻松查看这些网站:
如果您愿意知道对于所有网站,据我所知没有好的解决方案。一种可能的解决方法是让自己使用 GAM 访问每个站点,然后手动或使用某种 RPA 或浏览器脚本工具检查每个站点。
在开始此路径之前,请生成域中所有网站的列表并将其导出到 Google 表格(结果的数量可能会帮助您决定实现此想法的程度):
提示:缩小此命令以及此处列出的所有其他 GAM 命令的范围,您可能需要将
所有用户
替换为ou“OU/Sub-OU”
,或者您可以审核通过将用户添加到名为 [电子邮件受保护] 并使用group整个站点审核用户
。如果您决定继续,主要步骤如下:
1创建 Auditor 组并添加您自己
2. 授予 Auditor 组对所有站点的访问权限
注意: 这使用
tee
将输出传送到下一个 GAM 命令并 将其保存到当前目录中名为sites.csv
的文件。 Windows 用户可能需要自行安装tee
版本才能使此命令发挥作用。3. 检查所有站点
这些站点将全部列在
sites.csv
中。您可以使用alternateLink
列中的 URL 打开每个站点的编辑界面(手动或以编程方式)。如果手动检查,请打开“发布”下拉菜单下的“发布设置...”屏幕:
如果使用某种浏览器脚本或 RPA 进行检查诸如 Selenium, UIPath< /a> 或 Power Automate,请注意,某些网站可能有一个或多个自定义 URL除了他们的“正常”URL:
4. 删除 Auditor 组
It's not currently possible to get a site's published URL using GAM. GAM relies on Google's APIs and there is not one available for new Sites:
Despite Google's repeated assurances that new Sites would be able to do everything classic Sites did, seven years on this is one of a number of unfilled gaps.
If you are only interested in sites with a "Custom URL," these can easily be viewed in the Google Workspace Admin under Apps → Google Workspace → Sites → Custom URL:
If you want to know about all sites, there is no good solution I'm aware of. One possible workaround is to give yourself access to every single site using GAM and then inspect each Site manually or using some sort of RPA or browser scripting tool.
Before you start down this path, generate a list of all the Sites in your domain and export it to Google Sheets (the quantity of results might help you decide how far to pursue this idea):
Hint: To narrow down the scope of this and all other GAM commands listed here you may want to replace
all users
withou "OU/Sub-OU"
or you could audit a subset of users by adding them to a new group called [email protected] and usegroup sites-audit-users
throughout.If you decide to proceed, the high level steps are:
1. Create Auditor group and add yourself
2. Give the Auditor group access to all sites
Note: This uses
tee
to both pipe the output to the next GAM command and save it to a file calledsites.csv
in your current directory. Windows users may need to install a version oftee
themselves for this command to work.3. Inspect all the sites
The sites will all be listed in
sites.csv
. You can open the edit interface for each site (manually or programmatically) using the URL in thealternateLink
column.If inspecting manually, open the "Publish settings..." screen under the "Publish" dropdown menu:
If inspecting using some sort of browser scripting or RPA tool such as Selenium, UIPath or Power Automate, be aware that some sites may have one or more custom URLs in addition to their "normal" URL:
4. Delete the Auditor group
似乎无法从源云端硬盘文件中找到该网站的已发布 URL。
It does not appear to be possible to find the Site's published URL from the source Drive file.
使用 GAM 无法找到工作区中的所有 google Drive 文件。
但是,可以使用 google Apps Script 和 DriveApp 类。通过使用
getFiles()
函数(您可以阅读有关它的更多信息 此处)您可以检索 Google 云端硬盘中所有文件的列表。然后您可以轻松提取这些文件的 url,如下例所示。It is not possible to find all google Drive files in your workspace using GAM.
However,it can be easily achieved using google Apps Script and the DriveApp class. By using the
getFiles()
function (you can read more about it here) you can retrieve a list of all your files in Google Drive. Then you can extract the url of those files quite easily, like in the example below.