-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All entra m365group commands should accept displayName option
- Loading branch information
Showing
3 changed files
with
6 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,16 @@ m365 entra m365group user remove [options] | |
|
||
```md definition-list | ||
`-i, --groupId [groupId]` | ||
: The ID of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupDisplayName`, `teamId`, or `teamName`. | ||
: The ID of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`. | ||
|
||
`--groupDisplayName [groupDisplayName]` | ||
: The display name of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupDisplayName`, `teamId`, or `teamName`. | ||
`--groupName [groupName]` | ||
: The display name of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`. | ||
|
||
`--teamId [teamId]` | ||
: The ID of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupDisplayName`, `teamId`, or `teamName`. | ||
: The ID of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`. | ||
|
||
`--teamName [teamName]` | ||
: The display name of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupDisplayName`, `teamId`, or `teamName`. | ||
: The display name of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`. | ||
|
||
`-n, --userName [userName]` | ||
: (deprecated) User's UPN (user principal name), eg. `[email protected]`.. Specify only one of the following: `userName`, `ids` or `userNames`. | ||
|
@@ -67,7 +67,7 @@ m365 entra m365group user remove --teamName 'Project Team' --userNames 'anne.mat | |
Removes users specified by a comma separated list of user ids from the specified Microsoft 365 group specified by name. | ||
|
||
```sh | ||
m365 entra m365group user remove --groupDisplayName 'Project Team' --ids '5b8e4cb1-ea40-484b-a94e-02a4313fefb4,be7a56d8-b045-4938-af35-917ab6e5309f' | ||
m365 entra m365group user remove --groupName 'Project Team' --ids '5b8e4cb1-ea40-484b-a94e-02a4313fefb4,be7a56d8-b045-4938-af35-917ab6e5309f' | ||
``` | ||
|
||
## Response | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,55 +218,6 @@ describe(commands.M365GROUP_USER_REMOVE, () => { | |
assert(memberDeleteCallIssued); | ||
}); | ||
|
||
it('removes the specified owner from owners and members endpoint of the Microsoft 365 Group specified by groupName with accepted prompt', async () => { | ||
let memberDeleteCallIssued = false; | ||
|
||
sinon.stub(request, 'get').callsFake(async (opts) => { | ||
if (opts.url === `https://graph.microsoft.com/v1.0/users/anne.matthews%40contoso.onmicrosoft.com/id`) { | ||
return { | ||
"value": "00000000-0000-0000-0000-000000000001" | ||
}; | ||
} | ||
|
||
if (opts.url === `https://graph.microsoft.com/v1.0/groups/00000000-0000-0000-0000-000000000000/id`) { | ||
return { | ||
response: { | ||
status: 200, | ||
data: { | ||
value: "00000000-0000-0000-0000-000000000000" | ||
} | ||
} | ||
}; | ||
} | ||
|
||
throw 'Invalid request'; | ||
}); | ||
|
||
sinon.stub(request, 'delete').callsFake(async (opts) => { | ||
memberDeleteCallIssued = true; | ||
|
||
if (opts.url === `https://graph.microsoft.com/v1.0/groups/00000000-0000-0000-0000-000000000000/owners/00000000-0000-0000-0000-000000000001/$ref`) { | ||
return { | ||
"value": [{ "id": "00000000-0000-0000-0000-000000000000" }] | ||
}; | ||
} | ||
|
||
if (opts.url === `https://graph.microsoft.com/v1.0/groups/00000000-0000-0000-0000-000000000000/members/00000000-0000-0000-0000-000000000001/$ref`) { | ||
return { | ||
"value": [{ "id": "00000000-0000-0000-0000-000000000000" }] | ||
}; | ||
} | ||
|
||
throw 'Invalid request'; | ||
}); | ||
|
||
sinonUtil.restore(cli.promptForConfirmation); | ||
sinon.stub(cli, 'promptForConfirmation').resolves(true); | ||
|
||
await command.action(logger, { options: { groupName: "Finance", userName: "[email protected]" } }); | ||
assert(memberDeleteCallIssued); | ||
}); | ||
|
||
it('removes the specified owner from owners and members endpoint of the specified Microsoft 365 Group when prompt confirmed', async () => { | ||
let memberDeleteCallIssued = false; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters