Greetings Folks,
I was hoping the community could help out this. I created a script that runs in a do loop with try and catch. You input the server name, it checks to see if the object exists and if it doesn't, it will prompt you to enter the object name again. My issue is that the script keeps running in a loop even when the server name is correct. I'm not sure how to fix this. I suspect that the line that is bolded below is the problem.
do{
$servername
=read-host"Please
enter Linux Server name"
try{
$remove=Get-ADObject"CN=syssec-$servername,OU=servers,OU=NISNetgroups,OU=Applications,DC=edj,DC=devjones,DC=com"
}
catch{Write-Host"Syssec
Object not found"}
}
until($remove-eq"$remove")
Remove-ADObject$remove
Thanks for the help in advance.
Mik