I need to get the OS version and Revision number using PowerShell on a list of remote systems.

I need the results that you get from [environment]::OSVersion.Version but on the remote systems.

when I run [environment]::OSVersion.Version 

it returns

Major Minor Build Revision

6 1 7601 65536 

the ultimate goal would be for it to look like this (where system name is the remote system I am querying.)

SystemName 6.1.7601.65536 

my current code:

```
$expectedVersion = "6.1.7601.65536"
$computer = Get-content "C:\temp\servers.txt"
foreach ($computer in $computer)
{
$a=[environment]::OSVersion.Version 
If ($a -lt $expectedVersion)
{
  Write-Host "$computer $a is NOT Patched" -ForegroundColor Red
}
Else
{
  Write-Host "$computer $a is Patched" -ForegroundColor Green
}}

```

which give me the following results:

System-01 6.1.7601.65536 is Patched

System-02 6.1.7601.65536 is Patched

System-41 6.1.7601.65536 is Patched

System-42 6.1.7601.65536 is Patched

the issue I am having is that the resulting OS version is only of the local system and not the remote systems.

I know this because it is being run from a Win 7 box against a long list of Server and only server OS which are different OS version numbers then what is showing up in the results.

what am I missing here. can you all help me tweak this to make it work against remote systems?

thanks
['https://Stackoverflow.com/questions/46006705', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1232402/']
(1) When you make a change to checkbox you need to check all checkboxes and update to textarea.

(2) function `updateAllChecked` will handle all the check and update.

(3) for check all, if it is checked, set all email checkboxes to checked and call `.change()` to trigger the change event.

```js
$("input[name=email]").change(function() {
  updateAllChecked();
});

$("input[name=addall]").change(function() {
  if (this.checked) {
    $("input[name=email]").prop('checked', true).change();
  } else {
    $("input[name=email]").prop('checked', false).change();
  }
});

function updateAllChecked() {
  $('#recipients').text('');
  $("input[name=email]").each(function() {
    if (this.checked) {
      let old_text = $('#recipients').text() ? $('#recipients').text() + ', ' : '';
      $('#recipients').text(old_text + $(this).val());
    }
  })
}
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<input type="checkbox" name="email" value="email_1">email_1<br>
<input type="checkbox" name="email" value="email_2">email_2<br>
<input type="checkbox" name="email" value="email_3">email_3<br>
<input type="checkbox" name="email" value="email_4">email_4<br>
<br>
<input type="checkbox" name="addall">Add All Email<br>

<textarea id="recipients"></textarea>
```
Hi guys here is my html and php, I retrieve recipients email from db:

```
here is my html with php, I retrieve recipients email from db.:           <?php 
      $i='';
      if($result_applied_jobs): ?>
         <div class="tg-wrap">
             <table id="tg-s6tTH" class="tg" style="width: 100%;">
                <tr><th style="width: 12%"><label><input type="checkbox" name="addall" id="addall"/>&nbsp;Select all</label></th><th style="width: 7%">Sl. No.</th><th style="width: 20%">Applicant's Name</th><th style="width: 25%">Job Title</th><th style="width: 13%">Apply Date</th><th>Cover Letter</th></tr><?php
            foreach($result_applied_jobs as $row_applied_job):
        $i++;
        ?> 
       <tr>
            <td><input type="checkbox" value="<?php echo $row_applied_job->email;?>" name="email" id="email"></td>
            <td><?php echo $i;?></td>
            <td><a href="<?php echo base_url('candidate/'.$this->custom_encryption->encrypt_data($row_applied_job->job_seeker_ID));?>"><?php echo $row_applied_job->first_name.' '.$row_applied_job->last_name;?></a></td>
            <td><a href="<?php echo base_url('jobs/'.$row_applied_job->job_slug);?>"><?php echo $row_applied_job->job_title;?></a></td>
            <td><i class="fa fa-calendar-check-o" aria-hidden="true" style="color: #5f6f81"></i>&nbsp;<?php echo date_formats($row_applied_job->applied_date, 'M d, Y');?></td>
            <td><?php echo $row_applied_job->c_letter;?></td>
        </tr>
      <?php     endforeach; ?>
            </table>
            </div><?php
            else:?>
                <div class="alert alert-danger"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i>&nbsp;No application received</div>
      <?php endif;?>

```

here is another portion for textarea:

```
<textarea class="form-control" id="recipientss" readonly="" placeholder="check the checkbox against applicants you want to send a message"><?php echo set_value('recipients');?></textarea>

```