zoukankan      html  css  js  c++  java
  • windows server 2008 R2 域中用组策略隐藏指定磁盘驱动器(盘符)

     适用  windows server 2019

    之前一直想按照由于Windows server 2008 采用的域配置文件是*.admx的文件,而并非2003中的*.adm文件,所以根据微软http://support.microsoft.com/kb/231289 这篇文章没有办法解决Windows server 2008下隐藏指定盘符的问题.

    经过这两天搜索国外一些资料的总结,现在终于解决了这个问题.详细步骤如下.

    1.首先在C:WindowsSYSVOLsysvolxxx.comPolicies文件夹下,创建文件夹PolicyDefinitions.

    2.将%systemroot%PolicyDefinitions下所有文件复制到C:WindowsSYSVOLsysvolxxx.comPoliciesPolicyDefinitions下.

    3.修改C:WindowsSYSVOLsysvolxxx.comPoliciesPolicyDefinitionsWindowsExplorer.admx这个文件来达到在Windows server 2008中隐藏指定盘符的功能.(编辑这个文件可以用记事本或者是notepad++)

    4.在WindowsExplorer.admx文件中查找字段NoDrives,添加相应的字符串可以设置隐藏指定的磁盘驱动器;查找字段NoViewOnDrive,并修改相应的字段,可以设置拒绝从Windows资源管理器访问某个磁盘驱动器.

    下面以设置隐藏指定的磁盘驱动器为例:(下列黑体字我测试时设置的"只显示Z,其他盘符不显示.")

    <policy name="NoDrives" class="User" displayName="$(string.NoDrives)" explainText="$(string.NoDrives_Help)" presentation="$(presentation.NoDrives)" key="SoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer">

          <parentCategory ref="windows:WindowsExplorer" />

          <supportedOn ref="windows:SUPPORTED_Win2k" />

          <elements>

            <enum id="NoDrivesDropdown" valueName="NoDrives" required="true">

              <item displayName="$(string.ABOnly)">

                <value>

                  <decimal value="3" />

                </value>

              </item>

              <item displayName="$(string.COnly)">

                <value>

                  <decimal value="4" />

                </value>

              </item>

              <item displayName="$(string.DOnly)">

                <value>

                  <decimal value="8" />

                </value>

              </item>

              <item displayName="$(string.ABConly)">

                <value>

                  <decimal value="7" />

                </value>

              </item>

              <item displayName="$(string.ABCDOnly)">

                <value>

                  <decimal value="15" />

                </value>

              </item>

              <item displayName="$(string.ALLDrives)">

                <value>

                  <decimal value="67108863" />

                </value>

              </item>

              <item displayName="$(string.RestNoDrives)">

                <value>

                  <decimal value="0" />

                </value>

              </item>

        <item displayName="$(string.Zonly)">

                <value>

                  <decimal value="33554431" />

                </value>

              </item> 

    其中decimal value的值,我们可以通过一个隐藏磁盘驱动器计算器来得到相应的值,下载地址: http://www.datacrash.net/downloads/ddc.exe

    隐藏磁盘驱动器计算机:

    5.之后修改C:WindowsSYSVOLsysvolxxx.comPoliciesPolicyDefinitionszh-CNWindowsExplorer.adml(适用于中文Windows server 2008).

    如果你使用的是英文版需要修改:C:WindowsSYSVOLsysvolxxx.comPoliciesPolicyDefinitionsen-USWindowsExplorer.adml

     添加如下字符串.(黑体字)

    注意:string id要跟WindowsExplorer.admx设置相同.

    <stringTable>

          <string id="ABCDOnly">仅限制驱动器 A、B、C 和 D</string>

          <string id="ABConly">仅限制驱动器 A、B 和 C</string>

          <string id="ABOnly">仅限制驱动器 A 和 B</string>

          <string id="ALLDrives">限制所有驱动器</string>

          <string id="Zonly">不限制z驱动器,其余驱动器全部限制</string>

          <string id="ClassicShell">启用经典外观</string>

          <string id="ClassicShell_Help">此设置允许管理员将特定的 Windows Shell 行为还原到经典外观行为。

    6.现在在组策略中就可以看到这个设置了.

  • 相关阅读:
    AspNet Core 核心 通过依赖注入(注入服务)
    AspNetCore 中使用 InentityServer4(2)
    AspNetCore中使用Ocelot之 IdentityServer4(1)
    AspNetCore+Swagger 生成Model 描述
    scp带密码拷贝文件
    redis集群之节点少于六个错误-解决
    [AWS DA Guru] Serverless compute Exam Tips
    [AWS] Lambda Invocation types
    [AWS Developer Guru] CI/CD
    [AWS] Lab: CloudFormation nested stack
  • 原文地址:https://www.cnblogs.com/wulongy/p/14676651.html
Copyright © 2011-2022 走看看