Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

241 lines
6.2 KiB

  1. ' global
  2. Dim Prefix
  3. Prefix = Array("", " ", " ", " ")
  4. Sub AzPrintCommon(Level, ObjName, Obj)
  5. If 0=Level Then
  6. 'level 0 has no name
  7. WScript.Echo Prefix(Level) & ObjName & "(Description=" & Obj.Description & ")"
  8. Else
  9. WScript.Echo Prefix(Level) & ObjName & "(Name=" & Obj.Name & ", Description=" & Obj.Description & ")"
  10. End If
  11. End Sub
  12. Sub AzPrintAttr(Level, Obj, PId, PName)
  13. WScript.Echo Prefix(Level) & " @ " & PName & "=" & Obj.GetProperty(PId, 0)
  14. End Sub
  15. Sub AzPrintItem(Level, Name, Item)
  16. WScript.Echo Prefix(Level) & " / " & Name & "=" & Item
  17. End Sub
  18. Sub AzPrintAdmin(Lvl, Obj)
  19. Dim Writers, Readers, U
  20. AzPrintCommon Lvl, "AdminManager", Obj
  21. AzPrintAttr Lvl, Obj, AZ_PROP_ADMIN_DOMAIN_TIMEOUT, "AZ_PROP_ADMIN_DOMAIN_TIMEOUT"
  22. AzPrintAttr Lvl, Obj, AZ_PROP_ADMIN_SCRIPT_ENGINE_TIMEOUT, "AZ_PROP_ADMIN_SCRIPT_ENGINE_TIMEOUT"
  23. AzPrintAttr Lvl, Obj, AZ_PROP_ADMIN_MAX_SCRIPT_ENGINES, "AZ_PROP_ADMIN_MAX_SCRIPT_ENGINES"
  24. AzPrintAttr Lvl, Obj, AZ_PROP_GENERATE_AUDITS, "AZ_PROP_GENERATE_AUDITS"
  25. Writers = Obj.PolicyAdministrators
  26. For Each U In Writers
  27. AzPrintItem Lvl, "PolicyAdministrator", U
  28. Next
  29. Readers = Obj.PolicyReaders
  30. For Each U In Readers
  31. AzPrintItem Lvl, "PolicyReader", U
  32. Next
  33. WScript.Echo ""
  34. End Sub
  35. Sub AzPrintApp(Lvl, Obj)
  36. AzPrintCommon Lvl, "Application", Obj
  37. AzPrintAttr Lvl, Obj, AZ_PROP_APPLICATION_AUTHZ_INTERFACE_CLSID, "AZ_PROP_APPLICATION_AUTHZ_INTERFACE_CLSID"
  38. AzPrintAttr Lvl, Obj, AZ_PROP_APPLICATION_VERSION, "AZ_PROP_APPLICATION_VERSION"
  39. AzPrintAttr Lvl, Obj, AZ_PROP_GENERATE_AUDITS, "AZ_PROP_GENERATE_AUDITS"
  40. WScript.Echo ""
  41. End Sub
  42. Sub AzPrintOp(Lvl, Obj)
  43. AzPrintCommon Lvl, "Operation", Obj
  44. AzPrintAttr Lvl, Obj, AZ_PROP_OPERATION_ID, "AZ_PROP_OPERATION_ID"
  45. WScript.Echo ""
  46. End Sub
  47. Sub AzPrintTask(Lvl, Obj)
  48. Dim Ops, Tasks
  49. AzPrintCommon Lvl, "Task", Obj
  50. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE, "AZ_PROP_TASK_BIZRULE"
  51. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE_LANGUAGE, "AZ_PROP_TASK_BIZRULE_LANGUAGE"
  52. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE_IMPORTED_PATH, "AZ_PROP_TASK_BIZRULE_IMPORTED_PATH"
  53. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_IS_ROLE_DEFINITION, "AZ_PROP_TASK_IS_ROLE_DEFINITION"
  54. Ops = Obj.GetProperty(AZ_PROP_TASK_OPERATIONS, 0)
  55. For Each Op In Ops
  56. AzPrintItem Lvl, "OperationLink", Op
  57. Next
  58. Tasks = Obj.GetProperty(AZ_PROP_TASK_TASKS, 0)
  59. For Each Task In Tasks
  60. AzPrintItem Lvl, "TaskLink", Task
  61. Next
  62. WScript.Echo ""
  63. End Sub
  64. Sub AzPrintGroup(Lvl, Obj)
  65. Dim Mems, NonMems, AppMems, AppNonMems
  66. AzPrintCommon Lvl, "Group", Obj
  67. AzPrintAttr Lvl, Obj, AZ_PROP_GROUP_TYPE, "AZ_PROP_GROUP_TYPE"
  68. AzPrintAttr Lvl, Obj, AZ_PROP_GROUP_LDAP_QUERY, "AZ_PROP_GROUP_LDAP_QUERY"
  69. Mems = Obj.GetProperty(AZ_PROP_GROUP_MEMBERS, 0)
  70. For Each Mem In Mems
  71. AzPrintItem Lvl, "SidMember", Mem
  72. Next
  73. NonMems = Obj.GetProperty(AZ_PROP_GROUP_NON_MEMBERS, 0)
  74. For Each Mem In NonMems
  75. AzPrintItem Lvl, "SidNonMember", Mem
  76. Next
  77. AppMems = Obj.GetProperty(AZ_PROP_GROUP_APP_MEMBERS, 0)
  78. For Each Mem In AppMems
  79. AzPrintItem Lvl, "AppMemberLink", Mem
  80. Next
  81. AppNonMems = Obj.GetProperty(AZ_PROP_GROUP_APP_NON_MEMBERS, 0)
  82. For Each Mem In AppNonMems
  83. AzPrintItem Lvl, "AppNonMemberLink", Mem
  84. Next
  85. WScript.Echo ""
  86. End Sub
  87. Sub AzPrintScope(Lvl, Obj)
  88. AzPrintCommon Lvl, "Scope", Obj
  89. WScript.Echo ""
  90. End Sub
  91. Sub AzPrintRole(Lvl, Obj)
  92. Dim Mems, SidMems, Ops, Tasks
  93. AzPrintCommon Lvl, "Role", Obj
  94. Ops = Obj.GetProperty(AZ_PROP_ROLE_OPERATIONS, 0)
  95. For Each Op In Ops
  96. AzPrintItem Lvl, "OperationLink", Op
  97. Next
  98. Tasks = Obj.GetProperty(AZ_PROP_ROLE_TASKS, 0)
  99. For Each Task In Tasks
  100. AzPrintItem Lvl, "TaskLink", Task
  101. Next
  102. SidMems = Obj.GetProperty(AZ_PROP_ROLE_MEMBERS, 0)
  103. For Each Mem In SidMems
  104. AzPrintItem Lvl, "SidMember", Mem
  105. Next
  106. Mems = Obj.GetProperty(AZ_PROP_ROLE_APP_MEMBERS, 0)
  107. For Each Mem In Mems
  108. AzPrintItem Lvl, "AppMemberLink", Mem
  109. Next
  110. WScript.Echo ""
  111. End Sub
  112. Sub AzPrintPolicy(Admin)
  113. AzPrintAdmin 0, Admin
  114. ' navigate whole tree
  115. Dim Apps, App
  116. Set Apps=Admin.Applications
  117. For Each App In Apps
  118. AzPrintApp 1, App
  119. Dim Ops, Op
  120. Set Ops=App.Operations
  121. For Each Op In Ops
  122. AzPrintOp 2, Op
  123. Next
  124. Dim Tks, Tk
  125. Set Tks=App.Tasks
  126. For Each Tk In Tks
  127. AzPrintTask 2, Tk
  128. Next
  129. Dim Gps, Gp
  130. Set Gps=App.ApplicationGroups
  131. For Each Gp In Gps
  132. AzPrintGroup 2, Gp
  133. Next
  134. Dim Rls, Rl
  135. Set Rls=App.Roles
  136. For Each Rl In Rls
  137. AzPrintRole 2, Rl
  138. Next
  139. Dim Scs, Sc
  140. Set Scs=App.Scopes
  141. For Each Sc In Scs
  142. AzPrintScope 2, Sc
  143. Dim STks, STk
  144. Set STks=Sc.Tasks
  145. For Each STk In STks
  146. AzPrintTask 3, STk
  147. Next
  148. Dim SGps, SGp
  149. Set SGps=Sc.ApplicationGroups
  150. For Each SGp In SGps
  151. AzPrintGroup 3, SGp
  152. Next
  153. Dim SRls, SRl
  154. Set SRls=Sc.Roles
  155. For Each SRl In SRls
  156. AzPrintRole 3, SRl
  157. Next
  158. Set STks=Nothing
  159. Set SGps=Nothing
  160. Set SRls=Nothing
  161. Next
  162. Set Ops=Nothing
  163. Set Tks=Nothing
  164. Set Gps=Nothing
  165. Set Rls=Nothing
  166. Set Scs=Nothing
  167. Next
  168. Dim Groups, Group
  169. Set Groups=Admin.ApplicationGroups
  170. For Each Group In Groups
  171. AzPrintGroup 1, Group
  172. Next
  173. Set Groups=Nothing
  174. Set Apps=Nothing
  175. End Sub 'AzPrintPolicy
  176. Sub AzPrintPolicyFile(localXmlFile)
  177. Dim Admin
  178. WScript.Echo "Store = " & localXmlFile
  179. Set Admin=CreateObject("AzRoles.AzAdminManager")
  180. Admin.Initialize 0, localXmlFile
  181. WScript.Echo ""
  182. AzPrintPolicy Admin
  183. Set Admin=Nothing
  184. End Sub 'AzPrintPolicyFile