@pnp/cli-microsoft365 6.3.0-beta.fee5cdb → 6.4.0-beta.006c079

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/.devcontainer/Dockerfile +5 -2
  2. package/.eslintrc.js +4 -0
  3. package/Dockerfile +6 -3
  4. package/README.md +12 -1
  5. package/dist/Command.js +1 -0
  6. package/dist/appInsights.js +2 -1
  7. package/dist/cli/Cli.js +70 -2
  8. package/dist/m365/aad/commands/license/license-list.js +41 -0
  9. package/dist/m365/aad/commands/user/user-add.js +223 -0
  10. package/dist/m365/aad/commands/user/user-get.js +3 -0
  11. package/dist/m365/aad/commands/user/user-license-add.js +88 -0
  12. package/dist/m365/aad/commands/user/user-license-list.js +99 -0
  13. package/dist/m365/aad/commands/user/user-license-remove.js +115 -0
  14. package/dist/m365/aad/commands/user/user-recyclebinitem-clear.js +1 -1
  15. package/dist/m365/aad/commands/user/user-recyclebinitem-list.js +41 -0
  16. package/dist/m365/aad/commands/user/user-recyclebinitem-remove.js +92 -0
  17. package/dist/m365/aad/commands/user/user-recyclebinitem-restore.js +70 -0
  18. package/dist/m365/aad/commands/user/user-remove.js +107 -0
  19. package/dist/m365/aad/commands/user/user-set.js +3 -0
  20. package/dist/m365/aad/commands/user/user-signin-list.js +3 -0
  21. package/dist/m365/aad/commands.js +9 -0
  22. package/dist/m365/file/commands/file-list.js +5 -1
  23. package/dist/m365/flow/commands/environment/FlowEnvironmentDetails.js +3 -0
  24. package/dist/m365/flow/commands/environment/environment-get.js +26 -11
  25. package/dist/m365/flow/commands/flow-disable.js +9 -2
  26. package/dist/m365/flow/commands/flow-enable.js +9 -2
  27. package/dist/m365/flow/commands/flow-get.js +9 -2
  28. package/dist/m365/flow/commands/flow-list.js +1 -1
  29. package/dist/m365/flow/commands/flow-remove.js +2 -2
  30. package/dist/m365/flow/commands/owner/owner-ensure.js +147 -0
  31. package/dist/m365/flow/commands/owner/owner-list.js +89 -0
  32. package/dist/m365/flow/commands/owner/owner-remove.js +147 -0
  33. package/dist/m365/flow/commands/run/run-cancel.js +9 -2
  34. package/dist/m365/flow/commands/run/run-list.js +5 -2
  35. package/dist/m365/flow/commands.js +3 -0
  36. package/dist/m365/planner/commands/roster/roster-member-add.js +3 -0
  37. package/dist/m365/planner/commands/roster/roster-member-get.js +98 -0
  38. package/dist/m365/planner/commands.js +1 -0
  39. package/dist/m365/pp/commands/environment/environment-get.js +18 -9
  40. package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +138 -0
  41. package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +48 -14
  42. package/dist/m365/purview/commands.js +1 -0
  43. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.0-beta.1.js +59 -0
  44. package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
  45. package/dist/m365/spfx/commands/spfx-doctor.js +43 -29
  46. package/dist/m365/spo/commands/commandset/commandset-add.js +138 -0
  47. package/dist/m365/spo/commands/commandset/commandset-get.js +128 -0
  48. package/dist/m365/spo/commands/commandset/commandset-list.js +77 -0
  49. package/dist/m365/spo/commands/commandset/commandset-remove.js +146 -0
  50. package/dist/m365/spo/commands/commandset/commandset-set.js +182 -0
  51. package/dist/m365/spo/commands/customaction/customaction-get.js +27 -7
  52. package/dist/m365/spo/commands/file/file-move.js +1 -3
  53. package/dist/m365/spo/commands/folder/folder-copy.js +0 -2
  54. package/dist/m365/spo/commands/folder/folder-move.js +0 -2
  55. package/dist/m365/spo/commands/group/group-member-add.js +54 -95
  56. package/dist/m365/spo/commands/list/list-add.js +11 -8
  57. package/dist/m365/spo/commands/list/list-set.js +3 -3
  58. package/dist/m365/spo/commands/navigation/navigation-node-add.js +5 -4
  59. package/dist/m365/spo/commands/navigation/navigation-node-set.js +5 -1
  60. package/dist/m365/spo/commands/site/site-add.js +0 -3
  61. package/dist/m365/spo/commands/site/site-remove.js +0 -3
  62. package/dist/m365/spo/commands/site/site-set.js +0 -2
  63. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +118 -0
  64. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +0 -1
  65. package/dist/m365/spo/commands/term/term-get.js +68 -48
  66. package/dist/m365/spo/commands/user/user-ensure.js +105 -0
  67. package/dist/m365/spo/commands.js +7 -0
  68. package/dist/m365/teams/commands/team/team-add.js +3 -8
  69. package/dist/m365/todo/commands/task/task-add.js +35 -3
  70. package/dist/utils/aadGroup.js +18 -0
  71. package/dist/utils/aadUser.js +37 -0
  72. package/dist/utils/md.js +7 -0
  73. package/dist/utils/session.js +18 -0
  74. package/dist/utils/spo.js +35 -12
  75. package/docs/docs/cmd/aad/app/app-add.md +3 -3
  76. package/docs/docs/cmd/aad/approleassignment/approleassignment-add.md +5 -5
  77. package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.md +3 -3
  78. package/docs/docs/cmd/aad/license/license-list.md +87 -0
  79. package/docs/docs/cmd/aad/user/user-add.md +168 -0
  80. package/docs/docs/cmd/aad/user/user-license-add.md +108 -0
  81. package/docs/docs/cmd/aad/user/user-license-list.md +98 -0
  82. package/docs/docs/cmd/aad/user/user-license-remove.md +43 -0
  83. package/docs/docs/cmd/aad/user/user-recyclebinitem-clear.md +1 -1
  84. package/docs/docs/cmd/aad/user/user-recyclebinitem-list.md +82 -0
  85. package/docs/docs/cmd/aad/user/user-recyclebinitem-remove.md +45 -0
  86. package/docs/docs/cmd/aad/user/user-recyclebinitem-restore.md +99 -0
  87. package/docs/docs/cmd/aad/user/user-remove.md +51 -0
  88. package/docs/docs/cmd/aad/user/user-set.md +1 -1
  89. package/docs/docs/cmd/cli/completion/completion-clink-update.md +4 -4
  90. package/docs/docs/cmd/flow/environment/environment-get.md +31 -3
  91. package/docs/docs/cmd/flow/owner/owner-ensure.md +61 -0
  92. package/docs/docs/cmd/flow/owner/owner-list.md +90 -0
  93. package/docs/docs/cmd/flow/owner/owner-remove.md +67 -0
  94. package/docs/docs/cmd/flow/run/run-list.md +28 -0
  95. package/docs/docs/cmd/onenote/page/page-list.md +1 -1
  96. package/docs/docs/cmd/outlook/mail/mail-send.md +7 -3
  97. package/docs/docs/cmd/outlook/message/message-get.md +143 -0
  98. package/docs/docs/cmd/outlook/message/message-list.md +119 -0
  99. package/docs/docs/cmd/outlook/message/message-move.md +4 -0
  100. package/docs/docs/cmd/outlook/report/report-mailactivitycounts.md +40 -0
  101. package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.md +40 -0
  102. package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.md +45 -0
  103. package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.md +43 -0
  104. package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.md +44 -0
  105. package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.md +48 -0
  106. package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.md +41 -0
  107. package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.md +49 -0
  108. package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.md +37 -0
  109. package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.md +40 -0
  110. package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.md +36 -0
  111. package/docs/docs/cmd/outlook/room/room-list.md +81 -0
  112. package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +58 -0
  113. package/docs/docs/cmd/planner/plan/plan-add.md +3 -3
  114. package/docs/docs/cmd/planner/plan/plan-set.md +73 -7
  115. package/docs/docs/cmd/planner/roster/roster-add.md +16 -1
  116. package/docs/docs/cmd/planner/roster/roster-member-get.md +87 -0
  117. package/docs/docs/cmd/planner/task/task-add.md +230 -0
  118. package/docs/docs/cmd/planner/task/task-checklistitem-add.md +55 -0
  119. package/docs/docs/cmd/planner/task/task-checklistitem-list.md +55 -0
  120. package/docs/docs/cmd/planner/task/task-checklistitem-remove.md +4 -0
  121. package/docs/docs/cmd/planner/task/task-get.md +131 -0
  122. package/docs/docs/cmd/planner/task/task-list.md +92 -0
  123. package/docs/docs/cmd/planner/task/task-reference-add.md +46 -0
  124. package/docs/docs/cmd/planner/task/task-reference-list.md +46 -0
  125. package/docs/docs/cmd/planner/task/task-reference-remove.md +4 -0
  126. package/docs/docs/cmd/planner/task/task-remove.md +4 -0
  127. package/docs/docs/cmd/planner/task/task-set.md +230 -0
  128. package/docs/docs/cmd/planner/tenant/tenant-settings-list.md +55 -0
  129. package/docs/docs/cmd/planner/tenant/tenant-settings-set.md +55 -0
  130. package/docs/docs/cmd/pp/card/card-get.md +2 -2
  131. package/docs/docs/cmd/pp/card/card-list.md +2 -2
  132. package/docs/docs/cmd/purview/retentionevent/retentionevent-add.md +149 -0
  133. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +7 -7
  134. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +12 -0
  135. package/docs/docs/cmd/skype/report/report-activitycounts.md +38 -0
  136. package/docs/docs/cmd/skype/report/report-activityusercounts.md +38 -0
  137. package/docs/docs/cmd/skype/report/report-activityuserdetail.md +67 -0
  138. package/docs/docs/cmd/spfx/project/project-doctor.md +3 -3
  139. package/docs/docs/cmd/spfx/project/project-externalize.md +3 -3
  140. package/docs/docs/cmd/spfx/project/project-permissions-grant.md +21 -0
  141. package/docs/docs/cmd/spfx/project/project-upgrade.md +3 -3
  142. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  143. package/docs/docs/cmd/spo/cdn/cdn-get.md +6 -6
  144. package/docs/docs/cmd/spo/cdn/cdn-origin-add.md +3 -3
  145. package/docs/docs/cmd/spo/cdn/cdn-origin-list.md +3 -3
  146. package/docs/docs/cmd/spo/cdn/cdn-origin-remove.md +3 -3
  147. package/docs/docs/cmd/spo/cdn/cdn-policy-list.md +3 -3
  148. package/docs/docs/cmd/spo/cdn/cdn-policy-set.md +3 -3
  149. package/docs/docs/cmd/spo/cdn/cdn-set.md +3 -3
  150. package/docs/docs/cmd/spo/commandset/commandset-add.md +159 -0
  151. package/docs/docs/cmd/spo/commandset/commandset-get.md +149 -0
  152. package/docs/docs/cmd/spo/commandset/commandset-list.md +109 -0
  153. package/docs/docs/cmd/spo/commandset/commandset-remove.md +55 -0
  154. package/docs/docs/cmd/spo/commandset/commandset-set.md +71 -0
  155. package/docs/docs/cmd/spo/customaction/customaction-get.md +113 -11
  156. package/docs/docs/cmd/spo/externaluser/externaluser-list.md +2 -0
  157. package/docs/docs/cmd/spo/group/group-member-add.md +26 -4
  158. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.md +2 -0
  159. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.md +2 -0
  160. package/docs/docs/cmd/spo/homesite/homesite-get.md +20 -1
  161. package/docs/docs/cmd/spo/homesite/homesite-remove.md +10 -2
  162. package/docs/docs/cmd/spo/homesite/homesite-set.md +10 -2
  163. package/docs/docs/cmd/spo/hubsite/hubsite-connect.md +9 -9
  164. package/docs/docs/cmd/spo/hubsite/hubsite-data-get.md +34 -5
  165. package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.md +6 -6
  166. package/docs/docs/cmd/spo/hubsite/hubsite-get.md +36 -19
  167. package/docs/docs/cmd/spo/hubsite/hubsite-list.md +59 -1
  168. package/docs/docs/cmd/spo/hubsite/hubsite-register.md +30 -1
  169. package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.md +6 -6
  170. package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.md +4 -4
  171. package/docs/docs/cmd/spo/hubsite/hubsite-set.md +40 -15
  172. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +4 -4
  173. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +9 -1
  174. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +11 -3
  175. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +11 -5
  176. package/docs/docs/cmd/spo/list/list-add.md +124 -58
  177. package/docs/docs/cmd/spo/list/list-contenttype-add.md +50 -5
  178. package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +4 -4
  179. package/docs/docs/cmd/spo/list/list-contenttype-list.md +49 -4
  180. package/docs/docs/cmd/spo/list/list-contenttype-remove.md +6 -6
  181. package/docs/docs/cmd/spo/list/list-get.md +70 -4
  182. package/docs/docs/cmd/spo/list/list-list.md +70 -2
  183. package/docs/docs/cmd/spo/list/list-remove.md +6 -6
  184. package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.md +2 -2
  185. package/docs/docs/cmd/spo/list/list-retentionlabel-get.md +36 -3
  186. package/docs/docs/cmd/spo/list/list-retentionlabel-remove.md +3 -3
  187. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +6 -6
  188. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +3 -3
  189. package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -9
  190. package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +7 -7
  191. package/docs/docs/cmd/spo/list/list-set.md +61 -61
  192. package/docs/docs/cmd/spo/list/list-sitescript-get.md +35 -3
  193. package/docs/docs/cmd/spo/list/list-view-add.md +66 -5
  194. package/docs/docs/cmd/spo/list/list-view-field-add.md +10 -10
  195. package/docs/docs/cmd/spo/list/list-view-get.md +61 -0
  196. package/docs/docs/cmd/spo/list/list-view-list.md +61 -0
  197. package/docs/docs/cmd/spo/list/list-view-set.md +1 -1
  198. package/docs/docs/cmd/spo/list/list-webhook-add.md +19 -0
  199. package/docs/docs/cmd/spo/list/list-webhook-get.md +19 -0
  200. package/docs/docs/cmd/spo/list/list-webhook-list.md +19 -0
  201. package/docs/docs/cmd/spo/listitem/listitem-add.md +30 -1
  202. package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +17 -2
  203. package/docs/docs/cmd/spo/listitem/listitem-batch-add.md +1 -1
  204. package/docs/docs/cmd/spo/listitem/listitem-get.md +57 -0
  205. package/docs/docs/cmd/spo/listitem/listitem-isrecord.md +6 -0
  206. package/docs/docs/cmd/spo/listitem/listitem-list.md +28 -0
  207. package/docs/docs/cmd/spo/listitem/listitem-record-declare.md +15 -0
  208. package/docs/docs/cmd/spo/listitem/listitem-set.md +31 -1
  209. package/docs/docs/cmd/spo/navigation/navigation-node-add.md +25 -3
  210. package/docs/docs/cmd/spo/navigation/navigation-node-set.md +2 -2
  211. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.md +2 -0
  212. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +2 -0
  213. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +2 -0
  214. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +2 -0
  215. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.md +2 -0
  216. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.md +3 -3
  217. package/docs/docs/cmd/spo/site/site-appcatalog-add.md +2 -0
  218. package/docs/docs/cmd/spo/site/site-appcatalog-remove.md +3 -3
  219. package/docs/docs/cmd/spo/site/site-commsite-enable.md +2 -0
  220. package/docs/docs/cmd/spo/site/site-list.md +3 -3
  221. package/docs/docs/cmd/spo/site/site-remove.md +3 -3
  222. package/docs/docs/cmd/spo/site/site-rename.md +3 -3
  223. package/docs/docs/cmd/spo/site/site-set.md +5 -5
  224. package/docs/docs/cmd/spo/storageentity/storageentity-remove.md +3 -3
  225. package/docs/docs/cmd/spo/storageentity/storageentity-set.md +3 -3
  226. package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.md +3 -3
  227. package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.md +2 -0
  228. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +3 -3
  229. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.md +142 -0
  230. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.md +2 -0
  231. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.md +3 -3
  232. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.md +3 -3
  233. package/docs/docs/cmd/spo/tenant/tenant-settings-list.md +2 -0
  234. package/docs/docs/cmd/spo/tenant/tenant-settings-set.md +28 -26
  235. package/docs/docs/cmd/spo/term/term-add.md +3 -3
  236. package/docs/docs/cmd/spo/term/term-get.md +3 -3
  237. package/docs/docs/cmd/spo/term/term-group-add.md +2 -0
  238. package/docs/docs/cmd/spo/term/term-group-get.md +2 -0
  239. package/docs/docs/cmd/spo/term/term-group-list.md +2 -0
  240. package/docs/docs/cmd/spo/term/term-list.md +3 -1
  241. package/docs/docs/cmd/spo/term/term-set-add.md +3 -3
  242. package/docs/docs/cmd/spo/term/term-set-get.md +2 -0
  243. package/docs/docs/cmd/spo/term/term-set-list.md +2 -0
  244. package/docs/docs/cmd/spo/theme/theme-apply.md +3 -3
  245. package/docs/docs/cmd/spo/theme/theme-get.md +2 -0
  246. package/docs/docs/cmd/spo/theme/theme-list.md +2 -0
  247. package/docs/docs/cmd/spo/theme/theme-remove.md +2 -0
  248. package/docs/docs/cmd/spo/theme/theme-set.md +3 -3
  249. package/docs/docs/cmd/spo/user/user-ensure.md +109 -0
  250. package/docs/docs/cmd/teams/channel/channel-get.md +1 -1
  251. package/docs/docs/cmd/teams/channel/channel-member-add.md +2 -2
  252. package/docs/docs/cmd/teams/message/message-get.md +39 -4
  253. package/docs/docs/cmd/teams/message/message-list.md +41 -6
  254. package/docs/docs/cmd/teams/message/message-reply-list.md +39 -4
  255. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-list.md +20 -2
  256. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-set.md +8 -8
  257. package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.md +12 -5
  258. package/docs/docs/cmd/teams/report/report-deviceusageusercounts.md +13 -6
  259. package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.md +14 -7
  260. package/docs/docs/cmd/teams/report/report-directroutingcalls.md +13 -6
  261. package/docs/docs/cmd/teams/report/report-pstncalls.md +13 -6
  262. package/docs/docs/cmd/teams/report/report-useractivitycounts.md +13 -6
  263. package/docs/docs/cmd/teams/report/report-useractivityusercounts.md +13 -6
  264. package/docs/docs/cmd/teams/report/report-useractivityuserdetail.md +13 -6
  265. package/docs/docs/cmd/teams/tab/tab-add.md +16 -0
  266. package/docs/docs/cmd/teams/tab/tab-get.md +17 -0
  267. package/docs/docs/cmd/teams/tab/tab-list.md +19 -0
  268. package/docs/docs/cmd/teams/team/team-add.md +77 -8
  269. package/docs/docs/cmd/teams/team/team-app-list.md +18 -2
  270. package/docs/docs/cmd/teams/team/team-archive.md +2 -2
  271. package/docs/docs/cmd/teams/team/team-clone.md +8 -8
  272. package/docs/docs/cmd/teams/team/team-get.md +34 -4
  273. package/docs/docs/cmd/teams/team/team-list.md +34 -3
  274. package/docs/docs/cmd/teams/team/team-remove.md +3 -3
  275. package/docs/docs/cmd/teams/team/team-set.md +8 -8
  276. package/docs/docs/cmd/teams/team/team-unarchive.md +3 -2
  277. package/docs/docs/cmd/teams/user/user-app-add.md +3 -3
  278. package/docs/docs/cmd/teams/user/user-app-list.md +18 -2
  279. package/docs/docs/cmd/teams/user/user-app-remove.md +4 -4
  280. package/docs/docs/cmd/teams/user/user-list.md +21 -4
  281. package/docs/docs/cmd/todo/task/task-add.md +47 -2
  282. package/npm-shrinkwrap.json +280 -194
  283. package/package.json +15 -13
