前几天我的本本加入到AD里面了,并且换了个用户名,结果昨天就发现升级出毛病了,Automatic Updates服务无法启动,启动时候出现0x80004015错误:
Automatic Updates 服务因下列错误而停止: 
此类别是作为跟调用程序不同的安全 id 运行的

有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp的帮助和支持中心。

搞了N久都搞不好啊,还是后来在美国的一个网站查到了相关资料,使用下列命令搞定了,就是修改了服务的安全描述。
代码:

sc sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)

后面那一串奇怪的字符就是安全描述,这个是使用的SDDL格式,查了些资料,弄明白了一点。(看的是ADAM的资料,嘿嘿)下面就开始copy他的文章了。

代码:

第三段:
这就是全文的重点--SDDL

首先我们看看这 D:AR(D;OICI;FA;;;BG) 中的第一个字段,这里填充的是D,
我们可以选择的有:
(O:) owner, (G:)primary group, (D:)DACL , (S:)SACL .也就是说我们可以通过inf文件设置对象的Owner,Primary Group,DACL和SACL,一般最常见的也就是上面提到的D,设置文件的访问控制列表。

再看看第二个字段,上面填写的是AR,这个字段只有当你设置ACL时才会出现
设置DACL时,我们可以选择的有:
“P”–SE_DACL_PROTECTED flag, Protects the DACL of the security descriptor from being modified by inheritable ACEs.
“AR”–SE_DACL_AUTO_INHERIT_REQ flag, Requests that the provider for the object protected by the security descriptor automatically propagate the DACL to existing child objects. If the provider supports automatic inheritance, it propagates the DACL to any existing child objects, and sets the SE_DACL_AUTO_INHERITED bit in the security descriptors of the object and its child objects.
“AI”–SE_DACL_AUTO_INHERITED flag, Indicates a security descriptor in which the DACL is set up to support automatic propagation of inheritable ACEs to existing child objects. This bit is set only if the automatic inheritance algorithm has been performed for the object and its existing child objects.
This bit is not set in security descriptors for Windows NT versions 4.0 and earlier, which did not support automatic propagation of inheritable ACEs.

设置SACL时,我们可以选择的有:
“P”–SE_SACL_PROTECTED flag, Protects the SACL of the security descriptor from being modified by inheritable ACEs.
“AR”–SE_DACL_AUTO_INHERIT_REQ flag, Requests that the provider for the object protected by the security descriptor automatically propagate the SACL to existing child objects. If the provider supports automatic inheritance, it propagates the SACL to any existing child objects, and sets the SE_SACL_AUTO_INHERITED bit in the security descriptors of the object and its child objects.
“AI”–SE_DACL_AUTO_INHERITED flag, Indicates a security descriptor in which the SACL is set up to support automatic propagation of inheritable ACEs to existing child objects. This bit is set only if the automatic inheritance algorithm has been performed for the object and its existing child objects.
This bit is not set in security descriptors for Microsoft Windows NT versions 4.0 and earlier, which did not support automatic propagation of inheritable ACEs.

注:原谅我不翻译上面的文字,因为这些东西真的无法用中文表示,很多东西没有一个权威的翻译,我也不想被人家笑话。

OK,我们最后看看最复杂的第三段 D;OICI;FA;;;BG ,被5个分号分成6个小节
第一节:ACE类型,我们这里使用的是 D,可以选择的有
“A”  ACCESS_ALLOWED
“D”  ACCESS_DENIED 
“OA” OBJECT ACCESS ALLOWED
“OD” OBJECT ACCESS DENIED
“AU” AUDIT 
“AL” ALARM 
“OU” OBJECT AUDIT
“OL” OBJECT ALARM

第二节:ACE标志,我们这里的值是OICI,可以选择的有
“CI” CONTAINER INHERIT
“OI” OBJECT INHERIT
“NP” NO PROPAGATE
“IO” INHERIT ONLY
“ID” INHERITED
“SA” AUDIT SUCCESS
“FA” AUDIT FAILURE

第三节:权限类型,我们这里的值是FA,可以选择的有
对于目录而言:
“RP” READ
“WP” WRITE
“CC” CREATE CHILD
“DC” DELETE CHILD
“LC” LIST CHILDREN
“SW” SELF WRITE
“LO” LIST OBJECT
“DT” DELETE TREE
“CR” CONTROL ACCESS
对于文件而言:
“FA” ALL
“FR” READ
“FW” WRITE
“FX” EXECUTE
对于注册表权限而言:
“KA” ALL
“KR” READ
“KW” WRITE
“KX” EXECUTE
注:注册表和文件、目录一样,也可以inf文件里设置权限,格式和文件一致,只是把文件名换成键名即可,如machine\software\NSFOCUS\Adam

第四节和第五节都为空,它们分别表示的是Object GUID和inherit object guid,我见过的大多数inf文件这2个字段都为空,我们做inf文件的时候也空就好了 :)

第六节:这里表示的是用户或组,一般而言我们设置的时候都是系统自带的用户或组,如果你非要为自己建的用户设置这些玩艺,那你就用用户或组的SID表示好了,而系统自带的用户或组,我们的表示方法如下:
“AO” Account operators
“RU” Alias to allow previous Windows 2000
“AN” Anonymous logon
“AU” Authenticated users
“BA” Built-in administrators
“BG” Built-in guests
“BO” Backup operators
“BU” Built-in users
“CA” Certificate server administrators
“CG” Creator group
“CO” Creator owner
“DA” Domain administrators
“DC” Domain computers
“DD” Domain controllers
“DG” Domain guests
“DU” Domain users
“EA” Enterprise administrators
“ED” Enterprise domain controllers
“WD” Everyone
“PA” Group Policy administrators
“IU” Interactively logged-on user
“LA” Local administrator
“LG” Local guest
“LS” Local service account
“SY” Local system
“NU” Network logon user
“NO” Network configuration operators
“NS” Network service account
“PO” Printer operators
“PS” Personal self
“PU” Power users
“RS” RAS servers group
“RD” Terminal server users 
“RE” Replicator
“RC” Restricted code
“SA” Schema administrators
“SO” Server operators
“SU” Service logon user
在这个列表里面我们可以很轻松地找到我们所用的BG用户代表的Guests组

