简体   繁体   English

如何使用域用户通过 GPO 运行登录 .bat 脚本

[英]How to run logon .bat script by GPO with domain users

I'm trying to set up logon script to my domain computers in Default Domain Politics.我正在尝试在默认域策略中为我的域计算机设置登录脚本。 I use fusioninventory-agent.bat script that install FI agent and sent data do GLPI every time when user log on.我使用 fusioninventory-agent.bat 脚本安装 FI 代理并在用户每次登录时发送数据做 GLPI。 When I login to domain computers with administrator account it works fine, after few minutes, computer is visible in GLPI.当我使用管理员帐户登录域计算机时,它工作正常,几分钟后,计算机在 GLPI 中可见。 But when I login with normal domain user account without administrator's privileges this script does not run.但是当我使用没有管理员权限的普通域用户帐户登录时,此脚本不会运行。

In GPO I add script runLogonScirpt.bat in User Configuration > System Windows > Scripts > Logon in path \\xxx.local\\sysvol\\xxx.local\\Policies{id_policies}\\User\\Scripts\\Logon在 GPO 中,我在路径\\xxx.local\\sysvol\\xxx.local\\Policies{id_policies}\\User\\Scripts\\Logon中的 User Configuration > System Windows > Scripts > Logon 添加脚本 runLogonScirpt.bat

and folder FusionInventory-Agent where is script that I want to use fusioninventory-agent and dictionaries like certs, data, docs, etc, logs, perl, share, var.和文件夹 FusionInventory-Agent 我想使用 fusioninventory-agent 和字典(如证书、数据、文档等)、日志、perl、共享、var 的脚本在哪里。

My runlogonScirpt.bat looks like:我的 runlogonScirpt.bat 看起来像:

pushd \\xxx.local\sysvol\xxx.local\Policies\{id_policies}\User\Scripts\Logon\FusionInventory-Agent
fusioninventory-agent.bat
popd

My fusioninventory script:我的fusioninventory脚本:

@echo off
for%%p in (".") do pushd "$$~fsp"
cd /d "%~dp0\perl\bin"
perl.exe --fusioninventory-agent --conf-file="..\..\etc\agent.cfg" %*
popd

I also change folder permissions (/FusionInventory-agent && /Logon) for domain users, folder sysvol is mounting for a short while and disconnecting without script execution.我还更改了域用户的文件夹权限(/FusionInventory-agent && /Logon) ,文件夹 sysvol 挂载了一小段时间,并且在没有执行脚本的情况下断开连接。 Of course for admin accounts script is running and works correctly.当然对于管理员帐户脚本正在运行并正常工作。

It's likely to be a permission problem the user GPO \\User\\Scripts\\Logon can't be assigned Admin privilege by design.很可能是权限问题,无法按设计为用户 GPO \\User\\Scripts\\Logon 分配管理员权限。

As others have suggested to run as a Scheduled Task where admin permissions are allowed.正如其他人建议作为允许管理员权限的计划任务运行。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM