简体   繁体   English

在我的G Suite域中的Google表格中记录工作表用户名时禁用脚本授权

[英]Disable Script authorization when logging sheet username in Google Sheets within my G suite domain

I am creating a daily task list in Google Sheets for my employees to work off of. 我正在Google表格中创建每日任务列表,以供员工使用。 I am domain admin. 我是域管理员。

Each checklist item logs the time and username in Column Z when row changes (item is checked off). 当行更改时(项目被选中),每个清单项目将时间和用户名记录在Z列中。 This tracks when the daily task was done, and by whom. 这会跟踪日常任务的执行时间以及由谁执行。

Eg "Check voicemail" "Check faxes" 例如,“检查语音邮件”,“检查传真”

-- When user puts a checkmark in one of these items, I want their email address or domain username and a time stamp to show up in Column Z. -当用户在其中一项中打勾时,我希望他们的电子邮件地址或域用户名以及时间戳显示在Z列中。

PROBLEM: There will be a new copy of this sheet for each day. 问题:每天都会有此表的新副本。 The script has to be authorized for each individual user on each day (new sheet) for the script to work properly. 必须每天(每个新工作表)为每个用户授权脚本,脚本才能正常工作。

COMPLICATING FACTOR: I need to keep my domain HIPAA compliant so I am leery of enabling App Marketplace for my domain. 复杂因素:我需要保持我的域HIPAA的合规性,因此我乐于为我的域启用App Marketplace。

NEEDED SOLUTION: As domain admin, how do I make the script authorized to be used on my domain? 所需的解决方案:作为域管理员,如何使脚本授权在我的域上使用? Once it is authorized, how do I link it to the master sheet and daily copies of the sheet Allow this script on my domain to capture domain usernames without individual authorization. 获得授权后,如何将其链接到主表和工作表的日常副本允许我的域上的此脚本无需单独授权即可捕获域用户名。

THANKS! 谢谢!

 function onEdit(event) { var now2 = Utilities.formatDate(new Date(), "EST", "E MMM dd, yyyy @ hh:mm a"); SpreadsheetApp.getActiveSheet().getRange("Z1").setValue("Sheet Last Modified: " +now2); var s = SpreadsheetApp.getActiveSheet(); var r = s.getActiveCell(); if( r.getColumn() != 6 ) { //checks the column var row = r.getRow(); var time2 = new Date(); var user = Session.getEffectiveUser(); time = Utilities.formatDate(new Date(), "EST", "E MMM dd, yyyy @ hh:mm a"); time2 = Utilities.formatDate(new Date(), "EST", "E MMM dd, yyyy"); SpreadsheetApp.getActiveSheet().getRange('Z' + row.toString()).setValue(time+" by: "+user); SpreadsheetApp.getActiveSheet().getRange("Z2").setValue("Row Last Modified"); }; }; 

I figured out how to NOT ask for authorization within my domain. 我想出了如何在我的域内不请求授权。 I had to run as an installable trigger. 我必须作为可安装的触发器运行。

In the Google Script.. Go to Edit menu, and hit "Current Project's Triggers" 在Google脚本中。转到“编辑”菜单,然后点击“当前项目的触发器”

Then, install an on Edit Trigger... 然后,在编辑触发器上安装...

This no longer asks for authorization! 这不再要求授权!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以禁用 G Suite 成员的客户端身份验证(绑定谷歌表脚本) - Is it possible to disable client authentication for G Suite members (bound google sheet script) G-Suite 用户访问 G-Suite 可信应用脚本时,如何避免脚本授权提示? - How to avoid script authorization prompt when G-Suite user is accessing G-Suite trusted app script? 如何将附加到工作表的 Google 应用脚本有选择地分发给不属于同一 G Suite 域的人员 - How to distribute Google app scripts attached to a sheet to people selectively that are not part of the same G Suite Domain 从Google Sheets脚本的Sheet中的选项卡导入A2行 - Import row A2 from tab within Sheet in Google Sheets Script 在Apps脚本中使用相同工作表的Google表格API - Using Google Sheets API from within Apps Script for same Sheet 无法将 Google App Script 发布到 G Suite Marketplace 以供域管理员查找 - Unable publish Google App Script to the G Suite Marketplace for domain administrators to find 应用程序脚本不发送 email 包含指向给定 G Suite 域上的 Google Drive 文件的链接,没有错误消息 - Apps script does not send email containing links to Google Drive files on a given G Suite domain, no error message Google Sheets 脚本需要授权,oauth 客户端说它被删除了,但它都在我们的域内 - Google Sheets script requires authorization, oauth client says it was deleted, but it's all inside our domain Sheets 函数在独立的 Google Script 中工作,但在脚本绑定到 Google Sheet 时不起作用 - Sheets function working in standalone Google Script but NOT when script is bound to a Google Sheet Google Sheets Script:在 setFormula() 中引用不同的工作表 - Google Sheets Script: Referencing a different sheet in setFormula()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM