简体   繁体   English

dfsutil在CMD中工作,但在PowerShell中不工作

[英]dfsutil works in CMD but not in PowerShell

I'm facing the problem that a command in CMD doesn't work in PowerShell but it works in CMD. 我面临的问题是,CMD中的命令在PowerShell中不起作用,但在CMD中有效。

The command I've tried: 我尝试过的命令:

dfsutil property SD grant \\\\domain\\group "domain\\SecurityGroup1:RX"

If I do it with the same permissions in CMD it works, but if I do it in PowerShell it doesn't affect. 如果我在CMD中使用相同的权限进行操作,则可以使用,但如果在PowerShell中进行操作,则不会影响。

I also have tried this: 我也尝试过这个:

cmd.exe /c "dfsutil property SD grant \\\\domain\\group "domain\\SecurityGroup1:RX""

Same problem 同样的问题

Can somebody help me? 有人可以帮我吗?

.\dfsutil property SD grant \\domain\group "domain\SecurityGroup1:RX"

Try it like that maybe? 这样尝试吧? I am not sure why that would matter but found reference to it on this page: 我不确定为什么这很重要,但是在此页面上找到了对它的引用:

https://social.technet.microsoft.com/Forums/windowsserver/en-US/ae8da772-a434-4ae4-9004-42d5730b78f8/cant-use-dfsutil-in-powershell?forum=winserverpowershell https://social.technet.microsoft.com/Forums/windowsserver/zh-CN/ae8da772-a434-4ae4-9004-42d5730b78f8/cant-use-dfsutil-in-powershell?forum=winserverpowershell

我不这么认为,但也许重要的事实是,DFS位于组所在域的子域中,如下所示:

.\\dfsutil property SD grant \\\\sub.domain.com\\group\\folder 'domain\\Domain Admins:RX'

I've found the solution! 我找到了解决方案! Finally.... 最后....

$DFSroot = "\\\\sub.domain.com\\group\\folder" $DFScmd = '"domain\\Domain Admins:RX"'' Start-Process -FilePath "C:\\Windows\\system32\\dfsutil.exe" -ArgumentList "property SD grant $DFSroot $DFScmd protect"

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

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