thread-like worm found in poop

Hello,
I just found a 1.5 inch long, very thin, white worm in the poop of one of my chickens. Fortunately for me, I found it because it landed on my shoulder.
I'm not sure if it's an ascarid or a Capillaria, regardless, I want to treat my flock.
Can anybody give me advice on what medication to use and where to find it? I'm in a remote location (upstate NY) so I might have to order on-line...
Thanks in advance for you help!