@@ -53,6 +53,24 @@ exports.aadGroup = {
53
53
  }
54
54
  return groups[0];
55
55
  });
56
+ },
57
+ /**
58
+ * Get id of a group by its display name.
59
+ * @param displayName Group display name.
60
+ * @throws Error when group was not found.
61
+ * @throws Error when multiple groups with the same name were found.
62
+ */
63
+ getGroupIdByDisplayName(displayName) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const groups = yield odata_1.odata.getAllItems(`${graphResource}/v1.0/groups?$filter=displayName eq '${formatting_1.formatting.encodeQueryParameter(displayName)}'&$select=id`);
66
+ if (!groups.length) {
67
+ throw Error(`The specified group '${displayName}' does not exist.`);
68
+ }
69
+ if (groups.length > 1) {
70
+ throw Error(`Multiple groups with name '${displayName}' found: ${groups.map(x => x.id).join(',')}.`);
71
+ }
72
+ return groups[0].id;
73
+ });
56
74
  }
57
75
  };
58
76
  //# sourceMappingURL=aadGroup.js.map
@@ -33,6 +33,43 @@ exports.aadUser = {
33
33
  }
34
34
  return res.value[0].id;
35
35
  });
36
+ },
37
+ /**
38
+ * Retrieve the ID of a user by its email.
39
+ * @param mail User email.
40
+ */
41
+ getUserIdByEmail(email) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const requestOptions = {
44
+ url: `${graphResource}/v1.0/users?$filter=mail eq '${formatting_1.formatting.encodeQueryParameter(email)}'&$select=id`,
45
+ headers: {
46
+ accept: 'application/json;odata.metadata=none'
47
+ },
48
+ responseType: 'json'
49
+ };
50
+ const res = yield request_1.default.get(requestOptions);
51
+ if (res.value.length === 0) {
52
+ throw Error(`The specified user with email ${email} does not exist`);
53
+ }
54
+ return res.value[0].id;
55
+ });
56
+ },
57
+ /**
58
+ * Retrieve the UPN of a user by its ID.
59
+ * @param id User ID.
60
+ */
61
+ getUpnByUserId(id) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const requestOptions = {
64
+ url: `${graphResource}/v1.0/users/${id}?$select=userPrincipalName`,
65
+ headers: {
66
+ accept: 'application/json;odata.metadata=none'
67
+ },
68
+ responseType: 'json'
69
+ };
70
+ const res = yield request_1.default.get(requestOptions);
71
+ return res.userPrincipalName;
72
+ });
36
73
  }
