it would be nice to log which devices is not configured. You can do it in foreach above.