如果我只知道SID,如何在Windows中更改文件ACL? [英] How to change the file ACL in windows, if I only know the SID?

查看:218
本文介绍了如果我只知道SID,如何在Windows中更改文件ACL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改文件的ACL并将完全权限设置为特殊用户。

I want to change the ACL of a file and set "full permissions" to a special user.

我知道cacls命令 cacls。 / e / t / p每个人:f

I know the cacls-command cacls . /e /t /p Everyone:f

但是这仅在操作系统为英语的情况下有效。对于德国系统,必须为
cacls。 / e / t / p Jeder:f

But this only works if the OS is english. For german systems, it must be cacls . /e /t /p Jeder:f.

我知道用户所有人(S-1-1-0)的知名SID ,但似乎我无法将它们与cacl一起使用。

I know the well-known SIDs of the user "everyone" (S-1-1-0), but it seems as if I can't use them with cacls.

我尝试了 cacls。 / e / t / p S-1-1-0:f

是否可以使用Windows命令行工具职位?我不允许为此工作将软件或其他命令行工具与我的软件捆绑在一起。

Is there a way to use windows command line tools for this jobs? I'm not allowed to bundle software or other commandline tools for this job with my software.

该解决方案必须从Java-Process调用,但这不应该是一个问题。

The solution has to be called from a Java-Process, but that should not be a problem.

推荐答案

我找到了解决方案。我正在使用我的安装程序创建工具供应商提供的库。

I found a solution. I am using a library from the vendor of my Setup creation tool.

编辑:

问题的解决方案:

设置创建工具 Install4j 的方法为 getUserLogin(String sid)其返回值类似于: WORKSTATION1\User1

The Setup-Creation Tool Install4j has a method getUserLogin(String sid) its returnvalue is something like: WORKSTATION1\User1

我使用 cacls 来更改ACL。

这篇关于如果我只知道SID,如何在Windows中更改文件ACL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