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.

127 lines
5.0 KiB

  1. #pragma once
  2. #include "Resource.h"
  3. //---------------------------------------------------------------------------
  4. // CMigration
  5. //---------------------------------------------------------------------------
  6. class ATL_NO_VTABLE CMigration :
  7. public CComObjectRootEx<CComSingleThreadModel>,
  8. public CComCoClass<CMigration, &CLSID_Migration>,
  9. public ISupportErrorInfoImpl<&IID_IMigration>,
  10. public IDispatchImpl<IMigration, &IID_IMigration, &LIBID_ADMT>,
  11. public IMigrationInternal
  12. {
  13. public:
  14. CMigration();
  15. ~CMigration();
  16. HRESULT FinalConstruct();
  17. void FinalRelease();
  18. DECLARE_REGISTRY_RESOURCEID(IDR_MIGRATION)
  19. DECLARE_NOT_AGGREGATABLE(CMigration)
  20. BEGIN_COM_MAP(CMigration)
  21. COM_INTERFACE_ENTRY(IDispatch)
  22. COM_INTERFACE_ENTRY(IMigration)
  23. COM_INTERFACE_ENTRY(IMigrationInternal)
  24. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  25. END_COM_MAP()
  26. public:
  27. // IMigration
  28. STDMETHOD(put_TestMigration)(VARIANT_BOOL bTest);
  29. STDMETHOD(get_TestMigration)(VARIANT_BOOL* pbTest);
  30. STDMETHOD(put_IntraForest)(VARIANT_BOOL bIntraForest);
  31. STDMETHOD(get_IntraForest)(VARIANT_BOOL* pbIntraForest);
  32. STDMETHOD(put_SourceDomain)(BSTR bstrDomain);
  33. STDMETHOD(get_SourceDomain)(BSTR* pbstrDomain);
  34. STDMETHOD(put_SourceOu)(BSTR bstrOu);
  35. STDMETHOD(get_SourceOu)(BSTR* pbstrOu);
  36. STDMETHOD(put_TargetDomain)(BSTR bstrDomain);
  37. STDMETHOD(get_TargetDomain)(BSTR* pbstrDomain);
  38. STDMETHOD(put_TargetOu)(BSTR bstrOu);
  39. STDMETHOD(get_TargetOu)(BSTR* pbstrOu);
  40. STDMETHOD(put_RenameOption)(long lOption);
  41. STDMETHOD(get_RenameOption)(long* plOption);
  42. STDMETHOD(put_RenamePrefixOrSuffix)(BSTR bstrPrefixOrSuffix);
  43. STDMETHOD(get_RenamePrefixOrSuffix)(BSTR* pbstrPrefixOrSuffix);
  44. STDMETHOD(put_PasswordOption)(long lOption);
  45. STDMETHOD(get_PasswordOption)(long* plOption);
  46. STDMETHOD(put_PasswordServer)(BSTR bstrServer);
  47. STDMETHOD(get_PasswordServer)(BSTR* pbstrServer);
  48. STDMETHOD(put_PasswordFile)(BSTR bstrPath);
  49. STDMETHOD(get_PasswordFile)(BSTR* pbstrPath);
  50. STDMETHOD(put_ConflictOptions)(long lOptions);
  51. STDMETHOD(get_ConflictOptions)(long* plOptions);
  52. STDMETHOD(put_ConflictPrefixOrSuffix)(BSTR bstrPrefixOrSuffix);
  53. STDMETHOD(get_ConflictPrefixOrSuffix)(BSTR* pbstrPrefixOrSuffix);
  54. STDMETHOD(put_UserPropertiesToExclude)(BSTR bstrProperties);
  55. STDMETHOD(get_UserPropertiesToExclude)(BSTR* pbstrProperties);
  56. STDMETHOD(put_InetOrgPersonPropertiesToExclude)(BSTR bstrProperties);
  57. STDMETHOD(get_InetOrgPersonPropertiesToExclude)(BSTR* pbstrProperties);
  58. STDMETHOD(put_GroupPropertiesToExclude)(BSTR bstrProperties);
  59. STDMETHOD(get_GroupPropertiesToExclude)(BSTR* pbstrProperties);
  60. STDMETHOD(put_ComputerPropertiesToExclude)(BSTR bstrProperties);
  61. STDMETHOD(get_ComputerPropertiesToExclude)(BSTR* pbstrProperties);
  62. STDMETHOD(put_SystemPropertiesToExclude)(BSTR bstrProperties);
  63. STDMETHOD(get_SystemPropertiesToExclude)(BSTR* pbstrProperties);
  64. STDMETHOD(CreateUserMigration)(IUserMigration** pitfUserMigration);
  65. STDMETHOD(CreateGroupMigration)(IGroupMigration** pitfGroupMigration);
  66. STDMETHOD(CreateComputerMigration)(IComputerMigration** pitfComputerMigration);
  67. STDMETHOD(CreateSecurityTranslation)(ISecurityTranslation** pitfSecurityTranslation);
  68. STDMETHOD(CreateServiceAccountEnumeration)(IServiceAccountEnumeration** pitfServiceAccountEnumeration);
  69. STDMETHOD(CreateReportGeneration)(IReportGeneration** pitfReportGeneration);
  70. // IMigrationInternal
  71. // Note: properties implemented by IMigration interface implementation
  72. // STDMETHOD(get_TestMigration)(VARIANT_BOOL* pbTest);
  73. // STDMETHOD(get_IntraForest)(VARIANT_BOOL* pbIntraForest);
  74. // STDMETHOD(get_SourceOu)(BSTR* pbstrOu);
  75. // STDMETHOD(get_TargetOu)(BSTR* pbstrOu);
  76. // STDMETHOD(get_RenameOption)(long* plOption);
  77. // STDMETHOD(get_RenamePrefixOrSuffix)(BSTR* pbstrPrefixOrSuffix);
  78. // STDMETHOD(get_PasswordOption)(long* plOption);
  79. // STDMETHOD(get_PasswordFile)(BSTR* pbstrPath);
  80. // STDMETHOD(get_ConflictOptions)(long* plOptions);
  81. // STDMETHOD(get_ConflictPrefixOrSuffix)(BSTR* pbstrPrefixOrSuffix);
  82. // STDMETHOD(get_UserPropertiesToExclude)(BSTR* pbstrProperties);
  83. // STDMETHOD(get_InetOrgPersonPropertiesToExclude)(BSTR* pbstrProperties);
  84. // STDMETHOD(get_GroupPropertiesToExclude)(BSTR* pbstrProperties);
  85. // STDMETHOD(get_ComputerPropertiesToExclude)(BSTR* pbstrProperties);
  86. protected:
  87. static _bstr_t GetValidDcName(_bstr_t strDcName);
  88. static void UpdateDatabase();
  89. static _bstr_t GetParsedExcludeProperties(LPCTSTR pszOld);
  90. protected:
  91. bool m_bTestMigration;
  92. bool m_bIntraForest;
  93. _bstr_t m_bstrSourceDomain;
  94. _bstr_t m_bstrSourceOu;
  95. _bstr_t m_bstrTargetDomain;
  96. _bstr_t m_bstrTargetOu;
  97. long m_lRenameOption;
  98. _bstr_t m_bstrRenamePrefixOrSuffix;
  99. long m_lPasswordOption;
  100. _bstr_t m_bstrPasswordServer;
  101. _bstr_t m_bstrPasswordFile;
  102. long m_lConflictOptions;
  103. _bstr_t m_bstrConflictPrefixOrSuffix;
  104. _bstr_t m_bstrUserPropertiesToExclude;
  105. _bstr_t m_bstrInetOrgPersonPropertiesToExclude;
  106. _bstr_t m_bstrGroupPropertiesToExclude;
  107. _bstr_t m_bstrComputerPropertiesToExclude;
  108. };