we have azure vm's in an autoscale group and need to ensure VM's added or removed from the given OU are automatically updating a security group
let's assume for our case we have
ou=WVD,dc=MyDomain,dc=com
security group called WVD_Hosts
is there a good script that can query whatever computer objects reside in this OU (excluding any sub ou's) and ensure those objects are added to the WVD_hosts security group?
additionally as autoscale removes any objects, the script needs to also remove them from the security group