37
74
  };
38
75
  //# sourceMappingURL=aadUser.js.map
package/dist/utils/md.js CHANGED
@@ -51,6 +51,12 @@ function convertContentTabs(md) {
51
51
  return ` ${title}${os_1.EOL}${os_1.EOL}${content.replace(/^ /gms, '')}`;
52
52
  });
53
53
  }
54
+ function convertMdOutput(md) {
55
+ const regex = new RegExp('(?<=^ ```md)(.*)(?= ```)', 'gms');
56
+ return md.replace(regex, (match, content) => {
57
+ return content.replace(/^ /gms, '');
58
+ });
59
+ }
54
60
  function convertCodeFences(md) {
55
61
  const regex = new RegExp('^```.*?(?:\r\n|\n)(.*?)```(?:\r\n|\n)', 'gms');
56
62
  return md.replace(regex, (match, code) => {
@@ -79,6 +85,7 @@ const convertFunctions = [
79
85
  convertAdmonitions,
80
86
  convertDd,
81
87
  convertHyperlinks,
88
+ convertMdOutput,
82
89
  convertContentTabs,
83
90
  convertCodeFences,
84
91
  removeInlineMarkup,
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.session = void 0;
4
+ const crypto = require("crypto");
5
+ const cache_1 = require("./cache");
6
+ exports.session = {
7
+ getId(pid) {
8
+ const key = `${pid.toString()}_session`;
9
+ let sessionId = cache_1.cache.getValue(key);
10
+ if (sessionId) {
11
+ return sessionId;
12
+ }
13
+ sessionId = crypto.randomBytes(24).toString('base64');
14
+ cache_1.cache.setValue(key, sessionId);
15
+ return sessionId;
16
+ }
17
+ };
18
+ //# sourceMappingURL=session.js.map
package/dist/utils/spo.js CHANGED
@@ -56,7 +56,7 @@ exports.spo = {
56
56
  });
57
57
  });
58
58
  },