如果我们为某个文件或文件夹对象设置多个ACE,
本地Administrators:Full Control
本地Guests:Read

那我们可以写”D:AR(A;OICI;FA;;;LA)(A;OICI;FR;;;BG)”

OK,SDDL的大致介绍就写这么多吧,这些东西光看用处是不大的,还需要自己多加测试,欢迎各位看官不吝指正…

启动Automatic Updates出现0x80004015错误的解决办法的更多相关文章

  1. 有关于eclipse启动调试时出现EOFexpetion错误的解决办法

    1.打开调试透视窗 2.找到所有断点 3.清空所有断点后再去打断点,再去调试 网上说法:这个问题可能是由于eclipse和tomcat的交互而产生的,在以debug模式启动tomcat时,发生了读取文 ...

  2. mysql-5.7.9-winx64 MySQL服务无法启动,服务没有报告任何错误的解决办法

    问题背景 最新解压版本的mysql 解压安装的时候报错 D:\mysql-5.7.9-winx64\bin>net start mysql MySQL 服务正在启动 . MySQL 服务无法启动 ...

  3. Oracle的常见错误及解决办法

    ORA-12528: TNS:listener: all appropriate instances are blocking new connections ORA-12528问题是因为监听中的服务 ...

  4. WCF服务部署到IIS上,然后通过web服务引用方式出现错误的解决办法

    本文转载:http://www.cnblogs.com/shenba/archive/2012/01/06/2313932.html 昨天在用IIS部署一个WCF服务时,碰到了如下错误: 理解了文档内 ...

  5. TF31003错误的解决办法

    TF31003错误的解决办法   在今天上午机器重新启动后,VS2012突然无法连接TFS2010了.在机器重新启动之前还使用正常.刚开始以为TFS出现了问题,不过其他小组同事使用却正常,问题应该在我 ...

  6. Oracle10g安装中遇到的错误及解决办法

    linux解决xhost: unable to open display实用技巧:在Linux下设置xhost方法步骤 第一步:用root登陆linux,启动vnc服务:第二步:根据vnc起来的端口, ...

  7. 使用wubi安装ubuntu14.04出现的常见错误的解决办法

    花了一天的时间终于安装上了Ubuntu14.04,过程坎坷,是血泪史,开始报“cannot download the metalink and therefore the ISO”错误,解决后,又报“ ...

  8. Mysql5.6 make 错误以及解决办法

    1.若make出现类似错误: CMake Error: CMake was unable to find a build program corresponding to "Unix Mak ...

  9. github常见操作和常见错误及其解决办法

    一.常见操作 1. 使用git在本地创建一个项目的过程 $ makdir ~/hello-world //创建一个项目hello-world $ cd ~/hello-world //打开这个项目 $ ...

随机推荐

  1. codeforces A. Flipping Game 解题报告

    题目链接:http://codeforces.com/problemset/problem/327/A 题意是输入一个只有0和1的序列,要求找出一个合理的区间,在这个区间里面把0变成1,1变成0,使得 ...

  2. dt.jar设计时rt.jar运行时

    很多人在初学Java的时候,都要配置环境变量.在配置CLASSPATH的时候,都会加上一个当前目录.,还有两个jar:dt.jar和tools.jar.其实好多人都不了解这两个jar的作用,尤其是dt ...

  3. SQL 删除存在于A表但是不存在B表中的记录

    目的是是的A表和B表某一个列集合相等 delete from A where tagetColumn not in ( select targetColumn from B)

  4. gdalwarp切割tif参数

    可以去gdal官网查询gdalwarp工具的参数,但是具体的还是不知道怎么写,例如内置数据类型-ot 和压缩-co参数. 这里有一个经过雁阵更可以使用的参数 gdalwarp -te lon1 lat ...

  5. July 29th, Week 31st Friday, 2016

    I am a slow walker, but I never walk backwards. 我走得很慢,但我从来不会后退. I had run very fast, and I had once ...

  6. Tomcat AccessLog 格式化

    有的时候我们要使用日志分析工具对日志进行分析,需要对日志进行格式化,比如,要把accessLog格式化成这样的格式 c-ip s-ip x-InstancePort date time-taken x ...

  7. 对线程调度中Thread.sleep(0)的深入理解

    在Java或者C#中,都会用到 Thread.Sleep()来使线程挂起一段时间.那么你有没有正确的理解这个方法的用法呢?思考下面这两个问题: 1.假设现在是 2014-8-13 17:00:00.0 ...

  8. Java Hour 33 Weather ( 6 )

    有句名言,叫做10000小时成为某一个领域的专家.姑且不辩论这句话是否正确,让我们到达10000小时的时候再回头来看吧. Hour 33 CURD 之 Create 首先是Eclipse 排序的功能找 ...

  9. poj 1811 大数分解

    模板 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<time.h> ...

  10. 对于JavaScript的函数.NET开发人员应该知道的11件事

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 昨天小感冒今天重感冒,也不能长篇大论.如果你是.NET开发人员,在进入前端开发领域的时候,对 ...