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.

251 lines
6.8 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. WScript.Echo "DOMAIN_TIMEOUT" & "=" & Obj.DomainTimeout
  23. AzPrintAttr Lvl, Obj, AZ_PROP_ADMIN_SCRIPT_ENGINE_TIMEOUT, "AZ_PROP_ADMIN_SCRIPT_ENGINE_TIMEOUT"
  24. WScript.Echo "SCRIPT_ENGINE_TIMEOUT" & "=" & Obj.ScriptEngineTimeout
  25. AzPrintAttr Lvl, Obj, AZ_PROP_ADMIN_MAX_SCRIPT_ENGINES, "AZ_PROP_ADMIN_MAX_SCRIPT_ENGINES"
  26. WScript.Echo "MAX_SCRIPT_ENGINES" & "=" & Obj.MaxScriptEngines
  27. Writers = Obj.PolicyAdministrators
  28. For Each U In Writers
  29. AzPrintItem Lvl, "PolicyAdministrator", U
  30. Next
  31. Readers = Obj.PolicyReaders
  32. For Each U In Readers
  33. AzPrintItem Lvl, "PolicyReader", U
  34. Next
  35. WScript.Echo ""
  36. End Sub
  37. Sub AzPrintApp(Lvl, Obj)
  38. AzPrintCommon Lvl, "Application", Obj
  39. AzPrintAttr Lvl, Obj, AZ_PROP_APPLICATION_AUTHZ_INTERFACE_CLSID, "AZ_PROP_APPLICATION_AUTHZ_INTERFACE_CLSID"
  40. WScript.Echo "AUTHZ_INTERFACE_CLSID" & "=" & Obj.AuthzInterfaceClsid
  41. AzPrintAttr Lvl, Obj, AZ_PROP_APPLICATION_VERSION, "AZ_PROP_APPLICATION_VERSION"
  42. WScript.Echo "VERSION" & "=" & Obj.Version
  43. WScript.Echo ""
  44. End Sub
  45. Sub AzPrintOp(Lvl, Obj)
  46. AzPrintCommon Lvl, "Operation", Obj
  47. AzPrintAttr Lvl, Obj, AZ_PROP_OPERATION_ID, "AZ_PROP_OPERATION_ID"
  48. WScript.Echo "OperationId" & "=" & Obj.OperationId
  49. WScript.Echo ""
  50. End Sub
  51. Sub AzPrintTask(Lvl, Obj)
  52. Dim Ops, Tasks
  53. AzPrintCommon Lvl, "Task", Obj
  54. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE, "AZ_PROP_TASK_BIZRULE"
  55. WScript.Echo "Bizrule" & "=" & Obj.BizRule
  56. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE_LANGUAGE, "AZ_PROP_TASK_BIZRULE_LANGUAGE"
  57. WScript.Echo "Bizrule Language" & "=" & Obj.BizRuleLanguage
  58. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_BIZRULE_IMPORTED_PATH, "AZ_PROP_TASK_BIZRULE_IMPORTED_PATH"
  59. WScript.Echo "Bizrule Imported Path" & "=" & Obj.BizRuleImportedPath
  60. AzPrintAttr Lvl, Obj, AZ_PROP_TASK_IS_ROLE_DEFINITION, "AZ_PROP_TASK_IS_ROLE_DEFINITION"
  61. WScript.Echo "IsRoleDefintion" & "=" & Obj.IsRoleDefinition
  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. WScript.Echo "Type" & "=" & Obj.Type
  77. AzPrintAttr Lvl, Obj, AZ_PROP_GROUP_LDAP_QUERY, "AZ_PROP_GROUP_LDAP_QUERY"
  78. WScript.Echo "Ldap Query" & "=" & Obj.LdapQuery
  79. Mems = Obj.GetProperty(AZ_PROP_GROUP_MEMBERS, 0)
  80. For Each Mem In Mems
  81. AzPrintItem Lvl, "SidMember", Mem
  82. Next
  83. NonMems = Obj.GetProperty(AZ_PROP_GROUP_NON_MEMBERS, 0)
  84. For Each Mem In NonMems
  85. AzPrintItem Lvl, "SidNonMember", Mem
  86. Next
  87. AppMems = Obj.GetProperty(AZ_PROP_GROUP_APP_MEMBERS, 0)
  88. For Each Mem In AppMems
  89. AzPrintItem Lvl, "AppMemberLink", Mem
  90. Next
  91. AppNonMems = Obj.GetProperty(AZ_PROP_GROUP_APP_NON_MEMBERS, 0)
  92. For Each Mem In AppNonMems
  93. AzPrintItem Lvl, "AppNonMemberLink", Mem
  94. Next
  95. WScript.Echo ""
  96. End Sub
  97. Sub AzPrintScope(Lvl, Obj)
  98. AzPrintCommon Lvl, "Scope", Obj
  99. WScript.Echo ""
  100. End Sub
  101. Sub AzPrintRole(Lvl, Obj)
  102. Dim Mems, SidMems, Ops, Tasks
  103. AzPrintCommon Lvl, "Role", Obj
  104. Ops = Obj.GetProperty(AZ_PROP_ROLE_OPERATIONS, 0)
  105. For Each Op In Ops
  106. AzPrintItem Lvl, "OperationLink", Op
  107. Next
  108. Tasks = Obj.GetProperty(AZ_PROP_ROLE_TASKS, 0)
  109. For Each Task In Tasks
  110. AzPrintItem Lvl, "TaskLink", Task
  111. Next
  112. SidMems = Obj.GetProperty(AZ_PROP_ROLE_MEMBERS, 0)
  113. For Each Mem In SidMems
  114. AzPrintItem Lvl, "SidMember", Mem
  115. Next
  116. Mems = Obj.GetProperty(AZ_PROP_ROLE_APP_MEMBERS, 0)
  117. For Each Mem In Mems
  118. AzPrintItem Lvl, "AppMemberLink", Mem
  119. Next
  120. WScript.Echo ""
  121. End Sub
  122. Sub AzPrintPolicy(Admin)
  123. AzPrintAdmin 0, Admin
  124. ' navigate whole tree
  125. Dim Apps, App
  126. Set Apps=Admin.Applications
  127. For Each App In Apps
  128. AzPrintApp 1, App
  129. Dim Ops, Op
  130. Set Ops=App.Operations
  131. For Each Op In Ops
  132. AzPrintOp 2, Op
  133. Next
  134. Dim Tks, Tk
  135. Set Tks=App.Tasks
  136. For Each Tk In Tks
  137. AzPrintTask 2, Tk
  138. Next
  139. Dim Gps, Gp
  140. Set Gps=App.ApplicationGroups
  141. For Each Gp In Gps
  142. AzPrintGroup 2, Gp
  143. Next
  144. Dim Rls, Rl
  145. Set Rls=App.Roles
  146. For Each Rl In Rls
  147. AzPrintRole 2, Rl
  148. Next
  149. Dim Scs, Sc
  150. Set Scs=App.Scopes
  151. For Each Sc In Scs
  152. AzPrintScope 2, Sc
  153. Dim STks, STk
  154. Set STks=Sc.Tasks
  155. For Each STk In STks
  156. AzPrintTask 3, STk
  157. Next
  158. Dim SGps, SGp
  159. Set SGps=Sc.ApplicationGroups
  160. For Each SGp In SGps
  161. AzPrintGroup 3, SGp
  162. Next
  163. Dim SRls, SRl
  164. Set SRls=Sc.Roles
  165. For Each SRl In SRls
  166. AzPrintRole 3, SRl
  167. Next
  168. Set STks=Nothing
  169. Set SGps=Nothing
  170. Set SRls=Nothing
  171. Next
  172. Set Ops=Nothing
  173. Set Tks=Nothing
  174. Set Gps=Nothing
  175. Set Rls=Nothing
  176. Set Scs=Nothing
  177. Next
  178. Dim Groups, Group
  179. Set Groups=Admin.ApplicationGroups
  180. For Each Group In Groups
  181. AzPrintGroup 1, Group
  182. Next
  183. Set Groups=Nothing
  184. Set Apps=Nothing
  185. End Sub 'AzPrintPolicy
  186. Sub AzPrintPolicyFile(localXmlFile)
  187. Dim Admin
  188. WScript.Echo "Store = " & localXmlFile
  189. Set Admin=CreateObject("AzRoles.AzAdminManager")
  190. Admin.Initialize 0, localXmlFile
  191. WScript.Echo ""
  192. AzPrintPolicy Admin
  193. Set Admin=Nothing
  194. End Sub 'AzPrintPolicyFile