treestryder / powershell_module_workdayapi

DEPRICATED Powershell script module for working with the Workday API, using raw XML.
51 stars 23 forks source link

Get-WorkdayWorker returns varying numbers of workers #1

Open sup3rmark opened 6 years ago

sup3rmark commented 6 years ago

This seems to pull random assortments of workers every time I run the command. I should have about 30k records in Workday, but running Get-WorkdayWorker returned 5900 (exactly) on the first run, then 401, 5001, 801, 101, and 1301 on subsequent runs.

treestryder commented 6 years ago

Interesting. First, because I had no idea that anyone else was using this module. And second, because I am using that command several places in production and have not seen this behavior.

I just tested, it consistently returned 3466 active workers and 8786 using -Force to return all workers.

You could use -Verbose to see each HTTP post and response for each "page" of workers, which should be a consistent number.

Try this, to see if Workday might be struggling to count all 30k of your workers. I'll check in on you next week...

$request = [xml]@'
<bsvc:Get_Workers_Request xmlns:bsvc="urn:com.workday/bsvc">
    <bsvc:Request_Criteria>
    <bsvc:Exclude_Inactive_Workers>false</bsvc:Exclude_Inactive_Workers>
    </bsvc:Request_Criteria>
    <bsvc:Response_Filter>
    <bsvc:Page>1</bsvc:Page>
    </bsvc:Response_Filter>
    <bsvc:Response_Group>
    <bsvc:Include_Reference>true</bsvc:Include_Reference>
    <bsvc:Include_Personal_Information>false</bsvc:Include_Personal_Information>
    <bsvc:Include_Employment_Information>false</bsvc:Include_Employment_Information>
    <bsvc:Include_Compensation>false</bsvc:Include_Compensation>
    <bsvc:Include_Organizations>false</bsvc:Include_Organizations>
    <bsvc:Include_Roles>false</bsvc:Include_Roles>
    <bsvc:Include_Worker_Documents>false</bsvc:Include_Worker_Documents>
    </bsvc:Response_Group>
</bsvc:Get_Workers_Request>
'@
$response = Invoke-WorkdayRequest -Request $request -Uri (Get-WorkdayEndpoint Human_Resources)
$response.Xml.Get_Workers_Response.Response_Results

Total_Results Total_Pages Page_Results Page
------------- ----------- ------------ ----
8786          88          100          1   
sup3rmark commented 6 years ago

Thanks for the info! I've been using this module for a couple months now and it's been great (now at my second full-time gig where I'm using it), so thanks for the work you've done on it! I'll give those flags a try tomorrow and see if I have any better luck (or at least more detailed information).

On Thu, Feb 15, 2018 at 5:45 PM, treestryder notifications@github.com wrote:

Interesting. First, because I had no idea that anyone else was using this module. And second, because I am using that command several places in production and have not seen this behavior.

I just tested, it consistently returned 3466 active workers and 8786 using -Force to return all workers.

You could use -Verbose to see each HTTP post and response for each "page" of workers, which should be a consistent number.

Try this, to see if Workday might not be struggling to count all 30k of your workers. I'll check in on you next week...

$request = [xml]@'

false 1 true false false false false false false '@ $response = Invoke-WorkdayRequest -Request $request -Uri (Get-WorkdayEndpoint Human_Resources) $response.Xml.Get_Workers_Response.Response_Results Total_Results Total_Pages Page_Results Page ------------- ----------- ------------ ---- 8786 88 100 1 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .
PHactotum commented 6 years ago

Just so you know, I too am using this module. It has helped us to automate many aspects of our migration to WorkDay and the integration with ActiveDirectory. Thank you for putting this out there.

W. Perry Harris Global Active Directory

treestryder commented 6 years ago

As long as everyone understands that there are no guarantees. It is entirely possible that this module could cause baldness, could warp time and space, could kill your puppy or, could do nothing at all. I’ve shared what I am using, as a starting point for a community developed solution.

sup3rmark commented 6 years ago

That definitely explains where all my hair went, then!

On Wed, Feb 21, 2018 at 11:04 AM, treestryder notifications@github.com wrote:

As long as everyone understands that there are no guarantees. It is entirely possible that this module could cause baldness, could warp time and space, could kill your puppy or, could do nothing at all. I’ve shared what I am using, as a starting point for a community developed solution.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/treestryder/powershell_module_workdayapi/issues/1#issuecomment-367375927, or mute the thread https://github.com/notifications/unsubscribe-auth/AQDL73Q7-7d4gy-Lg4o8X8XXxuP_ouCIks5tXD6CgaJpZM4SHekc .

treestryder commented 6 years ago

@sup3rmark Were you able to determine if it is the script or Workday causing the inconsistent results?