59
- waitUntilFinished({ operationId, siteUrl, resolve, reject, logger, currentContext, dots, debug, verbose }) {
59
+ waitUntilFinished({ operationId, siteUrl, resolve, reject, logger, currentContext, debug, verbose }) {
60
60
  exports.spo
61
61
  .ensureFormDigest(siteUrl, logger, currentContext, debug)
62
62
  .then((res) => {
@@ -64,10 +64,6 @@ exports.spo = {
64
64
  if (debug) {
65
65
  logger.logToStderr(`Checking if operation ${operationId} completed...`);
66
66
  }
67
- if (!debug && verbose) {
68
- dots += '.';
69
- process.stdout.write(`\r${dots}`);
70
- }
71
67
  const requestOptions = {
72
68
  url: `${siteUrl}/_vti_bin/client.svc/ProcessQuery`,
73
69
  headers: {
@@ -101,7 +97,6 @@ exports.spo = {
101
97
  reject,
102
98
  logger,
103
99
  currentContext,
104
- dots,
105
100
  debug,
106
101
  verbose
107
102
  });
@@ -109,7 +104,7 @@ exports.spo = {
109
104
  }
110
105
  });
111
106
  },
112
- waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger, dots, debug, verbose }) {
107
+ waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger, debug, verbose }) {
113
108
  const requestUrl = `${siteUrl}/_api/site/GetCopyJobProgress`;
114
109
  const requestOptions = {
115
110
  url: requestUrl,
@@ -119,10 +114,6 @@ exports.spo = {
119
114
  data: { "copyJobInfo": copyJobInfo },
120
115
  responseType: 'json'
121
116
  };
122
- if (!debug && verbose) {
123
- dots += '.';
124
- process.stdout.write(`\r${dots}`);
125
- }
126
117
  request_1.default
127
118
  .post(requestOptions)
128
119
  .then((resp) => {
@@ -149,7 +140,7 @@ exports.spo = {
149
140
  }
150
141
  else {
151
142
  setTimeout(() => {
152
- exports.spo.waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger, dots, debug, verbose });
143
+ exports.spo.waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger, debug, verbose });
153
144
  }, pollingInterval);
154
145
  }
155
146
  });
@@ -545,6 +536,38 @@ exports.spo = {
545
536
  const customActionOnSite = yield getById(webUrl, id, "Site");
546
537
  return customActionOnSite;
547
538
  });
539
+ },
540
+ getTenantAppCatalogUrl(logger, debug) {
541
+ return __awaiter(this, void 0, void 0, function* () {
542
+ const spoUrl = yield exports.spo.getSpoUrl(logger, debug);
543
+ const requestOptions = {
544
+ url: `${spoUrl}/_api/SP_TenantSettings_Current`,
545
+ headers: {
546
+ accept: 'application/json;odata=nometadata'
547
+ },
548
+ responseType: 'json'
549
+ };
550
+ const result = yield request_1.default.get(requestOptions);
551
+ return result.CorporateCatalogUrl;
552
+ });
553
+ },
554
+ /**
555
+ * Retrieves the Azure AD ID from a SP user.
556
+ * @param webUrl Web url
557
+ * @param id The Id of the user
558
+ */
559
+ getUserAzureIdBySpoId(webUrl, id) {
560
+ return __awaiter(this, void 0, void 0, function* () {
561
+ const requestOptions = {
562
+ url: `${webUrl}/_api/web/siteusers/GetById('${formatting_1.formatting.encodeQueryParameter(id)}')?$select=AadObjectId`,
563
+ headers: {
564
+ accept: 'application/json;odata=nometadata'
565
+ },
566
+ responseType: 'json'
567
+ };
568
+ const res = yield request_1.default.get(requestOptions);
569
+ return res.AadObjectId.NameId;
570
+ });
548
571
  }
549
572
  };
550
573
  //# sourceMappingURL=spo.js.map
@@ -77,7 +77,7 @@ If you don't use the manifest, you must specify the name of the Azure AD app reg
77
77
 
78
78
  You can also use the manifest to provision some of the configuration settings of your Azure AD app. All properties specified in the manifest are optional and will set if specified.
79
79
 
80
- If you specify the manifest along with some options, values specified in the options will override settings from the manifest. One exception is the name specified in the `name` option which will be overriden by the `displayName` property from the manifest if specified.
80
+ If you specify the manifest along with some options, values specified in the options will override settings from the manifest. One exception is the name specified in the `name` option which will be overridden by the `displayName` property from the manifest if specified.
81
81
 
82
82
  The following properties specified in the manifest retrieved from Azure AD are not supported by this command:
