Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update-VSTeamUser may not be able to validate a user per email when user count is greater than 100 #90

Closed
GPugnet opened this issue Sep 11, 2018 · 4 comments

Comments

@GPugnet
Copy link
Contributor

GPugnet commented Sep 11, 2018

Update-VSTeamUser validates that the user submitted by email exists using the following code :

$user = Get-VSTeamUser | Where-Object email -eq $email

As Get-VSTeamUser only returns the top 100 users, the user to be validated may not be found.

@DarqueWarrior
Copy link
Collaborator

Looking into this. Thanks.

@DarqueWarrior
Copy link
Collaborator

The best we can do if the user wants to use email is pass in the max top of 10,000. However, this feels very inefficient. If you have that many users you would be better off finding the ID using Get-VSTeamUser yourself first. Then calling Update-VSTeamUser by ID instead of by Email. The filter only lets you filter by extensionId today which does not help in this situation. If at some point they add user.principalName or user.mailAddress we can update this code.

For now, I will pass in the Max Top of 10,000. I will also update the help to explain the costs.

DarqueWarrior added a commit that referenced this issue Sep 16, 2018
Set top to 10,000 when searching by email
Updated help for Update-VSTeamUser
Fixed issue where api version was not being set on load.
@DarqueWarrior
Copy link
Collaborator

Fixed in PR 96

DarqueWarrior added a commit that referenced this issue Sep 16, 2018
Set top to 10,000 when searching by email
Updated help for Update-VSTeamUser
Fixed issue where api version was not being set on load.
@GPugnet
Copy link
Contributor Author

GPugnet commented Sep 17, 2018

Great :)
For now the larger Azure DevOps ( :D ) account I use are several hundreds of accounts.
I agree that on larger account, it would be more efficient to first find the user, then call update by id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants