Powershell wait for AD object to be created

while (!(Get-ADgroup -Filter { Name -like "the_AD_object"}))
{
write-host wait
    start-sleep -m 1000
} 

Leave a Reply

Your email address will not be published. Required fields are marked *