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

Get-Slackuser only getting first 1000 users. Results are paged, can we get all pages please? #88

Open
robl95405 opened this issue May 31, 2019 · 10 comments · May be fixed by #91
Open

Get-Slackuser only getting first 1000 users. Results are paged, can we get all pages please? #88

robl95405 opened this issue May 31, 2019 · 10 comments · May be fixed by #91

Comments

@robl95405
Copy link

Calling Get-Slackuser is only returning the first page of users. Would it be possible for you to do the paging in this routine and return the final, complete set? Please, please? :)

@RamblingCookieMonster
Copy link
Owner

I don't know who wrote this silliness, but they didn't plan very well. Ideally, Send-SlackApi should handle paging, instead of nonsense like including it in individual functions. Although, looking at it, seems like it's context specific (See $PageDirection fun.

Totally open to a pull request that supports this! I have no use for it at $work or $home, so probably won't pop up on my todo list, unfortunately.

Even if there's a better way, feel free to borrow from the code linked above to just get something working, I'm not too picky.

Cheers!

@robl95405
Copy link
Author

Agreed and thanks! I have the paging wrappers in my perl scripts. I've asked Keith for help in generating a pull request, not sure my powershell abilities are up to production standards. :)

@kilasuit
Copy link

This impacts this issue in PoshBot poshbotio/PoshBot#184

@kilasuit
Copy link

details on the API is at https://api.slack.com/methods/users.list

@devblackops
Copy link
Contributor

Short of adding global paging support, this could probably be implemented similarly to #90

@RamblingCookieMonster
Copy link
Owner

Yeah, that would help as a short-term solution. The PR linked above would help long-term (some sort of global pagination) - #91

Cheers!

@lia-cha-avalara
Copy link

@RamblingCookieMonster - is this going to be merged soon? we have a weird setup in our environment where slack users names don't always match their AD samaccountname value. When we try to use this module to send users messages via slack, it errors out for those users with non-matching slack usernames and AD samaccountname.

I tried using the get-slackuser function to return a list of usernames so that i can use that to compare against the AD name but im not able to retrieve all usernames that start with "za*". I'm thinking it's because of the pagination thing.

@RamblingCookieMonster
Copy link
Owner

Which! #91 is a WIP I think, @rkeithhill might know more about the current state.

If you want to implement a quick bandaid, we could get that in as well (like Brandon mentioned, #90 seems similar and may help)

Cheers!

@lia-cha-avalara
Copy link

ahh yeah i'll wait for #91. For now I'm manually hardcoding one off issues in my script.

@Jaykul
Copy link

Jaykul commented Apr 24, 2021

Ping!

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

Successfully merging a pull request may close this issue.

6 participants