How do you create a dynamic device group in Intune with membership based on the existence of a file? Within the add new group feature, I don't see a way to specify a file name, nor a way to utilize a script upon which to base the membership. Is it even possible? Thanks in advance.
It is not possible. Dynamic groups can be based only on attributes which exist in Azure AD. Obviously, Azure AD does not hold the list of files for every device.
Depending on your needs, you might consider using Proactive remediations feature.
Detection script could check existence of the file.
Remediation script would do necessary actions an a device.