Question : How can the AD objects deletion reflect in WSUS console immediately.

Hi,

How can the AD objects deletion reflect in WSUS console immediately.
Is there a way to get the changes reflected immediately like force the replication?

Regards
Sharath

Answer : How can the AD objects deletion reflect in WSUS console immediately.


Ah sorry, missing a closing ".

Chris
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
$DomainControllers = "in1"

$Computers = @{}
$DomainControllers | ForEach-Object {
  Get-QADComputer -SearchRoot "Developmuk/Countries/ID/Chi/Virines" -Service $_ -SizeLimit 0 -IncludedProperties LastLogon | `
    Select-Object Name, DN, LastLogon | ForEach-Object { 
      If ($Computers.$($_.DN)) {
        $Computers.$($_.DN) = $_ | Select-Object Name, DN, `
          @{n='LastLogon';e={ 
            If ($_.LastLogon -gt $Computers.$($_.DN).LastLogon) { 
              $_.LastLogon 
            } Else { 
              $Computers.$($_.DN).LastLogon 
            } }}
      } Else {
        $Computers.Add($_.DN, $_)
      }
    }
}

$Computers.Values | ForEach-Object {
  $LastLogon = (New-TimeSpan $_.LastLogon).Days

  If (Test-Connection $_.Name -Quiet -Count 1) {
    $LastBootUpTime = (Get-WmiObject Win32_OperatingSystem -Computer $_.Name).LastBootUpTime
    If ($LastBootUpTime -ne $Null) {
      $LastBootUpTime = [Management.ManagementDateTimeConverter]::ToDateTime($LastBootUpTime)

      $Online = [Math]::Round((New-TimeSpan $LastBootUpTime).TotalHours, 2)
    }
  } Else {
    $Online = 0
  }

  $_ | Select-Object Name, @{n='LastLogon';e={ $LastLogon }},  @{n='Online';e={ $Online }}
} | Export-Csv "report.csv"
Random Solutions  
 
programming4us programming4us