前几天我的本本加入到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. WPF 打印控件 无弹框打印。

    WPF中打印用到了 PrintDialog类. 其中设置打印属性的是PrintTicket,管理打印机的是PrintQueue. 实例如下: public class PrintDialogHelpe ...

  2. 10.python之socket和socketserver

    1.socket介绍 socket的英文原义是"孔"或"插座".作为BSD UNIX的进程通信机制,取后一种意思.通常也 称作"套接字",用 ...

  3. dubbo.xsd

    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/> <xsd:import namesp ...

  4. July 20th, Week 30th Wednesday, 2016

    Learn from yesterday, live for today, and hope for tomorrow. 借鉴昨天,活着当下,憧憬未来. Yesterday is the past, ...

  5. Controller与View之间的数据传递

    1)Controller向View传递数据ViewData["message"] = "Hello";//使用ViewData传递数据ViewBag.Time ...

  6. Android手势锁实现

    最终效果如下 整体思路 a.自定义了一个RelativeLayout(GestureLockViewGroup)在里面会根据传入的每行的个数,生成多个GestureLockView(就是上面一个个小圈 ...

  7. ubuntu 彻底删除卸载

    1911 sudo apt-get install zabbix-agent 1916 sudo apt-get autoremove zabbix_agent root@(none):~# apt- ...

  8. HTML CSS 中DIV内容居中汇总

    转载博客(http://www.cnblogs.com/dearxinli/p/3865099.html) (备注:DIV居中情况,网上谈到也比较多,但是这篇文字,相对还是挺全面,现转载,如果冒犯,还 ...

  9. HDU 5009 Paint Pearls 双向链表优化DP

    Paint Pearls Problem Description   Lee has a string of n pearls. In the beginning, all the pearls ha ...

  10. BZOJ 3156: 防御准备 斜率优化DP

    3156: 防御准备 Description   Input 第一行为一个整数N表示战线的总长度. 第二行N个整数,第i个整数表示在位置i放置守卫塔的花费Ai. Output 共一个整数,表示最小的战 ...