"I know it's a great sacrifice for you to be away from your families, but I want you to know that every American family is eternally grateful to you, and we're holding you close in our hearts, thoughts and prayers," Trump said. "We love what you do and love your work. Amazing people."
Trump spoke by video conference to members of all five branches of the U.S. military.
The president was spending a rare Christmas in Washington because of a stalemate with Congress that left several government departments and agencies shuttered since the weekend, affecting the livelihoods of some 800,000 federal employees.
Trump usually spends Christmas at his Florida estate. He scrapped plans to travel to Palm Beach because of the shutdown.
"I thought it would be wrong for me to be with my family," he told reporters in the Oval Office after the give and take with members of the Army, Navy, Air Force, Marines and Coast Guard from their stations in Guam, Bahrain, Qatar and Alaska.
"My family is in Florida, Palm Beach, and I just didn't want to go down and be there when other people are hurting," Trump said. He didn't say which family members were at the Mar-a-Lago estate.
They answered telephone calls from children who were wanted to know where Santa was on his gift-giving journey, with the president at one point asking a 7-year-old named Coleman, "Are you still a believer in Santa?" Trump listened for a moment before adding, "Because at 7, it's marginal, right?"
Reporters in the room could only hear Trump's end of the conversation during the NORAD Tracks Santa program. The program became a Christmas Eve tradition after a child mistakenly called the forerunner to the North American Aerospace Defense Command in 1955 and asked to speak to Santa.
It was not affected by the shutdown because it's staffed by volunteers at Peterson Air Force Base in Colorado using pre-approved funding.
The Trumps later attended religious services at Washington National Cathedral. He and the first lady usually attend Christmas Eve services at the Episcopal church in Palm Beach where they were married in 2005.
Follow Darlene Superville on Twitter: http://www.twitter.com/dsupervilleap