Source code of Windows XP (NT5)
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.

2131 lines
35 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000
  5. //
  6. // File: addtable.cpp
  7. //
  8. // Contents: Defines a table which contains the classes which can be
  9. // created through dsadd.exe
  10. //
  11. // History: 22-Sep-2000 JeffJon Created
  12. //
  13. //
  14. //--------------------------------------------------------------------------
  15. #include "pch.h"
  16. #include "cstrings.h"
  17. #include "addtable.h"
  18. #include "usage.h"
  19. //+-------------------------------------------------------------------------
  20. // Parser table
  21. //--------------------------------------------------------------------------
  22. ARG_RECORD DSADD_COMMON_COMMANDS[] =
  23. {
  24. #ifdef DBG
  25. //
  26. // -debug, -debug
  27. //
  28. 0,(LPWSTR)c_sz_arg1_com_debug,
  29. ID_ARG2_NULL,NULL,
  30. ARG_TYPE_DEBUG, ARG_FLAG_OPTIONAL|ARG_FLAG_HIDDEN,
  31. (CMD_TYPE)0,
  32. 0, NULL,
  33. #endif
  34. //
  35. // h, ?
  36. //
  37. 0,(LPWSTR)c_sz_arg1_com_help,
  38. 0,(LPWSTR)c_sz_arg2_com_help,
  39. ARG_TYPE_HELP, ARG_FLAG_OPTIONAL,
  40. (CMD_TYPE)FALSE,
  41. 0, NULL,
  42. //
  43. // s,server
  44. //
  45. 0,(LPWSTR)c_sz_arg1_com_server,
  46. 0,(LPWSTR)c_sz_arg2_com_server,
  47. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  48. NULL,
  49. 0, NULL,
  50. //
  51. // d,domain
  52. //
  53. 0,(LPWSTR)c_sz_arg1_com_domain,
  54. 0,(LPWSTR)c_sz_arg2_com_domain,
  55. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  56. NULL,
  57. 0, NULL,
  58. //
  59. // u, username
  60. //
  61. 0,(LPWSTR)c_sz_arg1_com_username,
  62. 0,(LPWSTR)c_sz_arg2_com_username,
  63. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  64. NULL,
  65. 0, NULL,
  66. //
  67. // w, password
  68. //
  69. 0,(LPWSTR)c_sz_arg1_com_password,
  70. 0,(LPWSTR)c_sz_arg2_com_password,
  71. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  72. (CMD_TYPE)_T(""),
  73. 0, ValidateAdminPassword,
  74. //
  75. // q,q
  76. //
  77. 0,(LPWSTR)c_sz_arg1_com_quiet,
  78. ID_ARG2_NULL,NULL,
  79. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  80. (CMD_TYPE)_T(""),
  81. 0, NULL,
  82. //
  83. // c Continue
  84. //
  85. 0,(PWSTR)c_sz_arg1_com_continue,
  86. ID_ARG2_NULL, NULL,
  87. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  88. (CMD_TYPE)_T(""),
  89. 0, NULL,
  90. //
  91. // objecttype
  92. //
  93. 0,(LPWSTR)c_sz_arg1_com_objecttype,
  94. ID_ARG2_NULL,NULL,
  95. ARG_TYPE_STR, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG|ARG_FLAG_STDIN,
  96. 0,
  97. 0, NULL,
  98. //
  99. // objectDN
  100. //
  101. 0,(LPWSTR)c_sz_arg1_com_objectDN,
  102. ID_ARG2_NULL,NULL,
  103. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG|ARG_FLAG_DN,
  104. 0,
  105. 0, NULL,
  106. //
  107. // description
  108. //
  109. 0, (PWSTR)c_sz_arg1_com_description,
  110. ID_ARG2_NULL, NULL,
  111. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  112. 0,
  113. 0, NULL,
  114. ARG_TERMINATOR
  115. };
  116. ARG_RECORD DSADD_USER_COMMANDS[]=
  117. {
  118. //
  119. // samid sAMAccountName
  120. //
  121. 0, (PWSTR)g_pszArg1UserSAM,
  122. ID_ARG2_NULL, NULL,
  123. ARG_TYPE_STR, ARG_FLAG_REQUIRED,
  124. 0,
  125. 0, NULL,
  126. //
  127. // upn
  128. //
  129. 0, (PWSTR)g_pszArg1UserUPN,
  130. ID_ARG2_NULL, NULL,
  131. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  132. 0,
  133. 0, NULL,
  134. //
  135. // fn. FirstName
  136. //
  137. 0, (PWSTR)g_pszArg1UserFirstName,
  138. ID_ARG2_NULL, NULL,
  139. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  140. 0,
  141. 0, NULL,
  142. //
  143. // mi Middle Initial
  144. //
  145. 0, (PWSTR)g_pszArg1UserMiddleInitial,
  146. ID_ARG2_NULL, NULL,
  147. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  148. 0,
  149. 0, NULL,
  150. //
  151. // ln LastName
  152. //
  153. 0, (PWSTR)g_pszArg1UserLastName,
  154. ID_ARG2_NULL, NULL,
  155. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  156. 0,
  157. 0, NULL,
  158. //
  159. // display DisplayName
  160. //
  161. 0, (PWSTR)g_pszArg1UserDisplayName,
  162. ID_ARG2_NULL, NULL,
  163. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  164. 0,
  165. 0, NULL,
  166. //
  167. // empid Employee ID
  168. //
  169. 0, (PWSTR)g_pszArg1UserEmpID,
  170. ID_ARG2_NULL, NULL,
  171. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  172. 0,
  173. 0, NULL,
  174. //
  175. // pwd Password
  176. //
  177. 0, (PWSTR)g_pszArg1UserPassword,
  178. ID_ARG2_NULL, NULL,
  179. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  180. 0,
  181. 0, ValidateUserPassword,
  182. //
  183. // memberOf MemberOf
  184. //
  185. 0, (PWSTR)g_pszArg1UserMemberOf,
  186. ID_ARG2_NULL, NULL,
  187. ARG_TYPE_MSZ, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  188. 0,
  189. 0, NULL,
  190. //
  191. // office Office Location
  192. //
  193. 0, (PWSTR)g_pszArg1UserOffice,
  194. ID_ARG2_NULL, NULL,
  195. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  196. 0,
  197. 0, NULL,
  198. //
  199. // tel Telephone
  200. //
  201. 0, (PWSTR)g_pszArg1UserTelephone,
  202. ID_ARG2_NULL, NULL,
  203. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  204. 0,
  205. 0, NULL,
  206. //
  207. // email E-mail
  208. //
  209. 0, (PWSTR)g_pszArg1UserEmail,
  210. ID_ARG2_NULL, NULL,
  211. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  212. 0,
  213. 0, NULL,
  214. //
  215. // hometel Home Telephone
  216. //
  217. 0, (PWSTR)g_pszArg1UserHomeTelephone,
  218. ID_ARG2_NULL, NULL,
  219. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  220. 0,
  221. 0, NULL,
  222. //
  223. // pager Pager number
  224. //
  225. 0, (PWSTR)g_pszArg1UserPagerNumber,
  226. ID_ARG2_NULL, NULL,
  227. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  228. 0,
  229. 0, NULL,
  230. //
  231. // mobile Mobile Telephone Number
  232. //
  233. 0, (PWSTR)g_pszArg1UserMobileNumber,
  234. ID_ARG2_NULL, NULL,
  235. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  236. 0,
  237. 0, NULL,
  238. //
  239. // fax Fax Number
  240. //
  241. 0, (PWSTR)g_pszArg1UserFaxNumber,
  242. ID_ARG2_NULL, NULL,
  243. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  244. 0,
  245. 0, NULL,
  246. //
  247. // iptel IP Telephone
  248. //
  249. 0, (PWSTR)g_pszArg1UserIPTel,
  250. ID_ARG2_NULL, NULL,
  251. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  252. 0,
  253. 0, NULL,
  254. //
  255. // webpg Web Page
  256. //
  257. 0, (PWSTR)g_pszArg1UserWebPage,
  258. ID_ARG2_NULL, NULL,
  259. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  260. 0,
  261. 0, NULL,
  262. //
  263. // title Title
  264. //
  265. 0, (PWSTR)g_pszArg1UserTitle,
  266. ID_ARG2_NULL, NULL,
  267. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  268. 0,
  269. 0, NULL,
  270. //
  271. // dept Department
  272. //
  273. 0, (PWSTR)g_pszArg1UserDepartment,
  274. ID_ARG2_NULL, NULL,
  275. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  276. 0,
  277. 0, NULL,
  278. //
  279. // company Company
  280. //
  281. 0, (PWSTR)g_pszArg1UserCompany,
  282. ID_ARG2_NULL, NULL,
  283. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  284. 0,
  285. 0, NULL,
  286. //
  287. // mgr Manager
  288. //
  289. 0, (PWSTR)g_pszArg1UserManager,
  290. ID_ARG2_NULL, NULL,
  291. ARG_TYPE_STR, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  292. 0,
  293. 0, NULL,
  294. //
  295. // hmdir Home Directory
  296. //
  297. 0, (PWSTR)g_pszArg1UserHomeDirectory,
  298. ID_ARG2_NULL, NULL,
  299. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  300. 0,
  301. 0, NULL,
  302. //
  303. // hmdrv Home Drive
  304. //
  305. 0, (PWSTR)g_pszArg1UserHomeDrive,
  306. ID_ARG2_NULL, NULL,
  307. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  308. 0,
  309. 0, NULL,
  310. //
  311. // profile Profile path
  312. //
  313. 0, (PWSTR)g_pszArg1UserProfilePath,
  314. ID_ARG2_NULL, NULL,
  315. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  316. 0,
  317. 0, NULL,
  318. //
  319. // loscr Script path
  320. //
  321. 0, (PWSTR)g_pszArg1UserScriptPath,
  322. ID_ARG2_NULL, NULL,
  323. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  324. 0,
  325. 0, NULL,
  326. //
  327. // mustchpwd Must Change Password at next logon
  328. //
  329. 0, (PWSTR)g_pszArg1UserMustChangePwd,
  330. ID_ARG2_NULL, NULL,
  331. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  332. 0,
  333. 0, ValidateYesNo,
  334. //
  335. // canchpwd Can Change Password
  336. //
  337. 0, (PWSTR)g_pszArg1UserCanChangePwd,
  338. ID_ARG2_NULL, NULL,
  339. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  340. 0,
  341. 0, ValidateYesNo,
  342. //
  343. // reversiblepwd Password stored with reversible encryption
  344. //
  345. 0, (PWSTR)g_pszArg1UserReversiblePwd,
  346. ID_ARG2_NULL, NULL,
  347. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  348. 0,
  349. 0, ValidateYesNo,
  350. //
  351. // pwdneverexpires Password never expires
  352. //
  353. 0, (PWSTR)g_pszArg1UserPwdNeverExpires,
  354. ID_ARG2_NULL, NULL,
  355. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  356. 0,
  357. 0, ValidateYesNo,
  358. //
  359. // acctexpires Account Expires
  360. //
  361. 0, (PWSTR)g_pszArg1UserAccountExpires,
  362. ID_ARG2_NULL, NULL,
  363. ARG_TYPE_INTSTR, ARG_FLAG_OPTIONAL,
  364. 0,
  365. 0, ValidateNever,
  366. //
  367. // disabled Disable Account
  368. //
  369. 0, (PWSTR)g_pszArg1UserDisableAccount,
  370. ID_ARG2_NULL, NULL,
  371. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  372. 0,
  373. 0, ValidateYesNo,
  374. ARG_TERMINATOR
  375. };
  376. ARG_RECORD DSADD_COMPUTER_COMMANDS[]=
  377. {
  378. //
  379. // samname
  380. //
  381. 0, (PWSTR)g_pszArg1ComputerSAMName,
  382. ID_ARG2_NULL, NULL,
  383. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  384. 0,
  385. 0, NULL,
  386. //
  387. // loc Location
  388. //
  389. 0, (PWSTR)g_pszArg1ComputerLocation,
  390. ID_ARG2_NULL, NULL,
  391. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  392. 0,
  393. 0, NULL,
  394. //
  395. // disabled
  396. //
  397. 0, (PWSTR)g_pszArg1ComputerMemberOf,
  398. ID_ARG2_NULL, NULL,
  399. ARG_TYPE_MSZ, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  400. 0,
  401. 0, NULL,
  402. ARG_TERMINATOR,
  403. };
  404. ARG_RECORD DSADD_GROUP_COMMANDS[]=
  405. {
  406. //
  407. // samname
  408. //
  409. 0, (PWSTR)g_pszArg1GroupSAMName,
  410. ID_ARG2_NULL, NULL,
  411. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  412. 0,
  413. 0, NULL,
  414. //
  415. // secgrp Security enabled
  416. //
  417. 0, (PWSTR)g_pszArg1GroupSec,
  418. ID_ARG2_NULL, NULL,
  419. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  420. 0,
  421. 0, ValidateYesNo,
  422. //
  423. // scope Group scope (local/global/universal)
  424. //
  425. 0, (PWSTR)g_pszArg1GroupScope,
  426. ID_ARG2_NULL, NULL,
  427. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  428. 0,
  429. 0, ValidateGroupScope,
  430. //
  431. // memberof MemberOf
  432. //
  433. 0, (PWSTR)g_pszArg1GroupMemberOf,
  434. ID_ARG2_NULL, NULL,
  435. ARG_TYPE_MSZ, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  436. 0,
  437. 0, NULL,
  438. //
  439. // members Members of the group
  440. //
  441. 0, (PWSTR)g_pszArg1GroupMembers,
  442. ID_ARG2_NULL, NULL,
  443. ARG_TYPE_MSZ, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  444. 0,
  445. 0, NULL,
  446. ARG_TERMINATOR,
  447. };
  448. ARG_RECORD DSADD_CONTACT_COMMANDS[]=
  449. {
  450. //
  451. // fn. FirstName
  452. //
  453. 0, (PWSTR)g_pszArg1UserFirstName,
  454. ID_ARG2_NULL, NULL,
  455. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  456. 0,
  457. 0, NULL,
  458. //
  459. // mi Middle Initial
  460. //
  461. 0, (PWSTR)g_pszArg1UserMiddleInitial,
  462. ID_ARG2_NULL, NULL,
  463. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  464. 0,
  465. 0, NULL,
  466. //
  467. // ln LastName
  468. //
  469. 0, (PWSTR)g_pszArg1UserLastName,
  470. ID_ARG2_NULL, NULL,
  471. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  472. 0,
  473. 0, NULL,
  474. //
  475. // display DisplayName
  476. //
  477. 0, (PWSTR)g_pszArg1UserDisplayName,
  478. ID_ARG2_NULL, NULL,
  479. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  480. 0,
  481. 0, NULL,
  482. //
  483. // office Office Location
  484. //
  485. 0, (PWSTR)g_pszArg1UserOffice,
  486. ID_ARG2_NULL, NULL,
  487. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  488. 0,
  489. 0, NULL,
  490. //
  491. // tel Telephone
  492. //
  493. 0, (PWSTR)g_pszArg1UserTelephone,
  494. ID_ARG2_NULL, NULL,
  495. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  496. 0,
  497. 0, NULL,
  498. //
  499. // email E-mail
  500. //
  501. 0, (PWSTR)g_pszArg1UserEmail,
  502. ID_ARG2_NULL, NULL,
  503. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  504. 0,
  505. 0, NULL,
  506. //
  507. // hometel Home Telephone
  508. //
  509. 0, (PWSTR)g_pszArg1UserHomeTelephone,
  510. ID_ARG2_NULL, NULL,
  511. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  512. 0,
  513. 0, NULL,
  514. //
  515. // pager Pager number
  516. //
  517. 0, (PWSTR)g_pszArg1UserPagerNumber,
  518. ID_ARG2_NULL, NULL,
  519. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  520. 0,
  521. 0, NULL,
  522. //
  523. // mobile Mobile Telephone Number
  524. //
  525. 0, (PWSTR)g_pszArg1UserMobileNumber,
  526. ID_ARG2_NULL, NULL,
  527. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  528. 0,
  529. 0, NULL,
  530. //
  531. // fax Fax Number
  532. //
  533. 0, (PWSTR)g_pszArg1UserFaxNumber,
  534. ID_ARG2_NULL, NULL,
  535. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  536. 0,
  537. 0, NULL,
  538. //
  539. // title Title
  540. //
  541. 0, (PWSTR)g_pszArg1UserTitle,
  542. ID_ARG2_NULL, NULL,
  543. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  544. 0,
  545. 0, NULL,
  546. //
  547. // dept Department
  548. //
  549. 0, (PWSTR)g_pszArg1UserDepartment,
  550. ID_ARG2_NULL, NULL,
  551. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  552. 0,
  553. 0, NULL,
  554. //
  555. // company Company
  556. //
  557. 0, (PWSTR)g_pszArg1UserCompany,
  558. ID_ARG2_NULL, NULL,
  559. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  560. 0,
  561. 0, NULL,
  562. ARG_TERMINATOR,
  563. };
  564. /*
  565. ARG_RECORD DSADD_SUBNET_COMMANDS[]=
  566. {
  567. //name_or_objectdn
  568. IDS_ARG1_SUBNET_NAME_OR_OBJECTDN, NULL,
  569. ID_ARG2_NULL, NULL,
  570. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG,
  571. 0,
  572. 0, NULL,
  573. //name
  574. IDS_ARG1_SUBNET_NAME, NULL,
  575. ID_ARG2_NULL, NULL,
  576. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  577. 0,
  578. 0, NULL,
  579. //desc
  580. IDS_ARG1_SUBNET_DESC, NULL,
  581. ID_ARG2_NULL, NULL,
  582. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  583. 0,
  584. 0, NULL,
  585. //site
  586. IDS_ARG1_SUBNET_SITE, NULL,
  587. ID_ARG2_NULL, NULL,
  588. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  589. 0,
  590. 0, NULL,
  591. ARG_TERMINATOR,
  592. };
  593. ARG_RECORD DSADD_SITE_COMMANDS[]=
  594. {
  595. //name_or_objectdn
  596. IDS_ARG1_SITE_NAME_OR_OBJECTDN, NULL,
  597. ID_ARG2_NULL, NULL,
  598. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG,
  599. 0,
  600. 0, NULL,
  601. //name
  602. IDS_ARG1_SITE_NAME, NULL,
  603. ID_ARG2_NULL, NULL,
  604. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  605. 0,
  606. 0, NULL,
  607. //desc
  608. IDS_ARG1_SITE_DESC, NULL,
  609. ID_ARG2_NULL, NULL,
  610. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  611. 0,
  612. 0, NULL,
  613. //autotopology
  614. IDS_ARG1_SITE_AUTOTOPOLOGY, NULL,
  615. ID_ARG2_NULL, NULL,
  616. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  617. 0,
  618. 0, NULL,
  619. ARG_TERMINATOR,
  620. };
  621. ARG_RECORD DSADD_SLINK_COMMANDS[]=
  622. {
  623. //name_or_objectdn
  624. IDS_ARG1_SLINK_NAME_OR_OBJECTDN, NULL,
  625. ID_ARG2_NULL, NULL,
  626. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG,
  627. 0,
  628. 0, NULL,
  629. //ip
  630. IDS_ARG1_SLINK_IP, NULL,
  631. ID_ARG2_NULL, NULL,
  632. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  633. 0,
  634. 0, NULL,
  635. //smtp
  636. IDS_ARG1_SLINK_SMTP, NULL,
  637. ID_ARG2_NULL, NULL,
  638. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  639. 0,
  640. 0, NULL,
  641. //name
  642. IDS_ARG1_SLINK_NAME, NULL,
  643. ID_ARG2_NULL, NULL,
  644. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  645. 0,
  646. 0, NULL,
  647. //addsite
  648. IDS_ARG1_SLINK_ADDSITE, NULL,
  649. ID_ARG2_NULL, NULL,
  650. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  651. 0,
  652. 0, NULL,
  653. //rmsite
  654. IDS_ARG1_SLINK_RMSITE, NULL,
  655. ID_ARG2_NULL, NULL,
  656. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  657. 0,
  658. 0, NULL,
  659. //cost
  660. IDS_ARG1_SLINK_COST, NULL,
  661. ID_ARG2_NULL, NULL,
  662. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  663. 0,
  664. 0, NULL,
  665. //repint
  666. IDS_ARG1_SLINK_REPINT, NULL,
  667. ID_ARG2_NULL, NULL,
  668. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  669. 0,
  670. 0, NULL,
  671. //desc
  672. IDS_ARG1_SLINK_DESC, NULL,
  673. ID_ARG2_NULL, NULL,
  674. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  675. 0,
  676. 0, NULL,
  677. //autobacksync
  678. IDS_ARG1_SLINK_AUTOBACKSYNC, NULL,
  679. ID_ARG2_NULL, NULL,
  680. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  681. 0,
  682. 0, NULL,
  683. //notify
  684. IDS_ARG1_SLINK_NOTIFY, NULL,
  685. ID_ARG2_NULL, NULL,
  686. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  687. 0,
  688. 0, NULL,
  689. ARG_TERMINATOR,
  690. };
  691. ARG_RECORD DSADD_SLINKBR_COMMANDS[]=
  692. {
  693. //name_or_objectdn
  694. IDS_ARG1_SLINKBR_NAME_OR_OBJECTDN, NULL,
  695. ID_ARG2_NULL, NULL,
  696. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG,
  697. 0,
  698. 0, NULL,
  699. //ip
  700. IDS_ARG1_SLINKBR_IP, NULL,
  701. ID_ARG2_NULL, NULL,
  702. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  703. 0,
  704. 0, NULL,
  705. //smtp
  706. IDS_ARG1_SLINKBR_SMTP, NULL,
  707. ID_ARG2_NULL, NULL,
  708. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  709. 0,
  710. 0, NULL,
  711. //name
  712. IDS_ARG1_SLINKBR_NAME, NULL,
  713. ID_ARG2_NULL, NULL,
  714. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  715. 0,
  716. 0, NULL,
  717. //addslink
  718. IDS_ARG1_SLINKBR_ADDSLINK, NULL,
  719. ID_ARG2_NULL, NULL,
  720. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  721. 0,
  722. 0, NULL,
  723. //rmslink
  724. IDS_ARG1_SLINKBR_RMSLINK, NULL,
  725. ID_ARG2_NULL, NULL,
  726. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  727. 0,
  728. 0, NULL,
  729. //desc
  730. IDS_ARG1_SLINKBR_DESC, NULL,
  731. ID_ARG2_NULL, NULL,
  732. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  733. 0,
  734. 0, NULL,
  735. ARG_TERMINATOR,
  736. };
  737. ARG_RECORD DSADD_CONN_COMMANDS[]=
  738. {
  739. //name_or_objectdn
  740. IDS_ARG1_CONN_NAME_OR_OBJECTDN, NULL,
  741. ID_ARG2_NULL, NULL,
  742. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG,
  743. 0,
  744. 0, NULL,
  745. //transport
  746. IDS_ARG1_CONN_TRANSPORT, NULL,
  747. ID_ARG2_NULL, NULL,
  748. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  749. 0,
  750. 0, NULL,
  751. //enabled
  752. IDS_ARG1_CONN_ENABLED, NULL,
  753. ID_ARG2_NULL, NULL,
  754. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  755. 0,
  756. 0, NULL,
  757. //desc
  758. IDS_ARG1_CONN_DESC, NULL,
  759. ID_ARG2_NULL, NULL,
  760. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  761. 0,
  762. 0, NULL,
  763. //manual
  764. IDS_ARG1_CONN_MANUAL, NULL,
  765. ID_ARG2_NULL, NULL,
  766. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  767. 0,
  768. 0, NULL,
  769. //autobacksync
  770. IDS_ARG1_CONN_AUTOBACKSYNC, NULL,
  771. ID_ARG2_NULL, NULL,
  772. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  773. 0,
  774. 0, NULL,
  775. //notify
  776. IDS_ARG1_CONN_NOTIFY, NULL,
  777. ID_ARG2_NULL, NULL,
  778. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  779. 0,
  780. 0, NULL,
  781. ARG_TERMINATOR,
  782. };
  783. ARG_RECORD DSADD_SERVER_COMMANDS[]=
  784. {
  785. //name_or_objectdn
  786. IDS_ARG1_SERVER_NAME_OR_OBJECTDN, NULL,
  787. ID_ARG2_NULL, NULL,
  788. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG,
  789. 0,
  790. 0, NULL,
  791. //name
  792. IDS_ARG1_SERVER_NAME, NULL,
  793. ID_ARG2_NULL, NULL,
  794. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  795. 0,
  796. 0, NULL,
  797. //desc
  798. IDS_ARG1_SERVER_DESC, NULL,
  799. ID_ARG2_NULL, NULL,
  800. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  801. 0,
  802. 0, NULL,
  803. //autotopology
  804. IDS_ARG1_SERVER_AUTOTOPOLOGY, NULL,
  805. ID_ARG2_NULL, NULL,
  806. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  807. 0,
  808. 0, NULL,
  809. ARG_TERMINATOR,
  810. };
  811. */
  812. //+-------------------------------------------------------------------------
  813. // Attributes
  814. //--------------------------------------------------------------------------
  815. //
  816. // Description
  817. //
  818. DSATTRIBUTEDESCRIPTION description =
  819. {
  820. {
  821. L"description",
  822. ADS_ATTR_UPDATE,
  823. ADSTYPE_CASE_IGNORE_STRING,
  824. NULL,
  825. 0
  826. },
  827. 0
  828. };
  829. DSATTRIBUTETABLEENTRY descriptionEntry =
  830. {
  831. L"description",
  832. eCommDescription,
  833. DS_ATTRIBUTE_ONCREATE,
  834. &description,
  835. FillAttrInfoFromObjectEntry,
  836. NULL
  837. };
  838. //
  839. // UPN
  840. //
  841. DSATTRIBUTEDESCRIPTION upn =
  842. {
  843. {
  844. L"userPrincipalName",
  845. ADS_ATTR_UPDATE,
  846. ADSTYPE_CASE_IGNORE_STRING,
  847. NULL,
  848. 0
  849. },
  850. 0
  851. };
  852. DSATTRIBUTETABLEENTRY upnUserEntry =
  853. {
  854. L"userPrincipalName",
  855. eUserUpn,
  856. DS_ATTRIBUTE_ONCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  857. &upn,
  858. FillAttrInfoFromObjectEntry,
  859. NULL
  860. };
  861. //
  862. // First name
  863. //
  864. DSATTRIBUTEDESCRIPTION firstName =
  865. {
  866. {
  867. L"givenName",
  868. ADS_ATTR_UPDATE,
  869. ADSTYPE_CASE_IGNORE_STRING,
  870. NULL,
  871. 0
  872. },
  873. 0
  874. };
  875. DSATTRIBUTETABLEENTRY firstNameUserEntry =
  876. {
  877. L"givenName",
  878. eUserFn,
  879. DS_ATTRIBUTE_ONCREATE,
  880. &firstName,
  881. FillAttrInfoFromObjectEntry,
  882. NULL
  883. };
  884. DSATTRIBUTETABLEENTRY firstNameContactEntry =
  885. {
  886. L"givenName",
  887. eContactFn,
  888. DS_ATTRIBUTE_ONCREATE,
  889. &firstName,
  890. FillAttrInfoFromObjectEntry,
  891. NULL
  892. };
  893. //
  894. // Middle Initial
  895. //
  896. DSATTRIBUTEDESCRIPTION middleInitial =
  897. {
  898. {
  899. L"initials",
  900. ADS_ATTR_UPDATE,
  901. ADSTYPE_CASE_IGNORE_STRING,
  902. NULL,
  903. 0
  904. },
  905. 0
  906. };
  907. DSATTRIBUTETABLEENTRY middleInitialUserEntry =
  908. {
  909. L"initials",
  910. eUserMi,
  911. DS_ATTRIBUTE_ONCREATE,
  912. &middleInitial,
  913. FillAttrInfoFromObjectEntry,
  914. NULL
  915. };
  916. DSATTRIBUTETABLEENTRY middleInitialContactEntry =
  917. {
  918. L"initials",
  919. eContactMi,
  920. DS_ATTRIBUTE_ONCREATE,
  921. &middleInitial,
  922. FillAttrInfoFromObjectEntry,
  923. NULL
  924. };
  925. //
  926. // Last name
  927. //
  928. DSATTRIBUTEDESCRIPTION lastName =
  929. {
  930. {
  931. L"sn",
  932. ADS_ATTR_UPDATE,
  933. ADSTYPE_CASE_IGNORE_STRING,
  934. NULL,
  935. 0
  936. },
  937. 0
  938. };
  939. DSATTRIBUTETABLEENTRY lastNameUserEntry =
  940. {
  941. L"sn",
  942. eUserLn,
  943. DS_ATTRIBUTE_ONCREATE,
  944. &lastName,
  945. FillAttrInfoFromObjectEntry,
  946. NULL
  947. };
  948. DSATTRIBUTETABLEENTRY lastNameContactEntry =
  949. {
  950. L"sn",
  951. eContactLn,
  952. DS_ATTRIBUTE_ONCREATE,
  953. &lastName,
  954. FillAttrInfoFromObjectEntry,
  955. NULL
  956. };
  957. //
  958. // Display name
  959. //
  960. DSATTRIBUTEDESCRIPTION displayName =
  961. {
  962. {
  963. L"displayName",
  964. ADS_ATTR_UPDATE,
  965. ADSTYPE_CASE_IGNORE_STRING,
  966. NULL,
  967. 0
  968. },
  969. 0
  970. };
  971. DSATTRIBUTETABLEENTRY displayNameUserEntry =
  972. {
  973. L"displayName",
  974. eUserDisplay,
  975. DS_ATTRIBUTE_ONCREATE,
  976. &displayName,
  977. FillAttrInfoFromObjectEntry,
  978. NULL
  979. };
  980. DSATTRIBUTETABLEENTRY displayNameContactEntry =
  981. {
  982. L"displayName",
  983. eContactDisplay,
  984. DS_ATTRIBUTE_ONCREATE,
  985. &displayName,
  986. FillAttrInfoFromObjectEntry,
  987. NULL
  988. };
  989. //
  990. // Employee ID
  991. //
  992. DSATTRIBUTEDESCRIPTION employeeID =
  993. {
  994. {
  995. L"employeeID",
  996. ADS_ATTR_UPDATE,
  997. ADSTYPE_CASE_IGNORE_STRING,
  998. NULL,
  999. 0
  1000. },
  1001. 0
  1002. };
  1003. DSATTRIBUTETABLEENTRY employeeIDUserEntry =
  1004. {
  1005. L"employeeID",
  1006. eUserEmpID,
  1007. DS_ATTRIBUTE_ONCREATE,
  1008. &employeeID,
  1009. FillAttrInfoFromObjectEntry,
  1010. NULL
  1011. };
  1012. //
  1013. // Password
  1014. //
  1015. DSATTRIBUTEDESCRIPTION password =
  1016. {
  1017. {
  1018. NULL,
  1019. ADS_ATTR_UPDATE,
  1020. ADSTYPE_INVALID,
  1021. NULL,
  1022. 0
  1023. },
  1024. 0
  1025. };
  1026. DSATTRIBUTETABLEENTRY passwordUserEntry =
  1027. {
  1028. L"password",
  1029. eUserPwd,
  1030. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1031. &password,
  1032. ResetUserPassword,
  1033. NULL
  1034. };
  1035. //
  1036. // Office
  1037. //
  1038. DSATTRIBUTEDESCRIPTION office =
  1039. {
  1040. {
  1041. L"physicalDeliveryOfficeName",
  1042. ADS_ATTR_UPDATE,
  1043. ADSTYPE_CASE_IGNORE_STRING,
  1044. NULL,
  1045. 0
  1046. },
  1047. 0
  1048. };
  1049. DSATTRIBUTETABLEENTRY officeUserEntry =
  1050. {
  1051. L"physicalDeliveryOfficeName",
  1052. eUserOffice,
  1053. DS_ATTRIBUTE_ONCREATE,
  1054. &office,
  1055. FillAttrInfoFromObjectEntry,
  1056. NULL
  1057. };
  1058. DSATTRIBUTETABLEENTRY officeContactEntry =
  1059. {
  1060. L"physicalDeliveryOfficeName",
  1061. eContactOffice,
  1062. DS_ATTRIBUTE_ONCREATE,
  1063. &office,
  1064. FillAttrInfoFromObjectEntry,
  1065. NULL
  1066. };
  1067. //
  1068. // Telephone
  1069. //
  1070. DSATTRIBUTEDESCRIPTION telephone =
  1071. {
  1072. {
  1073. L"telephoneNumber",
  1074. ADS_ATTR_UPDATE,
  1075. ADSTYPE_CASE_IGNORE_STRING,
  1076. NULL,
  1077. 0
  1078. },
  1079. 0
  1080. };
  1081. DSATTRIBUTETABLEENTRY telephoneUserEntry =
  1082. {
  1083. L"telephoneNumber",
  1084. eUserTel,
  1085. DS_ATTRIBUTE_ONCREATE,
  1086. &telephone,
  1087. FillAttrInfoFromObjectEntry,
  1088. NULL
  1089. };
  1090. DSATTRIBUTETABLEENTRY telephoneContactEntry =
  1091. {
  1092. L"telephoneNumber",
  1093. eContactTel,
  1094. DS_ATTRIBUTE_ONCREATE,
  1095. &telephone,
  1096. FillAttrInfoFromObjectEntry,
  1097. NULL
  1098. };
  1099. //
  1100. // Email
  1101. //
  1102. DSATTRIBUTEDESCRIPTION email =
  1103. {
  1104. {
  1105. L"mail",
  1106. ADS_ATTR_UPDATE,
  1107. ADSTYPE_CASE_IGNORE_STRING,
  1108. NULL,
  1109. 0
  1110. },
  1111. 0
  1112. };
  1113. DSATTRIBUTETABLEENTRY emailUserEntry =
  1114. {
  1115. L"mail",
  1116. eUserEmail,
  1117. DS_ATTRIBUTE_ONCREATE,
  1118. &email,
  1119. FillAttrInfoFromObjectEntry,
  1120. NULL
  1121. };
  1122. DSATTRIBUTETABLEENTRY emailContactEntry =
  1123. {
  1124. L"mail",
  1125. eContactEmail,
  1126. DS_ATTRIBUTE_ONCREATE,
  1127. &email,
  1128. FillAttrInfoFromObjectEntry,
  1129. NULL
  1130. };
  1131. //
  1132. // Home Telephone
  1133. //
  1134. DSATTRIBUTEDESCRIPTION homeTelephone =
  1135. {
  1136. {
  1137. L"homePhone",
  1138. ADS_ATTR_UPDATE,
  1139. ADSTYPE_CASE_IGNORE_STRING,
  1140. NULL,
  1141. 0
  1142. },
  1143. 0
  1144. };
  1145. DSATTRIBUTETABLEENTRY homeTelephoneUserEntry =
  1146. {
  1147. L"homePhone",
  1148. eUserHometel,
  1149. DS_ATTRIBUTE_ONCREATE,
  1150. &homeTelephone,
  1151. FillAttrInfoFromObjectEntry,
  1152. NULL
  1153. };
  1154. DSATTRIBUTETABLEENTRY homeTelephoneContactEntry =
  1155. {
  1156. L"homePhone",
  1157. eContactHometel,
  1158. DS_ATTRIBUTE_ONCREATE,
  1159. &homeTelephone,
  1160. FillAttrInfoFromObjectEntry,
  1161. NULL
  1162. };
  1163. //
  1164. // Pager
  1165. //
  1166. DSATTRIBUTEDESCRIPTION pager =
  1167. {
  1168. {
  1169. L"pager",
  1170. ADS_ATTR_UPDATE,
  1171. ADSTYPE_CASE_IGNORE_STRING,
  1172. NULL,
  1173. 0
  1174. },
  1175. 0
  1176. };
  1177. DSATTRIBUTETABLEENTRY pagerUserEntry =
  1178. {
  1179. L"pager",
  1180. eUserPager,
  1181. DS_ATTRIBUTE_ONCREATE,
  1182. &pager,
  1183. FillAttrInfoFromObjectEntry,
  1184. NULL
  1185. };
  1186. DSATTRIBUTETABLEENTRY pagerContactEntry =
  1187. {
  1188. L"pager",
  1189. eContactPager,
  1190. DS_ATTRIBUTE_ONCREATE,
  1191. &pager,
  1192. FillAttrInfoFromObjectEntry,
  1193. NULL
  1194. };
  1195. //
  1196. // Mobile phone
  1197. //
  1198. DSATTRIBUTEDESCRIPTION mobile =
  1199. {
  1200. {
  1201. L"mobile",
  1202. ADS_ATTR_UPDATE,
  1203. ADSTYPE_CASE_IGNORE_STRING,
  1204. NULL,
  1205. 0
  1206. },
  1207. 0
  1208. };
  1209. DSATTRIBUTETABLEENTRY mobileUserEntry =
  1210. {
  1211. L"mobile",
  1212. eUserMobile,
  1213. DS_ATTRIBUTE_ONCREATE,
  1214. &mobile,
  1215. FillAttrInfoFromObjectEntry,
  1216. NULL
  1217. };
  1218. DSATTRIBUTETABLEENTRY mobileContactEntry =
  1219. {
  1220. L"mobile",
  1221. eContactMobile,
  1222. DS_ATTRIBUTE_ONCREATE,
  1223. &mobile,
  1224. FillAttrInfoFromObjectEntry,
  1225. NULL
  1226. };
  1227. //
  1228. // Fax
  1229. //
  1230. DSATTRIBUTEDESCRIPTION fax =
  1231. {
  1232. {
  1233. L"facsimileTelephoneNumber",
  1234. ADS_ATTR_UPDATE,
  1235. ADSTYPE_CASE_IGNORE_STRING,
  1236. NULL,
  1237. 0
  1238. },
  1239. 0
  1240. };
  1241. DSATTRIBUTETABLEENTRY faxUserEntry =
  1242. {
  1243. L"facsimileTelephoneNumber",
  1244. eUserFax,
  1245. DS_ATTRIBUTE_ONCREATE,
  1246. &fax,
  1247. FillAttrInfoFromObjectEntry,
  1248. NULL
  1249. };
  1250. DSATTRIBUTETABLEENTRY faxContactEntry =
  1251. {
  1252. L"facsimileTelephoneNumber",
  1253. eContactFax,
  1254. DS_ATTRIBUTE_ONCREATE,
  1255. &fax,
  1256. FillAttrInfoFromObjectEntry,
  1257. NULL
  1258. };
  1259. //
  1260. // Title
  1261. //
  1262. DSATTRIBUTEDESCRIPTION title =
  1263. {
  1264. {
  1265. L"title",
  1266. ADS_ATTR_UPDATE,
  1267. ADSTYPE_CASE_IGNORE_STRING,
  1268. NULL,
  1269. 0
  1270. },
  1271. 0
  1272. };
  1273. DSATTRIBUTETABLEENTRY titleUserEntry =
  1274. {
  1275. L"title",
  1276. eUserTitle,
  1277. DS_ATTRIBUTE_ONCREATE,
  1278. &title,
  1279. FillAttrInfoFromObjectEntry,
  1280. NULL
  1281. };
  1282. DSATTRIBUTETABLEENTRY titleContactEntry =
  1283. {
  1284. L"title",
  1285. eContactTitle,
  1286. DS_ATTRIBUTE_ONCREATE,
  1287. &title,
  1288. FillAttrInfoFromObjectEntry,
  1289. NULL
  1290. };
  1291. //
  1292. // Department
  1293. //
  1294. DSATTRIBUTEDESCRIPTION department =
  1295. {
  1296. {
  1297. L"department",
  1298. ADS_ATTR_UPDATE,
  1299. ADSTYPE_CASE_IGNORE_STRING,
  1300. NULL,
  1301. 0
  1302. },
  1303. 0
  1304. };
  1305. DSATTRIBUTETABLEENTRY departmentUserEntry =
  1306. {
  1307. L"department",
  1308. eUserDept,
  1309. DS_ATTRIBUTE_ONCREATE,
  1310. &department,
  1311. FillAttrInfoFromObjectEntry,
  1312. NULL
  1313. };
  1314. DSATTRIBUTETABLEENTRY departmentContactEntry =
  1315. {
  1316. L"department",
  1317. eContactDept,
  1318. DS_ATTRIBUTE_ONCREATE,
  1319. &department,
  1320. FillAttrInfoFromObjectEntry,
  1321. NULL
  1322. };
  1323. //
  1324. // Company
  1325. //
  1326. DSATTRIBUTEDESCRIPTION company =
  1327. {
  1328. {
  1329. L"company",
  1330. ADS_ATTR_UPDATE,
  1331. ADSTYPE_CASE_IGNORE_STRING,
  1332. NULL,
  1333. 0
  1334. },
  1335. 0
  1336. };
  1337. DSATTRIBUTETABLEENTRY companyUserEntry =
  1338. {
  1339. L"company",
  1340. eUserCompany,
  1341. DS_ATTRIBUTE_ONCREATE,
  1342. &company,
  1343. FillAttrInfoFromObjectEntry,
  1344. NULL
  1345. };
  1346. DSATTRIBUTETABLEENTRY companyContactEntry =
  1347. {
  1348. L"company",
  1349. eContactCompany,
  1350. DS_ATTRIBUTE_ONCREATE,
  1351. &company,
  1352. FillAttrInfoFromObjectEntry,
  1353. NULL
  1354. };
  1355. //
  1356. // Web Page
  1357. //
  1358. DSATTRIBUTEDESCRIPTION webPage =
  1359. {
  1360. {
  1361. L"wwwHomePage",
  1362. ADS_ATTR_UPDATE,
  1363. ADSTYPE_CASE_IGNORE_STRING,
  1364. NULL,
  1365. 0
  1366. },
  1367. 0
  1368. };
  1369. DSATTRIBUTETABLEENTRY webPageUserEntry =
  1370. {
  1371. L"wwwHomePage",
  1372. eUserWebPage,
  1373. DS_ATTRIBUTE_ONCREATE,
  1374. &webPage,
  1375. FillAttrInfoFromObjectEntry,
  1376. NULL
  1377. };
  1378. //
  1379. // IP Phone
  1380. //
  1381. DSATTRIBUTEDESCRIPTION ipPhone =
  1382. {
  1383. {
  1384. L"ipPhone",
  1385. ADS_ATTR_UPDATE,
  1386. ADSTYPE_CASE_IGNORE_STRING,
  1387. NULL,
  1388. 0
  1389. },
  1390. 0
  1391. };
  1392. DSATTRIBUTETABLEENTRY ipPhoneUserEntry =
  1393. {
  1394. L"ipPhone",
  1395. eUserIPPhone,
  1396. DS_ATTRIBUTE_ONCREATE,
  1397. &ipPhone,
  1398. FillAttrInfoFromObjectEntry,
  1399. NULL
  1400. };
  1401. //
  1402. // Script Path
  1403. //
  1404. DSATTRIBUTEDESCRIPTION scriptPath =
  1405. {
  1406. {
  1407. L"scriptPath",
  1408. ADS_ATTR_UPDATE,
  1409. ADSTYPE_CASE_IGNORE_STRING,
  1410. NULL,
  1411. 0
  1412. },
  1413. 0
  1414. };
  1415. DSATTRIBUTETABLEENTRY scriptPathUserEntry =
  1416. {
  1417. L"scriptPath",
  1418. eUserScriptPath,
  1419. DS_ATTRIBUTE_ONCREATE,
  1420. &scriptPath,
  1421. FillAttrInfoFromObjectEntry,
  1422. NULL
  1423. };
  1424. //
  1425. // Home Directory
  1426. //
  1427. DSATTRIBUTEDESCRIPTION homeDirectory =
  1428. {
  1429. {
  1430. L"homeDirectory",
  1431. ADS_ATTR_UPDATE,
  1432. ADSTYPE_CASE_IGNORE_STRING,
  1433. NULL,
  1434. 0
  1435. },
  1436. 0
  1437. };
  1438. DSATTRIBUTETABLEENTRY homeDirectoryUserEntry =
  1439. {
  1440. L"homeDirectory",
  1441. eUserHomeDir,
  1442. DS_ATTRIBUTE_ONCREATE,
  1443. &homeDirectory,
  1444. FillAttrInfoFromObjectEntry,
  1445. NULL
  1446. };
  1447. //
  1448. // Home Drive
  1449. //
  1450. DSATTRIBUTEDESCRIPTION homeDrive =
  1451. {
  1452. {
  1453. L"homeDrive",
  1454. ADS_ATTR_UPDATE,
  1455. ADSTYPE_CASE_IGNORE_STRING,
  1456. NULL,
  1457. 0
  1458. },
  1459. 0
  1460. };
  1461. DSATTRIBUTETABLEENTRY homeDriveUserEntry =
  1462. {
  1463. L"homeDrive",
  1464. eUserHomeDrive,
  1465. DS_ATTRIBUTE_ONCREATE,
  1466. &homeDrive,
  1467. FillAttrInfoFromObjectEntry,
  1468. NULL
  1469. };
  1470. //
  1471. // Profile Path
  1472. //
  1473. DSATTRIBUTEDESCRIPTION profilePath =
  1474. {
  1475. {
  1476. L"profilePath",
  1477. ADS_ATTR_UPDATE,
  1478. ADSTYPE_CASE_IGNORE_STRING,
  1479. NULL,
  1480. 0
  1481. },
  1482. 0
  1483. };
  1484. DSATTRIBUTETABLEENTRY profilePathUserEntry =
  1485. {
  1486. L"profilePath",
  1487. eUserProfilePath,
  1488. DS_ATTRIBUTE_ONCREATE,
  1489. &profilePath,
  1490. FillAttrInfoFromObjectEntry,
  1491. NULL
  1492. };
  1493. //
  1494. // pwdLastSet
  1495. //
  1496. DSATTRIBUTEDESCRIPTION pwdLastSet =
  1497. {
  1498. {
  1499. L"pwdLastSet",
  1500. ADS_ATTR_UPDATE,
  1501. ADSTYPE_LARGE_INTEGER,
  1502. NULL,
  1503. 0
  1504. },
  1505. 0
  1506. };
  1507. DSATTRIBUTETABLEENTRY mustChangePwdUserEntry =
  1508. {
  1509. L"pwdLastSet",
  1510. eUserMustchpwd,
  1511. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1512. &pwdLastSet,
  1513. SetMustChangePwd,
  1514. NULL
  1515. };
  1516. //
  1517. // accountExpires
  1518. //
  1519. DSATTRIBUTEDESCRIPTION accountExpires =
  1520. {
  1521. {
  1522. L"accountExpires",
  1523. ADS_ATTR_UPDATE,
  1524. ADSTYPE_LARGE_INTEGER,
  1525. NULL,
  1526. 0
  1527. },
  1528. 0
  1529. };
  1530. DSATTRIBUTETABLEENTRY accountExpiresUserEntry =
  1531. {
  1532. L"accountExpires",
  1533. eUserAcctexpires,
  1534. DS_ATTRIBUTE_ONCREATE,
  1535. &accountExpires,
  1536. AccountExpires,
  1537. NULL
  1538. };
  1539. //
  1540. // user account control
  1541. //
  1542. DSATTRIBUTEDESCRIPTION userAccountControl =
  1543. {
  1544. {
  1545. L"userAccountControl",
  1546. ADS_ATTR_UPDATE,
  1547. ADSTYPE_INTEGER,
  1548. NULL,
  1549. 0
  1550. },
  1551. 0
  1552. };
  1553. DSATTRIBUTETABLEENTRY disableUserEntry =
  1554. {
  1555. L"userAccountControl",
  1556. eUserDisabled,
  1557. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE | DS_ATTRIBUTE_REQUIRED,
  1558. &userAccountControl,
  1559. DisableAccount,
  1560. NULL
  1561. };
  1562. DSATTRIBUTETABLEENTRY pwdNeverExpiresUserEntry =
  1563. {
  1564. L"userAccountControl",
  1565. eUserPwdneverexpires,
  1566. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1567. &userAccountControl,
  1568. PwdNeverExpires,
  1569. NULL
  1570. };
  1571. DSATTRIBUTETABLEENTRY reverisblePwdUserEntry =
  1572. {
  1573. L"userAccountControl",
  1574. eUserReversiblePwd,
  1575. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1576. &userAccountControl,
  1577. ReversiblePwd,
  1578. NULL
  1579. };
  1580. DSATTRIBUTETABLEENTRY accountTypeComputerEntry =
  1581. {
  1582. L"userAccountControl",
  1583. 0,
  1584. DS_ATTRIBUTE_ONCREATE | DS_ATTRIBUTE_REQUIRED,
  1585. &userAccountControl,
  1586. SetComputerAccountType,
  1587. 0
  1588. };
  1589. DSATTRIBUTETABLEENTRY disableComputerEntry =
  1590. {
  1591. L"userAccountControl",
  1592. NULL, // does not have a cooresponding command line switch
  1593. DS_ATTRIBUTE_ONCREATE | DS_ATTRIBUTE_NOT_REUSABLE | DS_ATTRIBUTE_REQUIRED,
  1594. &userAccountControl,
  1595. DisableAccount,
  1596. NULL
  1597. };
  1598. //
  1599. // SAM Account Name
  1600. //
  1601. DSATTRIBUTEDESCRIPTION samAccountName =
  1602. {
  1603. {
  1604. L"sAMAccountName",
  1605. ADS_ATTR_UPDATE,
  1606. ADSTYPE_CASE_IGNORE_STRING,
  1607. NULL,
  1608. 0
  1609. },
  1610. 0
  1611. };
  1612. DSATTRIBUTETABLEENTRY samNameGroupEntry =
  1613. {
  1614. L"sAMAccountName",
  1615. eGroupSamname,
  1616. DS_ATTRIBUTE_ONCREATE | DS_ATTRIBUTE_NOT_REUSABLE | DS_ATTRIBUTE_REQUIRED,
  1617. &samAccountName,
  1618. BuildGroupSAMName,
  1619. NULL
  1620. };
  1621. DSATTRIBUTETABLEENTRY samNameUserEntry =
  1622. {
  1623. L"sAMAccountName",
  1624. eUserSam,
  1625. DS_ATTRIBUTE_ONCREATE | DS_ATTRIBUTE_NOT_REUSABLE | DS_ATTRIBUTE_REQUIRED,
  1626. &samAccountName,
  1627. FillAttrInfoFromObjectEntry,
  1628. NULL
  1629. };
  1630. DSATTRIBUTETABLEENTRY samNameComputerEntry =
  1631. {
  1632. L"sAMAccountName",
  1633. eComputerSamname,
  1634. DS_ATTRIBUTE_ONCREATE | DS_ATTRIBUTE_NOT_REUSABLE | DS_ATTRIBUTE_REQUIRED,
  1635. &samAccountName,
  1636. BuildComputerSAMName,
  1637. NULL
  1638. };
  1639. //
  1640. // Manager
  1641. //
  1642. DSATTRIBUTEDESCRIPTION manager =
  1643. {
  1644. {
  1645. L"manager",
  1646. ADS_ATTR_UPDATE,
  1647. ADSTYPE_CASE_IGNORE_STRING,
  1648. NULL,
  1649. 0
  1650. },
  1651. 0
  1652. };
  1653. DSATTRIBUTETABLEENTRY managerUserEntry =
  1654. {
  1655. L"manager",
  1656. eUserManager,
  1657. DS_ATTRIBUTE_ONCREATE,
  1658. &manager,
  1659. FillAttrInfoFromObjectEntry,
  1660. NULL
  1661. };
  1662. //
  1663. // Group Type
  1664. //
  1665. DSATTRIBUTEDESCRIPTION groupType =
  1666. {
  1667. {
  1668. L"groupType",
  1669. ADS_ATTR_UPDATE,
  1670. ADSTYPE_INTEGER,
  1671. NULL,
  1672. 0
  1673. },
  1674. 0
  1675. };
  1676. DSATTRIBUTETABLEENTRY groupScopeTypeEntry =
  1677. {
  1678. L"groupType",
  1679. eGroupScope,
  1680. DS_ATTRIBUTE_ONCREATE,
  1681. &groupType,
  1682. SetGroupScope,
  1683. NULL
  1684. };
  1685. DSATTRIBUTETABLEENTRY groupSecurityTypeEntry =
  1686. {
  1687. L"groupType",
  1688. eGroupSecgrp,
  1689. DS_ATTRIBUTE_ONCREATE,
  1690. &groupType,
  1691. SetGroupSecurity,
  1692. NULL
  1693. };
  1694. //
  1695. // Add Group Members
  1696. //
  1697. DSATTRIBUTEDESCRIPTION groupMembers =
  1698. {
  1699. {
  1700. L"member",
  1701. ADS_ATTR_UPDATE,
  1702. ADSTYPE_DN_STRING,
  1703. NULL,
  1704. 0
  1705. },
  1706. 0
  1707. };
  1708. DSATTRIBUTETABLEENTRY membersGroupEntry =
  1709. {
  1710. L"member",
  1711. eGroupMembers,
  1712. DS_ATTRIBUTE_POSTCREATE,
  1713. &groupMembers,
  1714. ModifyGroupMembers,
  1715. NULL
  1716. };
  1717. //
  1718. // Add object to another group
  1719. //
  1720. DSATTRIBUTETABLEENTRY memberOfUserEntry =
  1721. {
  1722. L"member",
  1723. eUserMemberOf,
  1724. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1725. &groupMembers,
  1726. MakeMemberOf,
  1727. NULL
  1728. };
  1729. DSATTRIBUTETABLEENTRY memberOfComputerEntry =
  1730. {
  1731. L"member",
  1732. eComputerMemberOf,
  1733. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1734. &groupMembers,
  1735. MakeMemberOf,
  1736. NULL
  1737. };
  1738. DSATTRIBUTETABLEENTRY memberOfGroupEntry =
  1739. {
  1740. L"member",
  1741. eGroupMemberOf,
  1742. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1743. &groupMembers,
  1744. MakeMemberOf,
  1745. NULL
  1746. };
  1747. //
  1748. // User Can Change Password
  1749. //
  1750. DSATTRIBUTETABLEENTRY canChangePwdUserEntry =
  1751. {
  1752. NULL,
  1753. eUserCanchpwd,
  1754. DS_ATTRIBUTE_POSTCREATE | DS_ATTRIBUTE_NOT_REUSABLE,
  1755. NULL,
  1756. SetCanChangePassword,
  1757. NULL
  1758. };
  1759. //
  1760. // Location
  1761. //
  1762. DSATTRIBUTEDESCRIPTION location =
  1763. {
  1764. {
  1765. L"location",
  1766. ADS_ATTR_UPDATE,
  1767. ADSTYPE_CASE_IGNORE_STRING,
  1768. NULL,
  1769. 0
  1770. },
  1771. 0
  1772. };
  1773. DSATTRIBUTETABLEENTRY locationComputerEntry =
  1774. {
  1775. L"location",
  1776. eComputerLocation,
  1777. DS_ATTRIBUTE_ONCREATE,
  1778. &location,
  1779. FillAttrInfoFromObjectEntry,
  1780. NULL
  1781. };
  1782. //+-------------------------------------------------------------------------
  1783. // Objects
  1784. //--------------------------------------------------------------------------
  1785. //
  1786. // Organizational Unit
  1787. //
  1788. PDSATTRIBUTETABLEENTRY OUAttributeTable[] =
  1789. {
  1790. &descriptionEntry
  1791. };
  1792. DSOBJECTTABLEENTRY g_OUObjectEntry =
  1793. {
  1794. L"organizationalUnit",
  1795. g_pszOU,
  1796. NULL, // Uses just the common switches
  1797. USAGE_DSADD_OU,
  1798. sizeof(OUAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1799. OUAttributeTable
  1800. };
  1801. //
  1802. // User
  1803. //
  1804. PDSATTRIBUTETABLEENTRY UserAttributeTable[] =
  1805. {
  1806. &descriptionEntry,
  1807. &samNameUserEntry,
  1808. &upnUserEntry,
  1809. &firstNameUserEntry,
  1810. &middleInitialUserEntry,
  1811. &lastNameUserEntry,
  1812. &displayNameUserEntry,
  1813. &employeeIDUserEntry,
  1814. &passwordUserEntry,
  1815. &memberOfUserEntry,
  1816. &officeUserEntry,
  1817. &telephoneUserEntry,
  1818. &emailUserEntry,
  1819. &homeTelephoneUserEntry,
  1820. &pagerUserEntry,
  1821. &mobileUserEntry,
  1822. &faxUserEntry,
  1823. &ipPhoneUserEntry,
  1824. &webPageUserEntry,
  1825. &titleUserEntry,
  1826. &departmentUserEntry,
  1827. &companyUserEntry,
  1828. &managerUserEntry,
  1829. &homeDirectoryUserEntry,
  1830. &homeDriveUserEntry,
  1831. &profilePathUserEntry,
  1832. &scriptPathUserEntry,
  1833. &canChangePwdUserEntry,
  1834. &mustChangePwdUserEntry,
  1835. &reverisblePwdUserEntry,
  1836. &pwdNeverExpiresUserEntry,
  1837. &accountExpiresUserEntry,
  1838. &disableUserEntry,
  1839. };
  1840. DSOBJECTTABLEENTRY g_UserObjectEntry =
  1841. {
  1842. L"user",
  1843. g_pszUser,
  1844. DSADD_USER_COMMANDS,
  1845. USAGE_DSADD_USER,
  1846. sizeof(UserAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1847. UserAttributeTable
  1848. };
  1849. //
  1850. // Contact
  1851. //
  1852. PDSATTRIBUTETABLEENTRY ContactAttributeTable[] =
  1853. {
  1854. &descriptionEntry,
  1855. &firstNameContactEntry,
  1856. &middleInitialContactEntry,
  1857. &lastNameContactEntry,
  1858. &displayNameContactEntry,
  1859. &officeContactEntry,
  1860. &telephoneContactEntry,
  1861. &emailContactEntry,
  1862. &homeTelephoneContactEntry,
  1863. &pagerContactEntry,
  1864. &mobileContactEntry,
  1865. &faxContactEntry,
  1866. &titleContactEntry,
  1867. &departmentContactEntry,
  1868. &companyContactEntry
  1869. };
  1870. DSOBJECTTABLEENTRY g_ContactObjectEntry =
  1871. {
  1872. L"contact",
  1873. g_pszContact,
  1874. DSADD_CONTACT_COMMANDS,
  1875. USAGE_DSADD_CONTACT,
  1876. sizeof(ContactAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1877. ContactAttributeTable
  1878. };
  1879. //
  1880. // Computer
  1881. //
  1882. PDSATTRIBUTETABLEENTRY ComputerAttributeTable[] =
  1883. {
  1884. &descriptionEntry,
  1885. &samNameComputerEntry,
  1886. &locationComputerEntry,
  1887. &memberOfComputerEntry,
  1888. &accountTypeComputerEntry,
  1889. &disableComputerEntry
  1890. };
  1891. DSOBJECTTABLEENTRY g_ComputerObjectEntry =
  1892. {
  1893. L"computer",
  1894. g_pszComputer,
  1895. DSADD_COMPUTER_COMMANDS,
  1896. USAGE_DSADD_COMPUTER,
  1897. sizeof(ComputerAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1898. ComputerAttributeTable
  1899. };
  1900. //
  1901. // Group
  1902. //
  1903. PDSATTRIBUTETABLEENTRY GroupAttributeTable[] =
  1904. {
  1905. &descriptionEntry,
  1906. &samNameGroupEntry,
  1907. &groupScopeTypeEntry,
  1908. &groupSecurityTypeEntry,
  1909. &memberOfGroupEntry,
  1910. &membersGroupEntry,
  1911. };
  1912. DSOBJECTTABLEENTRY g_GroupObjectEntry =
  1913. {
  1914. L"group",
  1915. g_pszGroup,
  1916. DSADD_GROUP_COMMANDS,
  1917. USAGE_DSADD_GROUP,
  1918. sizeof(GroupAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1919. GroupAttributeTable
  1920. };
  1921. //+-------------------------------------------------------------------------
  1922. // Object Table
  1923. //--------------------------------------------------------------------------
  1924. PDSOBJECTTABLEENTRY g_DSObjectTable[] =
  1925. {
  1926. &g_OUObjectEntry,
  1927. &g_UserObjectEntry,
  1928. &g_ContactObjectEntry,
  1929. &g_ComputerObjectEntry,
  1930. &g_GroupObjectEntry,
  1931. NULL
  1932. };