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.

2247 lines
40 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000
  5. //
  6. // File: gettable.cpp
  7. //
  8. // Contents: Defines Table DSGet
  9. //
  10. // History: 13-Oct-2000 JeffJon Created
  11. //
  12. //
  13. //--------------------------------------------------------------------------
  14. #include "pch.h"
  15. #include "cstrings.h"
  16. #include "gettable.h"
  17. #include "display.h"
  18. #include "usage.h"
  19. //+--------------------------------------------------------------------------
  20. //
  21. // Member: CDSGetDisplayInfo::AddValue
  22. //
  23. // Synopsis: Adds a value to the value array and allocates more space
  24. // if necessary.
  25. //
  26. // Arguments: [pszValue IN] : new value to be added
  27. //
  28. // Returns: HRESULT : E_OUTOFMEMORY if we failed to allocate space
  29. // S_OK if we succeeded in setting the password
  30. //
  31. // History: 23-Oct-2000 JeffJon Created
  32. //
  33. //---------------------------------------------------------------------------
  34. HRESULT CDSGetDisplayInfo::AddValue(PCWSTR pszValue)
  35. {
  36. ENTER_FUNCTION_HR(LEVEL8_LOGGING, CDSGetDisplayInfo::AddValue, hr);
  37. do // false loop
  38. {
  39. //
  40. // Verify parameters
  41. //
  42. if (!pszValue)
  43. {
  44. ASSERT(pszValue);
  45. hr = E_INVALIDARG;
  46. break;
  47. }
  48. if (m_dwAttributeValueCount == m_dwAttributeValueSize)
  49. {
  50. DWORD dwNewSize = m_dwAttributeValueSize + 5;
  51. //
  52. // Allocate a new array with more space
  53. //
  54. PWSTR* ppszNewArray = new PWSTR[dwNewSize];
  55. if (!ppszNewArray)
  56. {
  57. hr = E_OUTOFMEMORY;
  58. break;
  59. }
  60. m_dwAttributeValueSize = dwNewSize;
  61. //
  62. // Copy the old values
  63. //
  64. //Security Review:This is fine.
  65. memcpy(ppszNewArray, m_ppszAttributeStringValue, m_dwAttributeValueCount * sizeof(PWSTR));
  66. //
  67. // Delete the old array
  68. //
  69. if (m_ppszAttributeStringValue)
  70. {
  71. delete[] m_ppszAttributeStringValue;
  72. }
  73. m_ppszAttributeStringValue = ppszNewArray;
  74. }
  75. //
  76. // Add the new value to the end of the array
  77. //
  78. m_ppszAttributeStringValue[m_dwAttributeValueCount] = new WCHAR[wcslen(pszValue) + 1];
  79. if (!m_ppszAttributeStringValue[m_dwAttributeValueCount])
  80. {
  81. hr = E_OUTOFMEMORY;
  82. break;
  83. }
  84. //Buffer is allocated correctly.
  85. wcscpy(m_ppszAttributeStringValue[m_dwAttributeValueCount], pszValue);
  86. m_dwAttributeValueCount++;
  87. } while (false);
  88. return hr;
  89. }
  90. //+-------------------------------------------------------------------------
  91. // Parser table
  92. //--------------------------------------------------------------------------
  93. ARG_RECORD DSGET_COMMON_COMMANDS[] =
  94. {
  95. COMMON_COMMANDS
  96. //
  97. // objecttype
  98. //
  99. 0,(LPWSTR)c_sz_arg1_com_objecttype,
  100. 0,NULL,
  101. ARG_TYPE_STR, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG,
  102. 0,
  103. 0, NULL,
  104. //
  105. // c Continue
  106. //
  107. 0,(PWSTR)c_sz_arg1_com_continue,
  108. ID_ARG2_NULL, NULL,
  109. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  110. (CMD_TYPE)_T(""),
  111. 0, NULL,
  112. //
  113. // l List
  114. //
  115. 0,(LPWSTR)c_sz_arg1_com_listformat,
  116. 0,NULL,
  117. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  118. 0,
  119. 0, NULL,
  120. //
  121. // objectDN
  122. //
  123. 0,(LPWSTR)c_sz_arg1_com_objectDN,
  124. ID_ARG2_NULL,NULL,
  125. ARG_TYPE_MSZ, ARG_FLAG_REQUIRED|ARG_FLAG_NOFLAG|ARG_FLAG_STDIN|ARG_FLAG_DN,
  126. 0,
  127. 0, NULL,
  128. //
  129. // dn
  130. //
  131. 0, (PWSTR)g_pszArg1UserDN,
  132. ID_ARG2_NULL, NULL,
  133. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  134. 0,
  135. 0, NULL,
  136. //
  137. // description
  138. //
  139. 0, (PWSTR)c_sz_arg1_com_description,
  140. ID_ARG2_NULL, NULL,
  141. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  142. 0,
  143. 0, NULL,
  144. ARG_TERMINATOR
  145. };
  146. ARG_RECORD DSGET_USER_COMMANDS[]=
  147. {
  148. //
  149. // SamID
  150. //
  151. 0, (PWSTR)g_pszArg1UserSAMID,
  152. ID_ARG2_NULL, NULL,
  153. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  154. 0,
  155. 0, NULL,
  156. //
  157. // sid
  158. //
  159. 0, (PWSTR)g_pszArg1UserSID,
  160. ID_ARG2_NULL, NULL,
  161. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  162. 0,
  163. 0, NULL,
  164. //
  165. // upn
  166. //
  167. 0, (PWSTR)g_pszArg1UserUPN,
  168. ID_ARG2_NULL, NULL,
  169. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  170. 0,
  171. 0, NULL,
  172. //
  173. // fn. FirstName
  174. //
  175. 0, (PWSTR)g_pszArg1UserFirstName,
  176. ID_ARG2_NULL, NULL,
  177. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  178. 0,
  179. 0, NULL,
  180. //
  181. // mi Middle Initial
  182. //
  183. 0, (PWSTR)g_pszArg1UserMiddleInitial,
  184. ID_ARG2_NULL, NULL,
  185. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  186. 0,
  187. 0, NULL,
  188. //
  189. // ln LastName
  190. //
  191. 0, (PWSTR)g_pszArg1UserLastName,
  192. ID_ARG2_NULL, NULL,
  193. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  194. 0,
  195. 0, NULL,
  196. //
  197. // display DisplayName
  198. //
  199. 0, (PWSTR)g_pszArg1UserDisplayName,
  200. ID_ARG2_NULL, NULL,
  201. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  202. 0,
  203. 0, NULL,
  204. //
  205. // empid Employee ID
  206. //
  207. 0, (PWSTR)g_pszArg1UserEmployeeID,
  208. ID_ARG2_NULL, NULL,
  209. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  210. 0,
  211. 0, NULL,
  212. //
  213. // office Office Location
  214. //
  215. 0, (PWSTR)g_pszArg1UserOffice,
  216. ID_ARG2_NULL, NULL,
  217. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  218. 0,
  219. 0, NULL,
  220. //
  221. // tel Telephone
  222. //
  223. 0, (PWSTR)g_pszArg1UserTelephone,
  224. ID_ARG2_NULL, NULL,
  225. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  226. 0,
  227. 0, NULL,
  228. //
  229. // email E-mail
  230. //
  231. 0, (PWSTR)g_pszArg1UserEmail,
  232. ID_ARG2_NULL, NULL,
  233. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  234. 0,
  235. 0, NULL,
  236. //
  237. // hometel Home Telephone
  238. //
  239. 0, (PWSTR)g_pszArg1UserHomeTelephone,
  240. ID_ARG2_NULL, NULL,
  241. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  242. 0,
  243. 0, NULL,
  244. //
  245. // pager Pager number
  246. //
  247. 0, (PWSTR)g_pszArg1UserPagerNumber,
  248. ID_ARG2_NULL, NULL,
  249. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  250. 0,
  251. 0, NULL,
  252. //
  253. // mobile Mobile Telephone Number
  254. //
  255. 0, (PWSTR)g_pszArg1UserMobileNumber,
  256. ID_ARG2_NULL, NULL,
  257. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  258. 0,
  259. 0, NULL,
  260. //
  261. // fax Fax Number
  262. //
  263. 0, (PWSTR)g_pszArg1UserFaxNumber,
  264. ID_ARG2_NULL, NULL,
  265. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  266. 0,
  267. 0, NULL,
  268. //
  269. // iptel IP phone#
  270. //
  271. 0, (PWSTR)g_pszArg1UserIPTel,
  272. ID_ARG2_NULL, NULL,
  273. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  274. 0,
  275. 0, NULL,
  276. //
  277. // webpg Web Page
  278. //
  279. 0, (PWSTR)g_pszArg1UserWebPage,
  280. ID_ARG2_NULL, NULL,
  281. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  282. 0,
  283. 0, NULL,
  284. //
  285. // title Title
  286. //
  287. 0, (PWSTR)g_pszArg1UserTitle,
  288. ID_ARG2_NULL, NULL,
  289. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  290. 0,
  291. 0, NULL,
  292. //
  293. // dept Department
  294. //
  295. 0, (PWSTR)g_pszArg1UserDepartment,
  296. ID_ARG2_NULL, NULL,
  297. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  298. 0,
  299. 0, NULL,
  300. //
  301. // company Company
  302. //
  303. 0, (PWSTR)g_pszArg1UserCompany,
  304. ID_ARG2_NULL, NULL,
  305. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  306. 0,
  307. 0, NULL,
  308. //
  309. // mgr Manager
  310. //
  311. 0, (PWSTR)g_pszArg1UserManager,
  312. ID_ARG2_NULL, NULL,
  313. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  314. 0,
  315. 0, NULL,
  316. //
  317. // hmdir Home Directory
  318. //
  319. 0, (PWSTR)g_pszArg1UserHomeDirectory,
  320. ID_ARG2_NULL, NULL,
  321. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  322. 0,
  323. 0, NULL,
  324. //
  325. // hmdrv Home Drive
  326. //
  327. 0, (PWSTR)g_pszArg1UserHomeDrive,
  328. ID_ARG2_NULL, NULL,
  329. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  330. 0,
  331. 0, NULL,
  332. //
  333. // profile Profile
  334. //
  335. 0, (PWSTR)g_pszArg1UserProfile,
  336. ID_ARG2_NULL, NULL,
  337. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  338. 0,
  339. 0, NULL,
  340. //
  341. // loscr Logon Script
  342. //
  343. 0, (PWSTR)g_pszArg1UserLogonScript,
  344. ID_ARG2_NULL, NULL,
  345. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  346. 0,
  347. 0, NULL,
  348. //
  349. // mustchpwd Must Change Password at next logon
  350. //
  351. 0, (PWSTR)g_pszArg1UserMustChangePwd,
  352. ID_ARG2_NULL, NULL,
  353. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  354. 0,
  355. 0, NULL,
  356. //
  357. // canchpwd Can Change Password
  358. //
  359. 0, (PWSTR)g_pszArg1UserCanChangePwd,
  360. ID_ARG2_NULL, NULL,
  361. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  362. 0,
  363. 0, NULL,
  364. //
  365. // pwdneverexpires Password never expires
  366. //
  367. 0, (PWSTR)g_pszArg1UserPwdNeverExpires,
  368. ID_ARG2_NULL, NULL,
  369. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  370. 0,
  371. 0, NULL,
  372. //
  373. // disabled Disable Account
  374. //
  375. 0, (PWSTR)g_pszArg1UserDisableAccount,
  376. ID_ARG2_NULL, NULL,
  377. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  378. 0,
  379. 0, NULL,
  380. //
  381. // acctexpires Account Expires
  382. //
  383. 0, (PWSTR)g_pszArg1UserAcctExpires,
  384. ID_ARG2_NULL, NULL,
  385. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  386. 0,
  387. 0, NULL,
  388. //
  389. // reversiblepwd Password stored with reversible encryption
  390. //
  391. 0, (PWSTR)g_pszArg1UserReversiblePwd,
  392. ID_ARG2_NULL, NULL,
  393. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  394. 0,
  395. 0, NULL,
  396. //
  397. // memberof Member of group
  398. //
  399. 0, (PWSTR)g_pszArg1UserMemberOf,
  400. ID_ARG2_NULL, NULL,
  401. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  402. 0,
  403. 0, NULL,
  404. //
  405. // expand Recursively expand group membership
  406. //
  407. 0, (PWSTR)g_pszArg1UserExpand,
  408. ID_ARG2_NULL, NULL,
  409. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  410. 0,
  411. 0, NULL,
  412. //
  413. // part
  414. //
  415. 0, (PWSTR)g_pszArg1UserPart,
  416. ID_ARG2_NULL, NULL,
  417. ARG_TYPE_STR, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  418. 0,
  419. 0, NULL,
  420. //
  421. // qlimit
  422. //
  423. 0, (PWSTR)g_pszArg1UserQLimit,
  424. ID_ARG2_NULL, NULL,
  425. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  426. 0,
  427. 0, NULL,
  428. //
  429. // qUsed
  430. //
  431. 0, (PWSTR)g_pszArg1UserQuotaUsed,
  432. ID_ARG2_NULL, NULL,
  433. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  434. 0,
  435. 0, NULL,
  436. ARG_TERMINATOR
  437. };
  438. ARG_RECORD DSGET_COMPUTER_COMMANDS[]=
  439. {
  440. //
  441. // SamID
  442. //
  443. 0, (PWSTR)g_pszArg1ComputerSAMID,
  444. ID_ARG2_NULL, NULL,
  445. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  446. 0,
  447. 0, NULL,
  448. //
  449. // sid
  450. //
  451. 0, (PWSTR)g_pszArg1ComputerSID,
  452. ID_ARG2_NULL, NULL,
  453. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  454. 0,
  455. 0, NULL,
  456. //
  457. // loc
  458. //
  459. 0, (PWSTR)g_pszArg1ComputerLoc,
  460. ID_ARG2_NULL, NULL,
  461. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  462. 0,
  463. 0, NULL,
  464. //
  465. // disabled Disable Account
  466. //
  467. 0, (PWSTR)g_pszArg1ComputerDisableAccount,
  468. ID_ARG2_NULL, NULL,
  469. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  470. 0,
  471. 0, NULL,
  472. //
  473. // memberof Member of group
  474. //
  475. 0, (PWSTR)g_pszArg1ComputerMemberOf,
  476. ID_ARG2_NULL, NULL,
  477. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  478. 0,
  479. 0, NULL,
  480. //
  481. // expand Recursively expand group membership
  482. //
  483. 0, (PWSTR)g_pszArg1ComputerExpand,
  484. ID_ARG2_NULL, NULL,
  485. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  486. (CMD_TYPE)_T(""),
  487. 0, NULL,
  488. //
  489. // part
  490. //
  491. 0, (PWSTR)g_pszArg1ComputerPart,
  492. ID_ARG2_NULL, NULL,
  493. ARG_TYPE_STR, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  494. 0,
  495. 0, NULL,
  496. //
  497. // qlimit
  498. //
  499. 0, (PWSTR)g_pszArg1ComputerQLimit,
  500. ID_ARG2_NULL, NULL,
  501. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  502. 0,
  503. 0, NULL,
  504. //
  505. // qUsed
  506. //
  507. 0, (PWSTR)g_pszArg1ComputerQuotaUsed,
  508. ID_ARG2_NULL, NULL,
  509. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  510. 0,
  511. 0, NULL,
  512. ARG_TERMINATOR,
  513. };
  514. ARG_RECORD DSGET_GROUP_COMMANDS[]=
  515. {
  516. //
  517. // samname
  518. //
  519. 0, (PWSTR)g_pszArg1GroupSamid,
  520. ID_ARG2_NULL, NULL,
  521. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  522. 0,
  523. 0, NULL,
  524. //
  525. // sid
  526. //
  527. 0, (PWSTR)g_pszArg1GroupSID,
  528. ID_ARG2_NULL, NULL,
  529. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  530. 0,
  531. 0, NULL,
  532. //
  533. // secgrp Security enabled
  534. //
  535. 0, (PWSTR)g_pszArg1GroupSecGrp,
  536. ID_ARG2_NULL, NULL,
  537. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  538. 0,
  539. 0, NULL,
  540. //
  541. // scope Group scope (local/global/universal)
  542. //
  543. 0, (PWSTR)g_pszArg1GroupScope,
  544. ID_ARG2_NULL, NULL,
  545. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  546. 0,
  547. 0, NULL,
  548. //
  549. // memberof Member of groups
  550. //
  551. 0, (PWSTR)g_pszArg1GroupMemberOf,
  552. ID_ARG2_NULL, NULL,
  553. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  554. 0,
  555. 0, NULL,
  556. //
  557. // members Contains members
  558. //
  559. 0, (PWSTR)g_pszArg1GroupMembers,
  560. ID_ARG2_NULL, NULL,
  561. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  562. 0,
  563. 0, NULL,
  564. //
  565. // expand Recursively expand group membership
  566. //
  567. 0, (PWSTR)g_pszArg1GroupExpand,
  568. ID_ARG2_NULL, NULL,
  569. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  570. 0,
  571. 0, NULL,
  572. //
  573. // part
  574. //
  575. 0, (PWSTR)g_pszArg1GroupPart,
  576. ID_ARG2_NULL, NULL,
  577. ARG_TYPE_STR, ARG_FLAG_OPTIONAL|ARG_FLAG_DN,
  578. 0,
  579. 0, NULL,
  580. //
  581. // qlimit
  582. //
  583. 0, (PWSTR)g_pszArg1GroupQLimit,
  584. ID_ARG2_NULL, NULL,
  585. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  586. 0,
  587. 0, NULL,
  588. //
  589. // qUsed
  590. //
  591. 0, (PWSTR)g_pszArg1GroupQuotaUsed,
  592. ID_ARG2_NULL, NULL,
  593. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  594. 0,
  595. 0, NULL,
  596. ARG_TERMINATOR,
  597. };
  598. ARG_RECORD DSGET_CONTACT_COMMANDS[]=
  599. {
  600. //
  601. // fn. FirstName
  602. //
  603. 0, (PWSTR)g_pszArg1UserFirstName,
  604. ID_ARG2_NULL, NULL,
  605. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  606. 0,
  607. 0, NULL,
  608. //
  609. // mi Middle Initial
  610. //
  611. 0, (PWSTR)g_pszArg1UserMiddleInitial,
  612. ID_ARG2_NULL, NULL,
  613. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  614. 0,
  615. 0, NULL,
  616. //
  617. // ln LastName
  618. //
  619. 0, (PWSTR)g_pszArg1UserLastName,
  620. ID_ARG2_NULL, NULL,
  621. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  622. 0,
  623. 0, NULL,
  624. //
  625. // display DisplayName
  626. //
  627. 0, (PWSTR)g_pszArg1UserDisplayName,
  628. ID_ARG2_NULL, NULL,
  629. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  630. 0,
  631. 0, NULL,
  632. //
  633. // office Office Location
  634. //
  635. 0, (PWSTR)g_pszArg1UserOffice,
  636. ID_ARG2_NULL, NULL,
  637. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  638. 0,
  639. 0, NULL,
  640. //
  641. // tel Telephone
  642. //
  643. 0, (PWSTR)g_pszArg1UserTelephone,
  644. ID_ARG2_NULL, NULL,
  645. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  646. 0,
  647. 0, NULL,
  648. //
  649. // email E-mail
  650. //
  651. 0, (PWSTR)g_pszArg1UserEmail,
  652. ID_ARG2_NULL, NULL,
  653. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  654. 0,
  655. 0, NULL,
  656. //
  657. // hometel Home Telephone
  658. //
  659. 0, (PWSTR)g_pszArg1UserHomeTelephone,
  660. ID_ARG2_NULL, NULL,
  661. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  662. 0,
  663. 0, NULL,
  664. //
  665. // pager Pager number
  666. //
  667. 0, (PWSTR)g_pszArg1UserPagerNumber,
  668. ID_ARG2_NULL, NULL,
  669. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  670. 0,
  671. 0, NULL,
  672. //
  673. // mobile Mobile Telephone Number
  674. //
  675. 0, (PWSTR)g_pszArg1UserMobileNumber,
  676. ID_ARG2_NULL, NULL,
  677. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  678. 0,
  679. 0, NULL,
  680. //
  681. // fax Fax Number
  682. //
  683. 0, (PWSTR)g_pszArg1UserFaxNumber,
  684. ID_ARG2_NULL, NULL,
  685. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  686. 0,
  687. 0, NULL,
  688. //
  689. // iptel IP phone#
  690. //
  691. 0, (PWSTR)g_pszArg1UserIPTel,
  692. ID_ARG2_NULL, NULL,
  693. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  694. 0,
  695. 0, NULL,
  696. //
  697. // title Title
  698. //
  699. 0, (PWSTR)g_pszArg1UserTitle,
  700. ID_ARG2_NULL, NULL,
  701. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  702. 0,
  703. 0, NULL,
  704. //
  705. // dept Department
  706. //
  707. 0, (PWSTR)g_pszArg1UserDepartment,
  708. ID_ARG2_NULL, NULL,
  709. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  710. 0,
  711. 0, NULL,
  712. //
  713. // company Company
  714. //
  715. 0, (PWSTR)g_pszArg1UserCompany,
  716. ID_ARG2_NULL, NULL,
  717. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  718. 0,
  719. 0, NULL,
  720. ARG_TERMINATOR,
  721. };
  722. ARG_RECORD DSGET_SERVER_COMMANDS[]=
  723. {
  724. //
  725. // dnsname dnsHostName
  726. //
  727. 0, (PWSTR)g_pszArg1ServerDnsName,
  728. ID_ARG2_NULL, NULL,
  729. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  730. 0,
  731. 0, NULL,
  732. //
  733. // site
  734. //
  735. 0, (PWSTR)g_pszArg1ServerSite,
  736. ID_ARG2_NULL, NULL,
  737. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  738. 0,
  739. 0, NULL,
  740. //
  741. // isGC
  742. //
  743. 0, (PWSTR)g_pszArg1ServerIsGC,
  744. ID_ARG2_NULL, NULL,
  745. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  746. 0,
  747. 0, NULL,
  748. //
  749. // part
  750. //
  751. 0, (PWSTR)g_pszArg1ServerPart,
  752. ID_ARG2_NULL, NULL,
  753. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  754. 0,
  755. 0, NULL,
  756. //
  757. // topobjowner
  758. //
  759. 0, (PWSTR)g_pszArg1ServerTopObjOwner,
  760. ID_ARG2_NULL, NULL,
  761. ARG_TYPE_INT, ARG_FLAG_OPTIONAL | ARG_FLAG_DEFAULTABLE,
  762. (void*) 10, // default nValue is 10 if not specified
  763. 0, NULL,
  764. ARG_TERMINATOR,
  765. };
  766. ARG_RECORD DSGET_SITE_COMMANDS[]=
  767. {
  768. //
  769. // dnsname dnsHostName
  770. //
  771. 0, (PWSTR)g_pszArg1SiteAutotopology,
  772. ID_ARG2_NULL, NULL,
  773. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  774. 0,
  775. 0, NULL,
  776. //
  777. // site
  778. //
  779. 0, (PWSTR)g_pszArg1SiteCacheGroups,
  780. ID_ARG2_NULL, NULL,
  781. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  782. 0,
  783. 0, NULL,
  784. //
  785. // isGC
  786. //
  787. 0, (PWSTR)g_pszArg1SitePrefGCSite,
  788. ID_ARG2_NULL, NULL,
  789. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  790. 0,
  791. 0, NULL,
  792. ARG_TERMINATOR,
  793. };
  794. ARG_RECORD DSGET_SUBNET_COMMANDS[]=
  795. {
  796. //
  797. // loc Location
  798. //
  799. 0, (PWSTR)g_pszArg1SubnetLocation,
  800. ID_ARG2_NULL, NULL,
  801. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  802. 0,
  803. 0, NULL,
  804. //
  805. // site
  806. //
  807. 0, (PWSTR)g_pszArg1SubnetSite,
  808. ID_ARG2_NULL, NULL,
  809. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  810. 0,
  811. 0, NULL,
  812. ARG_TERMINATOR,
  813. };
  814. ARG_RECORD DSGET_PARTITION_COMMANDS[]=
  815. {
  816. //
  817. // qdefault
  818. //
  819. 0, (PWSTR)g_pszArg1PartitionQDefault,
  820. ID_ARG2_NULL, NULL,
  821. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  822. 0,
  823. 0, NULL,
  824. //
  825. // qmbstnwt
  826. //
  827. 0, (PWSTR)g_pszArg1PartitionQTombstoneWeight,
  828. ID_ARG2_NULL, NULL,
  829. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  830. 0,
  831. 0, NULL,
  832. //
  833. // topobjowner
  834. //
  835. 0, (PWSTR)g_pszArg1PartitionTopObjOwner,
  836. ID_ARG2_NULL, NULL,
  837. ARG_TYPE_INT, ARG_FLAG_OPTIONAL | ARG_FLAG_DEFAULTABLE,
  838. (void*) 10, // default nValue is 10 if not specified
  839. 0, NULL,
  840. ARG_TERMINATOR,
  841. };
  842. ARG_RECORD DSGET_QUOTA_COMMANDS[]=
  843. {
  844. //
  845. // acct
  846. //
  847. 0, (PWSTR)g_pszArg1QuotaAcct,
  848. ID_ARG2_NULL, NULL,
  849. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  850. 0,
  851. 0, NULL,
  852. //
  853. // qlimit
  854. //
  855. 0, (PWSTR)g_pszArg1QuotaQLimit,
  856. ID_ARG2_NULL, NULL,
  857. ARG_TYPE_BOOL, ARG_FLAG_OPTIONAL,
  858. 0,
  859. 0, NULL,
  860. ARG_TERMINATOR,
  861. };
  862. //+-------------------------------------------------------------------------
  863. // Attributes
  864. //--------------------------------------------------------------------------
  865. //
  866. // User Quota Entries
  867. //
  868. DSGET_ATTR_TABLE_ENTRY qlimitUserEntry =
  869. {
  870. g_pszArg1UserQLimit,
  871. (PWSTR)g_pszAttrmsDSQuotaEffective,
  872. eUserQLimit,
  873. 0,
  874. DisplayQuotaInfoFunc
  875. };
  876. DSGET_ATTR_TABLE_ENTRY quotaUsedUserEntry =
  877. {
  878. g_pszArg1UserQuotaUsed,
  879. (PWSTR)g_pszAttrmsDSQuotaUsed,
  880. eUserQuotaUsed,
  881. 0,
  882. DisplayQuotaInfoFunc
  883. };
  884. //
  885. // Group Quota Entries
  886. //
  887. DSGET_ATTR_TABLE_ENTRY qlimitGroupEntry =
  888. {
  889. g_pszArg1GroupQLimit,
  890. (PWSTR)g_pszAttrmsDSQuotaEffective,
  891. eGroupQLimit,
  892. 0,
  893. DisplayQuotaInfoFunc
  894. };
  895. DSGET_ATTR_TABLE_ENTRY quotaUsedGroupEntry =
  896. {
  897. g_pszArg1GroupQuotaUsed,
  898. (PWSTR)g_pszAttrmsDSQuotaUsed,
  899. eGroupQuotaUsed,
  900. 0,
  901. DisplayQuotaInfoFunc
  902. };
  903. //
  904. // Description
  905. //
  906. DSGET_ATTR_TABLE_ENTRY descriptionEntry =
  907. {
  908. c_sz_arg1_com_description,
  909. L"description",
  910. eCommDescription,
  911. 0,
  912. CommonDisplayStringFunc,
  913. };
  914. //
  915. // SamID
  916. //
  917. DSGET_ATTR_TABLE_ENTRY UserSAMEntry =
  918. {
  919. g_pszArg1UserSAMID,
  920. L"sAMAccountName",
  921. eUserSamID,
  922. 0,
  923. CommonDisplayStringFunc,
  924. };
  925. //
  926. // SamID
  927. //
  928. DSGET_ATTR_TABLE_ENTRY ComputerSAMEntry =
  929. {
  930. g_pszArg1ComputerSAMID,
  931. L"sAMAccountName",
  932. eComputerSamID,
  933. 0,
  934. CommonDisplayStringFunc,
  935. };
  936. //
  937. // SID
  938. //
  939. DSGET_ATTR_TABLE_ENTRY UserSIDEntry =
  940. {
  941. g_pszArg1UserSID,
  942. L"objectSID",
  943. eUserSID,
  944. 0,
  945. CommonDisplayStringFunc,
  946. };
  947. //
  948. // SID
  949. //
  950. DSGET_ATTR_TABLE_ENTRY ComputerSIDEntry =
  951. {
  952. g_pszArg1ComputerSID,
  953. L"objectSID",
  954. eComputerSID,
  955. 0,
  956. CommonDisplayStringFunc,
  957. };
  958. //
  959. // SID
  960. //
  961. DSGET_ATTR_TABLE_ENTRY GroupSIDEntry =
  962. {
  963. g_pszArg1GroupSID,
  964. L"objectSID",
  965. eGroupSID,
  966. 0,
  967. CommonDisplayStringFunc,
  968. };
  969. //
  970. // UPN
  971. //
  972. DSGET_ATTR_TABLE_ENTRY UserUPNEntry =
  973. {
  974. g_pszArg1UserUPN,
  975. L"userPrincipalName",
  976. eUserUpn,
  977. 0,
  978. CommonDisplayStringFunc,
  979. };
  980. //
  981. // First name
  982. //
  983. DSGET_ATTR_TABLE_ENTRY firstNameUserEntry =
  984. {
  985. g_pszArg1UserFirstName,
  986. L"givenName",
  987. eUserFn,
  988. 0,
  989. CommonDisplayStringFunc,
  990. };
  991. DSGET_ATTR_TABLE_ENTRY firstNameContactEntry =
  992. {
  993. g_pszArg1UserFirstName,
  994. L"givenName",
  995. eContactFn,
  996. 0,
  997. CommonDisplayStringFunc,
  998. };
  999. //
  1000. // Middle Initial
  1001. //
  1002. DSGET_ATTR_TABLE_ENTRY middleInitialUserEntry =
  1003. {
  1004. g_pszArg1UserMiddleInitial,
  1005. L"initials",
  1006. eUserMi,
  1007. 0,
  1008. CommonDisplayStringFunc,
  1009. };
  1010. DSGET_ATTR_TABLE_ENTRY middleInitialContactEntry =
  1011. {
  1012. g_pszArg1UserMiddleInitial,
  1013. L"initials",
  1014. eContactMi,
  1015. 0,
  1016. CommonDisplayStringFunc,
  1017. };
  1018. //
  1019. // Last name
  1020. //
  1021. DSGET_ATTR_TABLE_ENTRY lastNameUserEntry =
  1022. {
  1023. g_pszArg1UserLastName,
  1024. L"sn",
  1025. eUserLn,
  1026. 0,
  1027. CommonDisplayStringFunc,
  1028. };
  1029. DSGET_ATTR_TABLE_ENTRY lastNameContactEntry =
  1030. {
  1031. g_pszArg1UserLastName,
  1032. L"sn",
  1033. eContactLn,
  1034. 0,
  1035. CommonDisplayStringFunc,
  1036. };
  1037. //
  1038. // Display name
  1039. //
  1040. DSGET_ATTR_TABLE_ENTRY displayNameUserEntry =
  1041. {
  1042. g_pszArg1UserDisplayName,
  1043. L"displayName",
  1044. eUserDisplay,
  1045. 0,
  1046. CommonDisplayStringFunc,
  1047. };
  1048. //
  1049. // Employee ID
  1050. //
  1051. DSGET_ATTR_TABLE_ENTRY employeeIDUserEntry =
  1052. {
  1053. g_pszArg1UserEmployeeID,
  1054. L"employeeID",
  1055. eUserEmpID,
  1056. 0,
  1057. CommonDisplayStringFunc,
  1058. };
  1059. DSGET_ATTR_TABLE_ENTRY displayNameContactEntry =
  1060. {
  1061. g_pszArg1UserDisplayName,
  1062. L"displayName",
  1063. eContactDisplay,
  1064. 0,
  1065. CommonDisplayStringFunc,
  1066. };
  1067. //
  1068. // Office
  1069. //
  1070. DSGET_ATTR_TABLE_ENTRY officeUserEntry =
  1071. {
  1072. g_pszArg1UserOffice,
  1073. L"physicalDeliveryOfficeName",
  1074. eUserOffice,
  1075. 0,
  1076. CommonDisplayStringFunc,
  1077. };
  1078. DSGET_ATTR_TABLE_ENTRY officeContactEntry =
  1079. {
  1080. g_pszArg1UserOffice,
  1081. L"physicalDeliveryOfficeName",
  1082. eContactOffice,
  1083. 0,
  1084. CommonDisplayStringFunc,
  1085. };
  1086. //
  1087. // Telephone
  1088. //
  1089. DSGET_ATTR_TABLE_ENTRY telephoneUserEntry =
  1090. {
  1091. g_pszArg1UserTelephone,
  1092. L"telephoneNumber",
  1093. eUserTel,
  1094. 0,
  1095. CommonDisplayStringFunc,
  1096. };
  1097. DSGET_ATTR_TABLE_ENTRY telephoneContactEntry =
  1098. {
  1099. g_pszArg1UserTelephone,
  1100. L"telephoneNumber",
  1101. eContactTel,
  1102. 0,
  1103. CommonDisplayStringFunc,
  1104. };
  1105. //
  1106. // Email
  1107. //
  1108. DSGET_ATTR_TABLE_ENTRY emailUserEntry =
  1109. {
  1110. g_pszArg1UserEmail,
  1111. L"mail",
  1112. eUserEmail,
  1113. 0,
  1114. CommonDisplayStringFunc,
  1115. };
  1116. DSGET_ATTR_TABLE_ENTRY emailContactEntry =
  1117. {
  1118. g_pszArg1UserEmail,
  1119. L"mail",
  1120. eContactEmail,
  1121. 0,
  1122. CommonDisplayStringFunc,
  1123. };
  1124. //
  1125. // Home Telephone
  1126. //
  1127. DSGET_ATTR_TABLE_ENTRY homeTelephoneUserEntry =
  1128. {
  1129. g_pszArg1UserHomeTelephone,
  1130. L"homePhone",
  1131. eUserHometel,
  1132. 0,
  1133. CommonDisplayStringFunc,
  1134. };
  1135. DSGET_ATTR_TABLE_ENTRY homeTelephoneContactEntry =
  1136. {
  1137. g_pszArg1UserHomeTelephone,
  1138. L"homePhone",
  1139. eContactHometel,
  1140. 0,
  1141. CommonDisplayStringFunc,
  1142. };
  1143. //
  1144. // Pager
  1145. //
  1146. DSGET_ATTR_TABLE_ENTRY pagerUserEntry =
  1147. {
  1148. g_pszArg1UserPagerNumber,
  1149. L"pager",
  1150. eUserPager,
  1151. 0,
  1152. CommonDisplayStringFunc,
  1153. };
  1154. DSGET_ATTR_TABLE_ENTRY pagerContactEntry =
  1155. {
  1156. g_pszArg1UserPagerNumber,
  1157. L"pager",
  1158. eContactPager,
  1159. 0,
  1160. CommonDisplayStringFunc,
  1161. };
  1162. //
  1163. // Mobile phone
  1164. //
  1165. DSGET_ATTR_TABLE_ENTRY mobileUserEntry =
  1166. {
  1167. g_pszArg1UserMobileNumber,
  1168. L"mobile",
  1169. eUserMobile,
  1170. 0,
  1171. CommonDisplayStringFunc,
  1172. };
  1173. DSGET_ATTR_TABLE_ENTRY mobileContactEntry =
  1174. {
  1175. g_pszArg1UserMobileNumber,
  1176. L"mobile",
  1177. eContactMobile,
  1178. 0,
  1179. CommonDisplayStringFunc,
  1180. };
  1181. //
  1182. // Fax
  1183. //
  1184. DSGET_ATTR_TABLE_ENTRY faxUserEntry =
  1185. {
  1186. g_pszArg1UserFaxNumber,
  1187. L"facsimileTelephoneNumber",
  1188. eUserFax,
  1189. 0,
  1190. CommonDisplayStringFunc,
  1191. };
  1192. DSGET_ATTR_TABLE_ENTRY faxContactEntry =
  1193. {
  1194. g_pszArg1UserFaxNumber,
  1195. L"facsimileTelephoneNumber",
  1196. eContactFax,
  1197. 0,
  1198. CommonDisplayStringFunc,
  1199. };
  1200. //
  1201. // IP phone #
  1202. //
  1203. DSGET_ATTR_TABLE_ENTRY ipPhoneUserEntry =
  1204. {
  1205. g_pszArg1UserIPTel,
  1206. L"ipPhone",
  1207. eUserIPTel,
  1208. 0,
  1209. CommonDisplayStringFunc,
  1210. };
  1211. DSGET_ATTR_TABLE_ENTRY ipPhoneContactEntry =
  1212. {
  1213. g_pszArg1UserIPTel,
  1214. L"ipPhone",
  1215. eContactIPTel,
  1216. 0,
  1217. CommonDisplayStringFunc,
  1218. };
  1219. //
  1220. // Web Page
  1221. //
  1222. DSGET_ATTR_TABLE_ENTRY webPageUserEntry =
  1223. {
  1224. g_pszArg1UserWebPage,
  1225. L"wWWHomePage",
  1226. eUserWebPage,
  1227. 0,
  1228. CommonDisplayStringFunc,
  1229. };
  1230. //
  1231. // Title
  1232. //
  1233. DSGET_ATTR_TABLE_ENTRY titleUserEntry =
  1234. {
  1235. g_pszArg1UserTitle,
  1236. L"title",
  1237. eUserTitle,
  1238. 0,
  1239. CommonDisplayStringFunc,
  1240. };
  1241. DSGET_ATTR_TABLE_ENTRY titleContactEntry =
  1242. {
  1243. g_pszArg1UserTitle,
  1244. L"title",
  1245. eContactTitle,
  1246. 0,
  1247. CommonDisplayStringFunc,
  1248. };
  1249. //
  1250. // Department
  1251. //
  1252. DSGET_ATTR_TABLE_ENTRY departmentUserEntry =
  1253. {
  1254. g_pszArg1UserDepartment,
  1255. L"department",
  1256. eUserDept,
  1257. 0,
  1258. CommonDisplayStringFunc,
  1259. };
  1260. DSGET_ATTR_TABLE_ENTRY departmentContactEntry =
  1261. {
  1262. g_pszArg1UserDepartment,
  1263. L"department",
  1264. eContactDept,
  1265. 0,
  1266. CommonDisplayStringFunc,
  1267. };
  1268. //
  1269. // Company
  1270. //
  1271. DSGET_ATTR_TABLE_ENTRY companyUserEntry =
  1272. {
  1273. g_pszArg1UserCompany,
  1274. L"company",
  1275. eUserCompany,
  1276. 0,
  1277. CommonDisplayStringFunc,
  1278. };
  1279. DSGET_ATTR_TABLE_ENTRY companyContactEntry =
  1280. {
  1281. g_pszArg1UserCompany,
  1282. L"company",
  1283. eContactCompany,
  1284. 0,
  1285. CommonDisplayStringFunc,
  1286. };
  1287. //
  1288. // Manager
  1289. //
  1290. DSGET_ATTR_TABLE_ENTRY managerUserEntry =
  1291. {
  1292. g_pszArg1UserManager,
  1293. L"manager",
  1294. eUserManager,
  1295. DSGET_OUTPUT_DN_FLAG,
  1296. CommonDisplayStringFunc,
  1297. };
  1298. //
  1299. // Home directory
  1300. //
  1301. DSGET_ATTR_TABLE_ENTRY homeDirectoryUserEntry =
  1302. {
  1303. g_pszArg1UserHomeDirectory,
  1304. L"homeDirectory",
  1305. eUserHomeDirectory,
  1306. 0,
  1307. CommonDisplayStringFunc,
  1308. };
  1309. //
  1310. // Home drive
  1311. //
  1312. DSGET_ATTR_TABLE_ENTRY homeDriveUserEntry =
  1313. {
  1314. g_pszArg1UserHomeDrive,
  1315. L"homeDrive",
  1316. eUserHomeDrive,
  1317. 0,
  1318. CommonDisplayStringFunc,
  1319. };
  1320. //
  1321. // Profile path
  1322. //
  1323. DSGET_ATTR_TABLE_ENTRY profilePathUserEntry =
  1324. {
  1325. g_pszArg1UserProfile,
  1326. L"profilePath",
  1327. eUserProfilePath,
  1328. 0,
  1329. CommonDisplayStringFunc,
  1330. };
  1331. //
  1332. // Logon script
  1333. //
  1334. DSGET_ATTR_TABLE_ENTRY logonScriptUserEntry =
  1335. {
  1336. g_pszArg1UserLogonScript,
  1337. L"scriptPath",
  1338. eUserLogonScript,
  1339. 0,
  1340. CommonDisplayStringFunc,
  1341. };
  1342. //
  1343. // pwdLastSet
  1344. //
  1345. DSGET_ATTR_TABLE_ENTRY mustChangePwdUserEntry =
  1346. {
  1347. g_pszArg1UserMustChangePwd,
  1348. L"pwdLastSet",
  1349. eUserMustchpwd,
  1350. 0,
  1351. DisplayMustChangePassword,
  1352. };
  1353. //
  1354. // user account control
  1355. //
  1356. DSGET_ATTR_TABLE_ENTRY disableUserEntry =
  1357. {
  1358. g_pszArg1UserDisableAccount,
  1359. L"userAccountControl",
  1360. eUserDisabled,
  1361. 0,
  1362. DisplayAccountDisabled
  1363. };
  1364. DSGET_ATTR_TABLE_ENTRY disableComputerEntry =
  1365. {
  1366. g_pszArg1ComputerDisableAccount,
  1367. L"userAccountControl",
  1368. eComputerDisabled,
  1369. 0,
  1370. DisplayAccountDisabled
  1371. };
  1372. DSGET_ATTR_TABLE_ENTRY pwdNeverExpiresUserEntry =
  1373. {
  1374. g_pszArg1UserPwdNeverExpires,
  1375. L"userAccountControl",
  1376. eUserPwdneverexpires,
  1377. 0,
  1378. DisplayPasswordNeverExpires
  1379. };
  1380. DSGET_ATTR_TABLE_ENTRY reverisblePwdUserEntry =
  1381. {
  1382. g_pszArg1UserReversiblePwd,
  1383. L"userAccountControl",
  1384. eUserReversiblePwd,
  1385. 0,
  1386. DisplayReversiblePassword
  1387. };
  1388. //
  1389. // Account expires
  1390. //
  1391. DSGET_ATTR_TABLE_ENTRY accountExpiresUserEntry =
  1392. {
  1393. g_pszArg1UserAcctExpires,
  1394. L"accountExpires",
  1395. eUserAcctExpires,
  1396. 0,
  1397. DisplayAccountExpires,
  1398. };
  1399. //
  1400. // SAM Account Name
  1401. //
  1402. DSGET_ATTR_TABLE_ENTRY samNameGroupEntry =
  1403. {
  1404. g_pszArg1GroupSamid,
  1405. L"sAMAccountName",
  1406. eGroupSamname,
  1407. 0,
  1408. CommonDisplayStringFunc,
  1409. };
  1410. //
  1411. // Group Type
  1412. //
  1413. DSGET_ATTR_TABLE_ENTRY groupScopeTypeEntry =
  1414. {
  1415. g_pszArg1GroupScope,
  1416. L"groupType",
  1417. eGroupScope,
  1418. 0,
  1419. DisplayGroupScope
  1420. };
  1421. DSGET_ATTR_TABLE_ENTRY groupSecurityTypeEntry =
  1422. {
  1423. g_pszArg1GroupSecGrp,
  1424. L"groupType",
  1425. eGroupSecgrp,
  1426. 0,
  1427. DisplayGroupSecurityEnabled
  1428. };
  1429. //
  1430. // Group Members
  1431. //
  1432. DSGET_ATTR_TABLE_ENTRY membersGroupEntry =
  1433. {
  1434. g_pszArg1GroupMembers,
  1435. L"member",
  1436. eGroupMembers,
  1437. DSGET_OUTPUT_DN_FLAG,
  1438. DisplayGroupMembers
  1439. };
  1440. //
  1441. // MemberOf
  1442. //
  1443. DSGET_ATTR_TABLE_ENTRY memberOfUserEntry =
  1444. {
  1445. L"Member of",
  1446. L"memberOf",
  1447. eUserMemberOf,
  1448. DSGET_OUTPUT_DN_FLAG,
  1449. DisplayUserMemberOf
  1450. };
  1451. DSGET_ATTR_TABLE_ENTRY memberOfComputerEntry =
  1452. {
  1453. g_pszArg1UserMemberOf,
  1454. L"memberOf",
  1455. eComputerMemberOf,
  1456. DSGET_OUTPUT_DN_FLAG,
  1457. DisplayComputerMemberOf
  1458. };
  1459. DSGET_ATTR_TABLE_ENTRY memberOfGroupEntry =
  1460. {
  1461. g_pszArg1GroupMemberOf,
  1462. L"memberOf",
  1463. eGroupMemberOf,
  1464. DSGET_OUTPUT_DN_FLAG,
  1465. DisplayGroupMemberOf
  1466. };
  1467. //
  1468. // User Can Change Password
  1469. //
  1470. DSGET_ATTR_TABLE_ENTRY canChangePwdUserEntry =
  1471. {
  1472. g_pszArg1UserCanChangePwd,
  1473. NULL,
  1474. eUserCanchpwd,
  1475. 0,
  1476. DisplayCanChangePassword
  1477. };
  1478. //
  1479. // Server entries
  1480. //
  1481. DSGET_ATTR_TABLE_ENTRY dnsNameServerEntry =
  1482. {
  1483. g_pszArg1ServerDnsName,
  1484. L"dnsHostName",
  1485. eServerDnsName,
  1486. 0,
  1487. CommonDisplayStringFunc
  1488. };
  1489. DSGET_ATTR_TABLE_ENTRY siteServerEntry =
  1490. {
  1491. g_pszArg1ServerSite,
  1492. NULL,
  1493. eServerSite,
  1494. 0,
  1495. DisplayGrandparentRDN
  1496. };
  1497. DSGET_ATTR_TABLE_ENTRY isGCServerEntry =
  1498. {
  1499. g_pszArg1ServerIsGC,
  1500. NULL,
  1501. eServerIsGC,
  1502. 0,
  1503. IsServerGCDisplay
  1504. };
  1505. DSGET_ATTR_TABLE_ENTRY topObjOwnerServerEntry =
  1506. {
  1507. NULL,
  1508. L"msDS-TopQuotaUsage",
  1509. eServerTopObjOwner,
  1510. DSGET_OUTPUT_DN_FLAG,
  1511. DisplayTopObjOwner
  1512. };
  1513. DSGET_ATTR_TABLE_ENTRY partServerEntry =
  1514. {
  1515. g_pszArg1ServerPart,
  1516. NULL,
  1517. eServerPart,
  1518. DSGET_OUTPUT_DN_FLAG,
  1519. DisplayPartitions
  1520. };
  1521. //
  1522. // Site entries
  1523. //
  1524. DSGET_ATTR_TABLE_ENTRY autoTopSiteEntry =
  1525. {
  1526. g_pszArg1SiteAutotopology,
  1527. NULL,
  1528. eSiteAutoTop,
  1529. 0,
  1530. IsAutotopologyEnabledSite
  1531. };
  1532. DSGET_ATTR_TABLE_ENTRY cacheGroupsSiteEntry =
  1533. {
  1534. g_pszArg1SiteCacheGroups,
  1535. NULL,
  1536. eSiteCacheGroups,
  1537. 0,
  1538. IsCacheGroupsEnabledSite
  1539. };
  1540. DSGET_ATTR_TABLE_ENTRY prefGCSiteEntry =
  1541. {
  1542. g_pszArg1SitePrefGCSite,
  1543. NULL,
  1544. eSitePrefGC,
  1545. 0,
  1546. DisplayPreferredGC
  1547. };
  1548. // Computer entries
  1549. DSGET_ATTR_TABLE_ENTRY locComputerEntry =
  1550. {
  1551. g_pszArg1ComputerLoc,
  1552. L"location",
  1553. eComputerLoc,
  1554. 0,
  1555. CommonDisplayStringFunc
  1556. };
  1557. DSGET_ATTR_TABLE_ENTRY qlimitComputerEntry =
  1558. {
  1559. g_pszArg1ComputerQLimit,
  1560. (PWSTR)g_pszAttrmsDSQuotaEffective,
  1561. eComputerQLimit,
  1562. 0,
  1563. DisplayQuotaInfoFunc
  1564. };
  1565. DSGET_ATTR_TABLE_ENTRY quotaUsedComputerEntry =
  1566. {
  1567. g_pszArg1ComputerQuotaUsed,
  1568. (PWSTR)g_pszAttrmsDSQuotaUsed,
  1569. eComputerQuotaUsed,
  1570. 0,
  1571. DisplayQuotaInfoFunc
  1572. };
  1573. //
  1574. // Subnet entries
  1575. //
  1576. DSGET_ATTR_TABLE_ENTRY locSubnetEntry =
  1577. {
  1578. g_pszArg1SubnetLocation,
  1579. L"location",
  1580. eSubnetLocation,
  1581. 0,
  1582. CommonDisplayStringFunc
  1583. };
  1584. DSGET_ATTR_TABLE_ENTRY siteSubnetEntry =
  1585. {
  1586. g_pszArg1SubnetSite,
  1587. L"siteObject",
  1588. eSubnetSite,
  1589. 0,
  1590. DisplayObjectAttributeAsRDN
  1591. };
  1592. //
  1593. // partition entries
  1594. //
  1595. DSGET_ATTR_TABLE_ENTRY QDefaultPartitionEntry =
  1596. {
  1597. g_pszArg1PartitionQDefault,
  1598. L"msDS-DefaultQuota",
  1599. ePartitionQDefault,
  1600. 0,
  1601. CommonDisplayStringFunc
  1602. };
  1603. DSGET_ATTR_TABLE_ENTRY qTombstoneWeightPartitionEntry =
  1604. {
  1605. g_pszArg1PartitionQTombstoneWeight,
  1606. L"msDS-TombstoneQuotaFactor",
  1607. ePartitionQTombstoneWeight,
  1608. 0,
  1609. CommonDisplayStringFunc
  1610. };
  1611. DSGET_ATTR_TABLE_ENTRY topObjOwnerPartitionEntry =
  1612. {
  1613. NULL,
  1614. L"msDS-TopQuotaUsage",
  1615. ePartitionTopObjOwner,
  1616. DSGET_OUTPUT_DN_FLAG,
  1617. DisplayTopObjOwner
  1618. };
  1619. //
  1620. // quota entries
  1621. //
  1622. DSGET_ATTR_TABLE_ENTRY acctQuotaEntry =
  1623. {
  1624. g_pszArg1QuotaAcct,
  1625. L"msDS-QuotaTrustee",
  1626. eQuotaAcct,
  1627. 0,
  1628. DisplayUserFromSidFunc
  1629. };
  1630. DSGET_ATTR_TABLE_ENTRY qlimitQuotaEntry =
  1631. {
  1632. g_pszArg1QuotaQLimit,
  1633. L"msDS-QuotaAmount",
  1634. eQuotaQLimit,
  1635. 0,
  1636. CommonDisplayStringFunc
  1637. };
  1638. //
  1639. //Attribute Table entries and ObjectTableEntries
  1640. //
  1641. //
  1642. // User
  1643. //
  1644. PDSGET_ATTR_TABLE_ENTRY UserAttributeTable[] =
  1645. {
  1646. &descriptionEntry,
  1647. &UserSAMEntry,
  1648. &UserSIDEntry,
  1649. &UserUPNEntry,
  1650. &firstNameUserEntry,
  1651. &middleInitialUserEntry,
  1652. &lastNameUserEntry,
  1653. &displayNameUserEntry,
  1654. &employeeIDUserEntry,
  1655. &officeUserEntry,
  1656. &telephoneUserEntry,
  1657. &emailUserEntry,
  1658. &homeTelephoneUserEntry,
  1659. &pagerUserEntry,
  1660. &mobileUserEntry,
  1661. &faxUserEntry,
  1662. &ipPhoneUserEntry,
  1663. &webPageUserEntry,
  1664. &titleUserEntry,
  1665. &departmentUserEntry,
  1666. &companyUserEntry,
  1667. &managerUserEntry,
  1668. &homeDirectoryUserEntry,
  1669. &homeDriveUserEntry,
  1670. &profilePathUserEntry,
  1671. &logonScriptUserEntry,
  1672. &mustChangePwdUserEntry,
  1673. &canChangePwdUserEntry,
  1674. &reverisblePwdUserEntry,
  1675. &pwdNeverExpiresUserEntry,
  1676. &accountExpiresUserEntry,
  1677. &disableUserEntry,
  1678. &memberOfUserEntry,
  1679. //&partUserEntry,
  1680. &qlimitUserEntry,
  1681. &quotaUsedUserEntry,
  1682. };
  1683. DSGetObjectTableEntry g_UserObjectEntry =
  1684. {
  1685. L"user",
  1686. g_pszUser,
  1687. DSGET_USER_COMMANDS,
  1688. USAGE_DSGET_USER,
  1689. sizeof(UserAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1690. UserAttributeTable,
  1691. };
  1692. //
  1693. // Contact
  1694. //
  1695. PDSGET_ATTR_TABLE_ENTRY ContactAttributeTable[] =
  1696. {
  1697. &descriptionEntry,
  1698. &firstNameContactEntry,
  1699. &middleInitialContactEntry,
  1700. &lastNameContactEntry,
  1701. &displayNameContactEntry,
  1702. &officeContactEntry,
  1703. &telephoneContactEntry,
  1704. &emailContactEntry,
  1705. &homeTelephoneContactEntry,
  1706. &pagerContactEntry,
  1707. &mobileContactEntry,
  1708. &faxContactEntry,
  1709. &ipPhoneContactEntry,
  1710. &titleContactEntry,
  1711. &departmentContactEntry,
  1712. &companyContactEntry,
  1713. };
  1714. DSGetObjectTableEntry g_ContactObjectEntry =
  1715. {
  1716. L"contact",
  1717. g_pszContact,
  1718. DSGET_CONTACT_COMMANDS,
  1719. USAGE_DSGET_CONTACT,
  1720. sizeof(ContactAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1721. ContactAttributeTable,
  1722. };
  1723. //
  1724. // Computer
  1725. //
  1726. PDSGET_ATTR_TABLE_ENTRY ComputerAttributeTable[] =
  1727. {
  1728. &descriptionEntry,
  1729. &ComputerSAMEntry,
  1730. &ComputerSIDEntry,
  1731. &locComputerEntry,
  1732. &disableComputerEntry,
  1733. &memberOfComputerEntry,
  1734. //&partComputerEntry,
  1735. &qlimitComputerEntry,
  1736. &quotaUsedComputerEntry,
  1737. };
  1738. DSGetObjectTableEntry g_ComputerObjectEntry =
  1739. {
  1740. L"computer",
  1741. g_pszComputer,
  1742. DSGET_COMPUTER_COMMANDS,
  1743. USAGE_DSGET_COMPUTER,
  1744. sizeof(ComputerAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1745. ComputerAttributeTable,
  1746. };
  1747. //
  1748. // Group
  1749. //
  1750. PDSGET_ATTR_TABLE_ENTRY GroupAttributeTable[] =
  1751. {
  1752. &descriptionEntry,
  1753. &samNameGroupEntry,
  1754. &GroupSIDEntry,
  1755. &groupScopeTypeEntry,
  1756. &groupSecurityTypeEntry,
  1757. &memberOfGroupEntry,
  1758. &membersGroupEntry,
  1759. //&partGroupEntry,
  1760. &qlimitGroupEntry,
  1761. &quotaUsedGroupEntry,
  1762. };
  1763. DSGetObjectTableEntry g_GroupObjectEntry =
  1764. {
  1765. L"group",
  1766. g_pszGroup,
  1767. DSGET_GROUP_COMMANDS,
  1768. USAGE_DSGET_GROUP,
  1769. sizeof(GroupAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1770. GroupAttributeTable,
  1771. };
  1772. //
  1773. // OU
  1774. //
  1775. PDSGET_ATTR_TABLE_ENTRY OUAttributeTable[] =
  1776. {
  1777. &descriptionEntry
  1778. };
  1779. DSGetObjectTableEntry g_OUObjectEntry =
  1780. {
  1781. L"ou",
  1782. g_pszOU,
  1783. NULL,
  1784. USAGE_DSGET_OU,
  1785. sizeof(OUAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1786. OUAttributeTable,
  1787. };
  1788. //
  1789. // Server
  1790. //
  1791. PDSGET_ATTR_TABLE_ENTRY ServerAttributeTable[] =
  1792. {
  1793. &descriptionEntry,
  1794. &dnsNameServerEntry,
  1795. &siteServerEntry,
  1796. &isGCServerEntry,
  1797. &topObjOwnerServerEntry,
  1798. &partServerEntry
  1799. };
  1800. DSGetObjectTableEntry g_ServerObjectEntry =
  1801. {
  1802. L"server",
  1803. g_pszServer,
  1804. DSGET_SERVER_COMMANDS,
  1805. USAGE_DSGET_SERVER,
  1806. sizeof(ServerAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1807. ServerAttributeTable,
  1808. };
  1809. //
  1810. // Site
  1811. //
  1812. PDSGET_ATTR_TABLE_ENTRY SiteAttributeTable[] =
  1813. {
  1814. &descriptionEntry,
  1815. &autoTopSiteEntry,
  1816. &cacheGroupsSiteEntry,
  1817. &prefGCSiteEntry
  1818. };
  1819. DSGetObjectTableEntry g_SiteObjectEntry =
  1820. {
  1821. L"site",
  1822. g_pszSite,
  1823. DSGET_SITE_COMMANDS,
  1824. USAGE_DSGET_SITE,
  1825. sizeof(SiteAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1826. SiteAttributeTable,
  1827. };
  1828. //
  1829. // Subnet
  1830. //
  1831. PDSGET_ATTR_TABLE_ENTRY SubnetAttributeTable[] =
  1832. {
  1833. &descriptionEntry,
  1834. &locSubnetEntry,
  1835. &siteSubnetEntry
  1836. };
  1837. DSGetObjectTableEntry g_SubnetObjectEntry =
  1838. {
  1839. L"subnet",
  1840. g_pszSubnet,
  1841. DSGET_SUBNET_COMMANDS,
  1842. USAGE_DSGET_SUBNET,
  1843. sizeof(SubnetAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1844. SubnetAttributeTable,
  1845. };
  1846. //
  1847. // partition
  1848. //
  1849. PDSGET_ATTR_TABLE_ENTRY PartitionAttributeTable[] =
  1850. {
  1851. &QDefaultPartitionEntry,
  1852. &qTombstoneWeightPartitionEntry,
  1853. &topObjOwnerPartitionEntry,
  1854. };
  1855. DSGetObjectTableEntry g_PartitionObjectEntry =
  1856. {
  1857. L"msDS-QuotaContainer",
  1858. g_pszPartition,
  1859. DSGET_PARTITION_COMMANDS,
  1860. USAGE_DSGET_PARTITION,
  1861. sizeof(PartitionAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1862. PartitionAttributeTable,
  1863. };
  1864. //
  1865. // quota
  1866. //
  1867. PDSGET_ATTR_TABLE_ENTRY QuotaAttributeTable[] =
  1868. {
  1869. &descriptionEntry,
  1870. &acctQuotaEntry,
  1871. &qlimitQuotaEntry,
  1872. };
  1873. DSGetObjectTableEntry g_QuotaObjectEntry =
  1874. {
  1875. L"msDS-QuotaControl",
  1876. g_pszQuota,
  1877. DSGET_QUOTA_COMMANDS,
  1878. USAGE_DSGET_QUOTA,
  1879. sizeof(QuotaAttributeTable)/sizeof(PDSATTRIBUTETABLEENTRY),
  1880. QuotaAttributeTable,
  1881. };
  1882. //+-------------------------------------------------------------------------
  1883. // Object Table
  1884. //--------------------------------------------------------------------------
  1885. PDSGetObjectTableEntry g_DSObjectTable[] =
  1886. {
  1887. &g_OUObjectEntry,
  1888. &g_UserObjectEntry,
  1889. &g_ContactObjectEntry,
  1890. &g_ComputerObjectEntry,
  1891. &g_GroupObjectEntry,
  1892. &g_ServerObjectEntry,
  1893. &g_SiteObjectEntry,
  1894. &g_SubnetObjectEntry,
  1895. &g_PartitionObjectEntry,
  1896. &g_QuotaObjectEntry,
  1897. NULL
  1898. };
  1899. //
  1900. //Usage Table
  1901. //
  1902. UINT USAGE_DSGET[] =
  1903. {
  1904. USAGE_DSGET_DESCRIPTION,
  1905. USAGE_DSGET_REMARKS,
  1906. USAGE_DSGET_EXAMPLES,
  1907. USAGE_END,
  1908. };
  1909. UINT USAGE_DSGET_USER[] =
  1910. {
  1911. USAGE_DSGET_USER_DESCRIPTION,
  1912. USAGE_DSGET_USER_SYNTAX,
  1913. USAGE_DSGET_USER_PARAMETERS,
  1914. USAGE_DSGET_USER_REMARKS,
  1915. USAGE_DSGET_USER_EXAMPLES,
  1916. USAGE_END,
  1917. };
  1918. UINT USAGE_DSGET_CONTACT[] =
  1919. {
  1920. USAGE_DSGET_CONTACT_DESCRIPTION,
  1921. USAGE_DSGET_CONTACT_SYNTAX,
  1922. USAGE_DSGET_CONTACT_PARAMETERS,
  1923. USAGE_DSGET_CONTACT_REMARKS,
  1924. USAGE_DSGET_CONTACT_EXAMPLES,
  1925. USAGE_DSGET_CONTACT_SEE_ALSO,
  1926. USAGE_END,
  1927. };
  1928. UINT USAGE_DSGET_COMPUTER[] =
  1929. {
  1930. USAGE_DSGET_COMPUTER_DESCRIPTION,
  1931. USAGE_DSGET_COMPUTER_SYNTAX,
  1932. USAGE_DSGET_COMPUTER_PARAMETERS,
  1933. USAGE_DSGET_COMPUTER_REMARKS,
  1934. USAGE_DSGET_COMPUTER_EXAMPLES,
  1935. USAGE_DSGET_COMPUTER_SEE_ALSO,
  1936. USAGE_END,
  1937. };
  1938. UINT USAGE_DSGET_GROUP[] =
  1939. {
  1940. USAGE_DSGET_GROUP_DESCRIPTION,
  1941. USAGE_DSGET_GROUP_SYNTAX,
  1942. USAGE_DSGET_GROUP_PARAMETERS,
  1943. USAGE_DSGET_GROUP_REMARKS,
  1944. USAGE_DSGET_GROUP_EXAMPLES,
  1945. USAGE_DSGET_GROUP_SEE_ALSO,
  1946. USAGE_END,
  1947. };
  1948. UINT USAGE_DSGET_OU[] =
  1949. {
  1950. USAGE_DSGET_OU_DESCRIPTION,
  1951. USAGE_DSGET_OU_SYNTAX,
  1952. USAGE_DSGET_OU_PARAMETERS,
  1953. USAGE_DSGET_OU_REMARKS,
  1954. USAGE_DSGET_OU_EXAMPLES,
  1955. USAGE_DSGET_OU_SEE_ALSO,
  1956. USAGE_END,
  1957. };
  1958. UINT USAGE_DSGET_SERVER[] =
  1959. {
  1960. USAGE_DSGET_SERVER_DESCRIPTION,
  1961. USAGE_DSGET_SERVER_SYNTAX,
  1962. USAGE_DSGET_SERVER_PARAMETERS,
  1963. USAGE_DSGET_SERVER_REMARKS,
  1964. USAGE_DSGET_SERVER_EXAMPLES,
  1965. USAGE_DSGET_SERVER_SEE_ALSO,
  1966. USAGE_END,
  1967. };
  1968. UINT USAGE_DSGET_SITE[] =
  1969. {
  1970. USAGE_DSGET_SITE_DESCRIPTION,
  1971. USAGE_DSGET_SITE_SYNTAX,
  1972. USAGE_DSGET_SITE_PARAMETERS,
  1973. USAGE_DSGET_SITE_REMARKS,
  1974. USAGE_DSGET_SITE_EXAMPLES,
  1975. USAGE_DSGET_SITE_SEE_ALSO,
  1976. USAGE_END,
  1977. };
  1978. UINT USAGE_DSGET_SUBNET[] =
  1979. {
  1980. USAGE_DSGET_SUBNET_DESCRIPTION,
  1981. USAGE_DSGET_SUBNET_SYNTAX,
  1982. USAGE_DSGET_SUBNET_PARAMETERS,
  1983. USAGE_DSGET_SUBNET_REMARKS,
  1984. USAGE_DSGET_SUBNET_EXAMPLES,
  1985. USAGE_DSGET_SUBNET_SEE_ALSO,
  1986. USAGE_END,
  1987. };
  1988. UINT USAGE_DSGET_PARTITION[] =
  1989. {
  1990. USAGE_DSGET_PARTITION_DESCRIPTION,
  1991. USAGE_DSGET_PARTITION_SYNTAX,
  1992. USAGE_DSGET_PARTITION_PARAMETERS,
  1993. USAGE_DSGET_PARTITION_REMARKS,
  1994. USAGE_DSGET_PARTITION_EXAMPLES,
  1995. USAGE_DSGET_PARTITION_SEE_ALSO,
  1996. USAGE_END,
  1997. };
  1998. UINT USAGE_DSGET_QUOTA[] =
  1999. {
  2000. USAGE_DSGET_QUOTA_DESCRIPTION,
  2001. USAGE_DSGET_QUOTA_SYNTAX,
  2002. USAGE_DSGET_QUOTA_PARAMETERS,
  2003. USAGE_DSGET_QUOTA_REMARKS,
  2004. USAGE_DSGET_QUOTA_EXAMPLES,
  2005. USAGE_DSGET_QUOTA_SEE_ALSO,
  2006. USAGE_END,
  2007. };