powershell - Call Get-ADComputer in a loop until the object is found -
i want call get-adcomputer powershell in loop until computer object created in active directory.
i'm using following code. script won't loop. how can write code loops correctly?
{(write-host "." -nonewline -foregroundcolor red),(sleep 3)} until(get-adcomputer -name computername) i can't figure out what's missing. hope guys can me out.
use -filter parameter, name parameter terminating error in case computer in question cannot found.
do { write-host "." -nonewline -foregroundcolor red sleep 3 } until(get-adcomputer -filter {name -eq 'computername'})
Comments
Post a Comment