Function Remove-Computer ($ComputerName,$DRAServer,[switch]$Recyclebin) 
    {
           
        If ($Recycle) {Write-Host "Recycle parameter was used"}
           
        $ComputerName = $ComputerName.split(",")
        If ($DRAServer -eq "" -or $DRAServer -eq $null) {$DRAServer = "lackland.dra.us.af.mil"}
        $CN = "cn="
        $OU = ",OU=McGuire AFB Computers,OU=McGuire AFB,OU=AFCONUSWEST,OU=Bases,DC=AREA52,DC=AFNOAPPS,DC=USAF,DC=MIL"
        $Recycle = ",OU=NetIQRecycleBin,DC=AREA52,DC=AFNOAPPS,DC=USAF,DC=MIL"
        $count = $ComputerName.count
        $i = 1
    
        ForEach ($Item in $ComputerName)
            {
                $Percentage = ($i / $count) * 100
                Show-ProgressBar -Activity "Deleting computers" -PercentComplete $Percentage
                <# Delete Computer out of DRA #>
                $ID = $CN+$Item+$OU   
                 Try {
                         Write-Host "Deleting $ID" -ForegroundColor Green
                            Remove-DRAComputer -ErrorAction Stop `
                        -Domain $env:USERDNSDOMAIN `
                        –DRARestServer $DRAServer `
                        -DRARestPort 8755 `
                        –DRAHostServer $DRAServer `
                        –DRAHostPort 11192 `
                        -Identifier $ID `
                        -Force;
                    
                
   
                        <# Delete Computer from Recycle Bin #>
                        If ($Recycle)
                            {
                                
                                $ID = $CN + $Item + $Recycle
                                Write-Host "Removing $ID in the recycling Bin" -ForegroundColor Cyan
                                    Remove-DRAComputer `
                                -Domain $env:USERDNSDOMAIN `
                                –DRARestServer $DRAServer `
                                -DRARestPort 8755 `
                                –DRAHostServer $DRAServer `
                                –DRAHostPort 11192 `
                                -Identifier $ID `
                                -Force;
                            }
                        }
                   Catch
                    {
                        Write-Host "Comptuer $Item does not exists in $Recycle!"
                    }
                $i++
            }
 
    }