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.

263 lines
6.7 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. Writers = Obj.PolicyAdministrators
  41. For Each U In Writers
  42. AzPrintItem Lvl, "PolicyAdministrator", U
  43. Next
  44. Readers = Obj.PolicyReaders
  45. For Each U In Readers
  46. AzPrintItem Lvl, "PolicyReader", U
  47. Next
  48. WScript.Echo ""
  49. End Sub
  50. Sub AzPrintOp(Lvl, Obj)
  51. AzPrintCommon Lvl, "Operation", Obj
  52. AzPrintAttr Lvl, Obj, AZ_PROP_OPERATION_ID, "AZ_PROP_OPERATION_ID"
  53. WScript.Echo ""
  54. End Sub
  55. Sub AzPrintTask(Lvl, Obj)
  56. Dim Ops, Tasks
  57. AzPrintCommon Lvl, "Task", Obj
  58. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE, "AZ_PROP_TASK_BIZRULE"
  59. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE_LANGUAGE, "AZ_PROP_TASK_BIZRULE_LANGUAGE"
  60. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE_IMPORTED_PATH, "AZ_PROP_TASK_BIZRULE_IMPORTED_PATH"
  61. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_IS_ROLE_DEFINITION, "AZ_PROP_TASK_IS_ROLE_DEFINITION"
  62. Ops = Obj.GetProperty(AZ_PROP_TASK_OPERATIONS, 0)
  63. For Each Op In Ops
  64. AzPrintItem Lvl, "OperationLink", Op
  65. Next
  66. Tasks = Obj.GetProperty(AZ_PROP_TASK_TASKS, 0)
  67. For Each Task In Tasks
  68. AzPrintItem Lvl, "TaskLink", Task
  69. Next
  70. WScript.Echo ""
  71. End Sub
  72. Sub AzPrintGroup(Lvl, Obj)
  73. Dim Mems, NonMems, AppMems, AppNonMems
  74. AzPrintCommon Lvl, "Group", Obj
  75. AzPrintAttr Lvl, Obj, AZ_PROP_GROUP_TYPE, "AZ_PROP_GROUP_TYPE"
  76. AzPrintAttr Lvl, Obj, AZ_PROP_GROUP_LDAP_QUERY, "AZ_PROP_GROUP_LDAP_QUERY"
  77. Mems = Obj.GetProperty(AZ_PROP_GROUP_MEMBERS, 0)
  78. For Each Mem In Mems
  79. AzPrintItem Lvl, "SidMember", Mem
  80. Next
  81. NonMems = Obj.GetProperty(AZ_PROP_GROUP_NON_MEMBERS, 0)
  82. For Each Mem In NonMems
  83. AzPrintItem Lvl, "SidNonMember", Mem
  84. Next
  85. AppMems = Obj.GetProperty(AZ_PROP_GROUP_APP_MEMBERS, 0)
  86. For Each Mem In AppMems
  87. AzPrintItem Lvl, "AppMemberLink", Mem
  88. Next
  89. AppNonMems = Obj.GetProperty(AZ_PROP_GROUP_APP_NON_MEMBERS, 0)
  90. For Each Mem In AppNonMems
  91. AzPrintItem Lvl, "AppNonMemberLink", Mem
  92. Next
  93. WScript.Echo ""
  94. End Sub
  95. Sub AzPrintScope(Lvl, Obj)
  96. AzPrintCommon Lvl, "Scope", Obj
  97. Writers = Obj.PolicyAdministrators
  98. For Each U In Writers
  99. AzPrintItem Lvl, "PolicyAdministrator", U
  100. Next
  101. Readers = Obj.PolicyReaders
  102. For Each U In Readers
  103. AzPrintItem Lvl, "PolicyReader", U
  104. Next
  105. WScript.Echo ""
  106. End Sub
  107. Sub AzPrintRole(Lvl, Obj)
  108. Dim Mems, SidMems, Ops, Tasks
  109. AzPrintCommon Lvl, "Role", Obj
  110. Ops = Obj.GetProperty(AZ_PROP_ROLE_OPERATIONS, 0)
  111. For Each Op In Ops
  112. AzPrintItem Lvl, "OperationLink", Op
  113. Next
  114. Tasks = Obj.GetProperty(AZ_PROP_ROLE_TASKS, 0)
  115. For Each Task In Tasks
  116. AzPrintItem Lvl, "TaskLink", Task
  117. Next
  118. SidMems = Obj.GetProperty(AZ_PROP_ROLE_MEMBERS, 0)
  119. For Each Mem In SidMems
  120. AzPrintItem Lvl, "SidMember", Mem
  121. Next
  122. Mems = Obj.GetProperty(AZ_PROP_ROLE_APP_MEMBERS, 0)
  123. For Each Mem In Mems
  124. AzPrintItem Lvl, "AppMemberLink", Mem
  125. Next
  126. WScript.Echo ""
  127. End Sub
  128. Sub AzPrintPolicy(Admin)
  129. AzPrintAdmin 0, Admin
  130. ' navigate whole tree
  131. Dim Apps, App
  132. Set Apps=Admin.Applications
  133. For Each App In Apps
  134. AzPrintApp 1, App
  135. Dim Ops, Op
  136. Set Ops=App.Operations
  137. For Each Op In Ops
  138. AzPrintOp 2, Op
  139. Next
  140. Dim Tks, Tk
  141. Set Tks=App.Tasks
  142. For Each Tk In Tks
  143. AzPrintTask 2, Tk
  144. Next
  145. Dim Gps, Gp
  146. Set Gps=App.ApplicationGroups
  147. For Each Gp In Gps
  148. AzPrintGroup 2, Gp
  149. Next
  150. Dim Rls, Rl
  151. Set Rls=App.Roles
  152. For Each Rl In Rls
  153. AzPrintRole 2, Rl
  154. Next
  155. Dim Scs, Sc
  156. Set Scs=App.Scopes
  157. For Each Sc In Scs
  158. AzPrintScope 2, Sc
  159. Dim STks, STk
  160. Set STks=Sc.Tasks
  161. For Each STk In STks
  162. AzPrintTask 3, STk
  163. Next
  164. Dim SGps, SGp
  165. Set SGps=Sc.ApplicationGroups
  166. For Each SGp In SGps
  167. AzPrintGroup 3, SGp
  168. Next
  169. Dim SRls, SRl
  170. Set SRls=Sc.Roles
  171. For Each SRl In SRls
  172. AzPrintRole 3, SRl
  173. Next
  174. Set STks=Nothing
  175. Set SGps=Nothing
  176. Set SRls=Nothing
  177. Next
  178. Set Ops=Nothing
  179. Set Tks=Nothing
  180. Set Gps=Nothing
  181. Set Rls=Nothing
  182. Set Scs=Nothing
  183. Next
  184. Dim Groups, Group
  185. Set Groups=Admin.ApplicationGroups
  186. For Each Group In Groups
  187. AzPrintGroup 1, Group
  188. Next
  189. Set Groups=Nothing
  190. Set Apps=Nothing
  191. End Sub 'AzPrintPolicy
  192. Sub AzPrintADPolicy(url)
  193. Dim Admin
  194. WScript.Echo "Store = " & url
  195. Set Admin=CreateObject("AzRoles.AzAdminManager")
  196. Admin.Initialize 0, url
  197. WScript.Echo ""
  198. WScript.Echo "Admin Initialized"
  199. AzPrintPolicy Admin
  200. Set Admin=Nothing
  201. End Sub 'AzPrintADPolicy