83
83
 
@@ -137,7 +137,7 @@ Create new Azure AD app registration with an auto-generated secret (secret retur
137
137
  m365 aad app add --name 'My AAD app' --withSecret
138
138
  ```
139
139
 
140
- Create new Azure AD app registration for a deamon app with specified Microsoft Graph application permissions
140
+ Create new Azure AD app registration for a daemon app with specified Microsoft Graph application permissions
141
141
 
142
142
  ```sh
143
143
  m365 aad app add --name 'My AAD app' --withSecret --apisApplication 'https://graph.microsoft.com/Group.ReadWrite.All,https://graph.microsoft.com/Directory.Read.All'
@@ -161,7 +161,7 @@ Create new Azure AD app registration with Application ID URI set to a value that
161
161
  m365 aad app add --name 'My AAD app' --uri api://caf406b91cd4.ngrok.io/_appId_ --scopeName access_as_user --scopeAdminConsentDescription 'Access as a user' --scopeAdminConsentDisplayName 'Access as a user' --scopeConsentBy adminsAndUsers
162
162
  ```
163
163
 
164
- Create new Azure AD app registration for a deamon app with specified Microsoft Graph application permissions, including admin consent
164
+ Create new Azure AD app registration for a daemon app with specified Microsoft Graph application permissions, including admin consent
165
165
 
166
166
  ```sh
167
167
  m365 aad app add --name 'My AAD app' --apisApplication 'https://graph.microsoft.com/Group.ReadWrite.All' --grantAdminConsent
@@ -20,10 +20,10 @@ m365 aad approleassignment add [options]
20
20
  : Application name of the App Registration to which the configured scopes (app roles) should be applied
21
21
 
22
22
  `-r, --resource <resource>`
23
- : Service principal name, appId or objectId that has the scopes (roles) ex. `SharePoint`.
23
+ : Service principal name, appId or objectId that has the scopes (roles) e.g. `SharePoint`.
24
24
 
25
25
  `-s, --scope <scope>`
26
- : Permissions known also as scopes and roles to grant the application with. If multiple permissions have to be granted, they have to be comma separated ex. `Sites.Read.All,Sites.ReadWrite.all`
26
+ : Permissions known also as scopes and roles to grant the application with. If multiple permissions have to be granted, they have to be comma-separated e.g. `Sites.Read.All,Sites.ReadWrite.all`
27
27
 
28
28
  --8<-- "docs/cmd/_global.md"
29
29
 
@@ -33,7 +33,7 @@ This command requires tenant administrator permissions.
33
33
 
34
34
  Specify either the `appId`, `appObjectId` or `appDisplayName` but not multiple. If you specify more than one option value, the command will fail with an error.
35
35
 
36
- Autocomplete values for the `resource` option do not mean allowed values. The autocomplete will just suggest some known names, but that doesn't restrict you to use name of your own custom application or other application within your tenant.
36
+ Autocomplete values for the `resource` option do not mean allowed values. The autocomplete will just suggest some known names, but that doesn't restrict you to use the name of your own custom application or other application within your tenant.
37
37
 
38
38
  This command can also be used to assign permissions to system or user-assigned managed identity.
39
39
 
@@ -45,13 +45,13 @@ Adds SharePoint _Sites.Read.All_ application permissions to Azure AD application
45
45
  m365 aad approleassignment add --appId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "SharePoint" --scope "Sites.Read.All"
46
46
  ```
47
47
 
48
- Adds multiple Microsoft Graph application permissions to an Azure AD application with name _MyAppName_
48
+ Adds multiple Microsoft Graph application permissions to an Azure AD application with the name _MyAppName__
49
49
 
50
50
  ```sh
51
51
  m365 aad approleassignment add --appDisplayName "MyAppName" --resource "Microsoft Graph" --scope "Mail.Read,Mail.Send"
52
52
  ```
53
53
 
54
- Adds Microsoft Graph _Mail.Read_ application permissions to a system managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
54
+ Adds Microsoft Graph _Mail.Read_ application permissions to a system-managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
55
55
 
56
56
  ```sh
57
57
  m365 aad approleassignment add --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scope "Mail.Read"
@@ -20,10 +20,10 @@ m365 aad approleassignment remove [options]
20
20
  : Application name of the App Registration for which the configured scopes (app roles) should be deleted
21
21
 
22
22
  `-r, --resource <resource>`
23
- : Service principal name, appId or objectId that has the scopes (roles) ex. `SharePoint`
23
+ : Service principal name, appId or objectId that has the scopes (roles) e.g. `SharePoint`
24
24
 
25
25
  `-s, --scope <scope>`
26
- : Permissions known also as scopes and roles to be deleted from the application. If multiple permissions have to be deleted, they have to be comma separated ex. `Sites.Read.All`,`Sites.ReadWrite.All`
26
+ : Permissions known also as scopes and roles to be deleted from the application. If multiple permissions have to be deleted, they have to be comma-separated e.g. `Sites.Read.All`,`Sites.ReadWrite.All`
27
27
 
28
28
  `--confirm`
29
29
  : Don't prompt for confirming removing the all role assignment
@@ -54,7 +54,7 @@ Deletes multiple Microsoft Graph application permissions from an Azure AD applic
54
54
  m365 aad approleassignment remove --appDisplayName "MyAppName" --resource "Microsoft Graph" --scope "Mail.Read,Mail.Send"
55
55
  ```
56
56
 
57
- Deletes Microsoft Graph _Mail.Read_ application permissions from a system managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
57
+ Deletes Microsoft Graph _Mail.Read_ application permissions from a system-managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
58
58
 
59
59
  ```sh
60
60
  m365 aad approleassignment remove --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scope "Mail.Read"
@@ -0,0 +1,87 @@
1
+ # aad license list
2
+
3
+ Lists commercial subscriptions that an organization has acquired
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad license list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Examples
16
+
17
+ List all licenses within the tenant
18
+
19
+ ```sh
20
+ m365 aad license list
21
+ ```
22
+
23
+ ## Response
24
+
25
+ === "JSON"
26
+
27
+ ```json
28
+ [
29
+ {
30
+ "capabilityStatus": "Enabled",
31
+ "consumedUnits": 1,
32
+ "id": "48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df",
33
+ "skuId": "c7df2760-2c81-4ef7-b578-5b5392b571df",
34
+ "skuPartNumber": "ENTERPRISEPREMIUM",
35
+ "appliesTo": "User",
36
+ "prepaidUnits": {
37
+ "enabled": 10000,
38
+ "suspended": 0,
39
+ "warning": 0
40
+ },
41
+ "servicePlans": [
42
+ {
43
+ "servicePlanId": "8c098270-9dd4-4350-9b30-ba4703f3b36b",
44
+ "servicePlanName": "ADALLOM_S_O365",
45
+ "provisioningStatus": "Success",
46
+ "appliesTo": "User"
47
+ }
48
+ ]
49
+ }
50
+ ]
51
+ ```
52
+
53
+ === "Text"
54
+
55
+ ```text
56
+ id skuId skuPartNumber
57
+ ------------------------------------------------------------------------- ------------------------------------ ----------------------
58
+ 48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df c7df2760-2c81-4ef7-b578-5b5392b571df ENTERPRISEPREMIUM
59
+ ```
60
+
61
+ === "CSV"
62
+
63
+ ```csv
64
+ id,skuId,skuPartNumber
65
+ 48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df,c7df2760-2c81-4ef7-b578-5b5392b571df,ENTERPRISEPREMIUM
66
+ ```
67
+
68
+ === "Markdown"
69
+
70
+ ```md
71
+ # aad license list
72
+
73
+ Date: 14/2/2023
74
+
75
+ ## 48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df
76
+
77
+ Property | Value
78
+ ---------|-------
79
+ capabilityStatus | Enabled
80
+ consumedUnits | 1
81
+ id | 48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df
82
+ skuId | c7df2760-2c81-4ef7-b578-5b5392b571df
83
+ skuPartNumber | ENTERPRISEPREMIUM
84
+ appliesTo | User
85
+ prepaidUnits | {"enabled":10000,"suspended":0,"warning":0}
86
+ servicePlans | [{"servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b","servicePlanName": "ADALLOM_S_O365","provisioningStatus": "Success","appliesTo": "User"}]
87
+ ```
@@ -0,0 +1,168 @@
1
+ # aad user add
2
+
3
+ Creates a new user
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user add [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--displayName <displayName>`
14
+ : The name to display in the address book for the user.
15
+
16
+ `--userName <userName>`
17
+ : The user principal name (someuser@contoso.com).
18
+
19
+ `--accountEnabled [accountEnabled]`
20
+ : Whether the account is enabled. Possible values: `true`, `false`. Default value is `true`.
21
+
22
+ `--mailNickname [mailNickname]`
23
+ : The mail alias for the user. By default this value will be extracted from `userName`.
24
+
25
+ `--password [password]`
26
+ : The password for the user. When not specified, a password will be generated.
27
+
28
+ `--firstName [firstName]`
29
+ : The given name (first name) of the user. Maximum length is 64 characters.
30
+
31
+ `--lastName [lastName]`
32
+ : The user's surname (family name or last name). Maximum length is 64 characters.
33
+
34
+ `--forceChangePasswordNextSignIn`
35
+ : Whether the user should change his/her password on the next login.
36
+
37
+ `--forceChangePasswordNextSignInWithMfa`
38
+ : Whether the user should change his/her password on the next login and setup MFA.
39
+
40
+ `--usageLocation [usageLocation]`
41
+ : A two letter [country code](https://learn.microsoft.com/en-us/partner-center/commercial-marketplace-co-sell-location-codes#country-and-region-codes) (ISO standard 3166). Required for users that will be assigned licenses.
42
+
43
+ `--officeLocation [officeLocation]`
44
+ : The office location in the user's place of business.
45
+
46
+ `--jobTitle [jobTitle]`
47
+ : The user's job title. Maximum length is 128 characters.
48
+
49
+ `--companyName [companyName]`
50
+ : The company name which the user is associated. The maximum length is 64 characters.
51
+
52
+ `--department [department]`
53
+ : The name for the department in which the user works. Maximum length is 64 characters.
54
+
55
+ `--preferredLanguage [preferredLanguage]`
56
+ : The preferred language for the user. Should follow [ISO 639-1 Code](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a). Example: `en-US`.
57
+
58
+ `--managerUserId [managerUserId]`
59
+ : User ID of the user's manager. Specify `managerUserId` or `managerUserName` but not both.
60
+
61
+ `--managerUserName [managerUserName]`
62
+ : User principal name of the manager. Specify `managerUserId` or `managerUserName` but not both.
63
+
64
+ --8<-- "docs/cmd/_global.md"
65
+
66
+ ## Remarks
67
+
68
+ !!! important
69
+ To use this command you must be a Global administrator, User administrator or Privileged Authentication administrator
70
+
71
+ !!! note
72
+ After running this command, it may take a minute before the user is effectively created in the tenant.
73
+
74
+ ## Examples
75
+
76
+ Create a user and let him/her update the password at first login
77
+
78
+ ```sh
79
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --forceChangePasswordNextSignIn
80
+ ```
81
+
82
+ Create a user with job information
83
+
84
+ ```sh
85
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation Vosselaar --forceChangePasswordNextSignIn
86
+ ```
87
+
88
+ Create a user with language information
89
+
90
+ ```sh
91
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --preferredLanguage "nl-BE" --usageLocation BE --forceChangePasswordNextSignIn
92
+ ```
93
+
94
+ Create a user with a manager
95
+
96
+ ```sh
97
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --managerUserName "adele@contoso.com"
98
+ ```
99
+
100
+ ## Response
101
+
102
+ === "JSON"
103
+
104
+ ```json
105
+ {
106
+ "id": "990e2425-f595-43bc-85ed-b89a44093793",
107
+ "businessPhones": [],
108
+ "displayName": "John Doe",
109
+ "givenName": "John",
110
+ "jobTitle": "Sales Manager",
111
+ "mail": null,
112
+ "mobilePhone": null,
113
+ "officeLocation": "Vosselaar",
114
+ "preferredLanguage": "nl-BE",
115
+ "surname": "Doe",
116
+ "userPrincipalName": "john.doe@contoso.com",
117
+ "password": "SomePassw0rd"
118
+ }
119
+ ```
120
+
121
+ === "Text"
122
+
123
+ ```text
124
+ businessPhones : []
125
+ displayName : John Doe
126
+ givenName : John
127
+ id : 990e2425-f595-43bc-85ed-b89a44093793
128
+ jobTitle : Sales Manager
129
+ mail : null
130
+ mobilePhone : null
131
+ officeLocation : Vosselaar
132
+ password : SomePassw0rd
133
+ preferredLanguage: nl-BE
134
+ surname : Doe
135
+ userPrincipalName: john.doe@contoso.com
136
+ ```
137
+
138
+ === "CSV"
139
+
140
+ ```csv
141
+ id,businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,password
142
+ 990e2425-f595-43bc-85ed-b89a44093793,[],John Doe,John,Sales Manager,,,Vosselaar,nl-BE,Doe,john.doe@contoso.com,SomePassw0rd
143
+ ```
144
+
145
+ === "Markdown"
146
+
147
+ ```md
148
+ # aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --firstName "John" --lastName "Doe" --jobTitle "Sales Manager" --officeLocation "Vosselaar" --preferredLanguage "nl-BE"
149
+
150
+ Date: 16/02/2023
151
+
152
+ ## John Doe (990e2425-f595-43bc-85ed-b89a44093793)
153
+
154
+ Property | Value
155
+ ---------|-------
156
+ id | 990e2425-f595-43bc-85ed-b89a44093793
157
+ businessPhones | []
158
+ displayName | John Doe
159
+ givenName | John
160
+ jobTitle | Sales Manager
161
+ mail | null
162
+ mobilePhone | null
163
+ officeLocation | Vosselaar
164
+ preferredLanguage | nl-BE
165
+ surname | Doe
166
+ userPrincipalName | john.doe@contoso.com
167
+ password | SomePassw0rd
168
+ ```
@@ -0,0 +1,108 @@
1
+ # aad user license add
2
+
3
+ Assigns a license to a user
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user license add [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--userId [userId]`
14
+ : The ID of the user. Specify either `userId` or `userName` but not both.
15
+
16
+ `--userName [userName]`
17
+ : User principal name of the user. Specify either `userId` or `userName` but not both.
18
+
19
+ `--ids <ids>`
20
+ : A comma separated list of IDs that specify the licenses to add.
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ !!! important
27
+ The user must have a `usageLocation` value in order to assign a license to it.
28
+
29
+ ## Examples
30
+
31
+ Assign specific licenses to a specific user by UPN
32
+
33
+ ```sh
34
+ m365 user license add --userName "john.doe@contoso.com" --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f"
35
+ ```
36
+
37
+ Assign specific licenses from a specific user by ID
38
+
39
+ ```sh
40
+ m365 user license add --userId "5c241023-2ba5-4ea8-a516-a2481a3e6c51" --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f"
41
+ ```
42
+
43
+ ## Response
44
+
45
+ === "JSON"
46
+
47
+ ```json
48
+ {
49
+ "businessPhones": [],
50
+ "displayName": "John Doe",
51
+ "givenName": null,
52
+ "jobTitle": null,
53
+ "mail": "John@contoso.onmicrosoft.com",
54
+ "mobilePhone": null,
55
+ "officeLocation": null,
56
+ "preferredLanguage": null,
57
+ "surname": null,
58
+ "userPrincipalName": "John@contoso.onmicrosoft.com",
59
+ "id": "eb77fbcf-6fe8-458b-985d-1747284793bc"
60
+ }
61
+ ```
62
+
63
+ === "Text"
64
+
65
+ ```text
66
+ businessPhones : []
67
+ displayName : John Doe
68
+ givenName : null
69
+ id : eb77fbcf-6fe8-458b-985d-1747284793bc
70
+ jobTitle : null
71
+ mail : John@contoso.onmicrosoft.com
72
+ mobilePhone : null
73
+ officeLocation : null
74
+ preferredLanguage: null
75
+ surname : null
76
+ userPrincipalName: John@contoso.onmicrosoft.com
77
+ ```
78
+
79
+ === "CSV"
80
+
81
+ ```csv
82
+ businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,id
83
+ [],John Doe,,,John@contoso.onmicrosoft.com,,,,,John@contoso.onmicrosoft.com,eb77fbcf-6fe8-458b-985d-1747284793bc
84
+ ```
85
+
86
+ === "Markdown"
87
+
88
+ ```md
89
+ # aad user license add --userName "John@contoso.onmicrosoft.com" --ids "f30db892-07e9-47e9-837c-80727f46fd3d,606b54a9-78d8-4298-ad8b-df6ef4481c80"
90
+
91
+ Date: 16/2/2023
92
+
93
+ ## John Doe (eb77fbcf-6fe8-458b-985d-1747284793bc)
94
+
95
+ Property | Value
96
+ ---------|-------
97
+ businessPhones | []
98
+ displayName | John Doe
99
+ givenName | null
100
+ jobTitle | null
101
+ mail | John@contoso.onmicrosoft.com
102
+ mobilePhone | null
103
+ officeLocation | null
104
+ preferredLanguage | null
105
+ surname | null
106
+ userPrincipalName | John@contoso.onmicrosoft.com
107
+ id | eb77fbcf-6fe8-458b-985d-1747284793bc
108
+ ```