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.

2145 lines
35 KiB

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