I need you help... i am writing a powershell script which will add a computer to a domain. i have done this using the add-computer but my main problem is that i want to check if the join was done successful or not. If was not successful i want to try again until the action done. this is the script:
$j = add-computer -domainname mydomain -credential mydomain\
While ( $j -ne 0){
$j = add-computer -domainname mydomain -credential mydomain\
}
If the join done or not done the script is running and it never ends.
I tried to do it with the DO... Until:
do {
$j = add-computer -domainname mydomain -credential mydomain\ }
until ($j -eq o)
but i had the same problem...
Can you help me please?