WSUS 3 Developer’s Blog – automated reporting tips and tricks – trending data for approved updates


In my last entry on new powershell API samples, I mentioned providing some tips and tricks for automated reporting from your WSUS server in conjunction with Excel. 


This will help walk you through creating a trending report for various interesting aspects of your deployment, and displaying it graphically in Excel.  There will be some “solution left as an exercise for the reader” aspects, but I’ll point you in the right direction through the pitfalls that I found tricky.  See the attachment to this post for a sample chart.


Sample computer report


First, a quick reminder on the location of the script repository for our PowerShell API samples: ttp://www.microsoft.com/technet/scriptcenter/scripts/sus/server/default.mspx?mfr=true.  We don’t intend these to necessarily be wonderful examples of the best use of PowerShell, but more of a handy way to introduce you to the API and give a headstart on creating your own solutions.


One of the most common requests we’ve had is around reporting information only for approved updates.  That lead to a sample for server status for just approved updates: http://www.microsoft.com/technet/scriptcenter/scripts/sus/server/susvms02.mspx


As you’ll see in the sample output, it has a simple one line CSV style output which is perfect for importing into your favorite tools.  It also includes both the server name and date, so you can easily order or filter the results. 


Naturally you’ll need to start by installing PowerShell, and saving the script to a .ps1 file.  I recommend starting this sample running on your server – you can modify the sample to connect to a remote server via a console only install, but I’d suggest limiting the number of moving pieces until you get it all working end-to-end once.  Make sure you can run the .ps1 file from the command line.  You may need to modify your script execution environment options.  (That’s one of those exercises for the reader.)


Next, create a scheduled task to run your script every night and append the output to a file.   Below is a sample command line in the Scheduled Tasks.  Make sure to try the command line from a cmd prompt to make sure you have your paths and access right – it’s annoying to wait a couple of days for the scheduled task to run and discover you botched the command line.



%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -command C:\WsusScript\ServerStatusForApprovedUpdates.ps1 >> C:\ReportingData\ServerStatusForApprovedUpdates.csv


Now wait a couple of days, and you should start getting some nice output.  Here’s some sample data to give you a headstart:



WSUSSAMPLE,3/15/2007,3713,952,1540,1032,14,0,42,28
WSUSSAMPLE,3/17/2007,8611,900,2660,814,112,0,279,118
WSUSSAMPLE,3/18/2007,8744,900,6665,813,112,0,307,119
WSUSSAMPLE,3/19/2007,8895,900,4026,833,117,0,311,117
WSUSSAMPLE,3/20/2007,9684,900,6740,958,146,0,330,136
WSUSSAMPLE,3/21/2007,10132,891,6641,2471,168,0,398,159
WSUSSAMPLE,3/22/2007,10454,891,7249,2378,172,0,444,161
WSUSSAMPLE,3/23/2007,10729,891,7531,2404,184,0,445,176


Once you’ve got that in a .CSV file, start Office Excel 2007.  Sorry if you’re on an older version – that’s the version I’m working on.  I suspect you can get all of this done on an older version, but I haven’t gone back to verify.


Look across the menu options across the top, and choose the Data tab.  The third option of “Get External Data” is “From Text.”  This will give you a browser where you point to the .csv file you’re writing via the scheduled task.  Excel should recognize the file and set the right defaults for almost everything.  The fancy bits come after you click finish.  You’ll want to do 2 things before finishing.



  1. Excel asks where you want to insert the data – choose a spot down about 20 rows, so you can leave spot for a graph at the top.

  2. Click Properties.  Here you uncheckPrompt for file name on refresh“, checkRefresh data when opening the file“, and “Overwrite existing cells with new data, clear unused cells.” 

Now, every time you open the Excel file you’ll get the very latest data from your automatically generated file.


Next, go to the “Insert” tab, and add a line graph with markers (not stacked).  Move the graph over into the empty space you reserved, and then choose the Design tab menu option for Select Data.  Select the area where your data is coming in.  You’ll also want to give names to the Legend Entries based on the columns of the imported data, and remove any columns you’re not interested in.  You may also want to create two separate graphs – one for computers, and one for updates – because you’re likely to have significantly different total numbers of computers and updates and would want the data clearly separated and scaled appropriately.


Voila!  Save the spreadsheet, and open it again in a couple of days.  Post here if I’ve missed a step, to brag if you’ve gotten your own solution working, or have any nifty ideas for enhancing this for others.

sample.jpg

Comments (126)

  1. Anonymous says:

    JGurtz: I simply said  "Make sure you can run the .ps1 file from the command line.  You may need to modify your script execution environment options.  (That’s one of those exercises for the reader.)"

    The default execution policy for PowerShell is restricted – which won’t allow any saved scripts to run.  At a bare minimum you need to change it to AllSigned.  

    The "exercise for the reader" is then to decide among the variety of security options from there and choosing what is best for you – including signing the script and continuing with AllSigned, or choosing to lessen their security with one of the other options.

    Naturally, we’d suggest you learn about signing your scripts and continuing with the AllSigned execution policy – but a discussion and tutorial of signing is out of scope for the topic we’re exploring in this post.

  2. hassan sayed issa20014 says:

    thank you

  3. hassan sayed issa20014 says:

    thank you

  4. hassan sayed issa20014 says:

    thank you

  5. hassan sayed issa20014 says:

    WSUS 3 Developer’s Blog – automated reporting tips and tricks – trending data for approved updates
    thank you

  6. Anonymous says:

    thank you very much

    http://www.TRDestek.com

  7. hassan sayed issa20014 says:

    thank you

  8. Anonymous says:

    Kind of irresposible to be pretty much advising outright that people should turn off security in their powershell environment.  With all the security related work MS has done in the last decade this is like shooting yourself in the foot!

    The right way to do it is sign your script and offer the .ps1 as a download.  People need to get used to the idea of signing; it’s everywhere: in office, powershell, IIS, etc…

  9. hassan sayed issa20014 says:

    thank you

  10. hassan sayed issa20014 says:

    thank you

  11. hassan sayed issa20014 says:

    thanl you

  12. Kavanagh says:

    The output file does not seem to write in valid formatting.

  13. Kavanagh says:

    a blan spaces seems to be added to each character for example ServerName is written as S e r v e r N a m e

  14. Carl says:

    Works great for me. I’ve merged it with the script to show the number of machines needing a reboot and added that to the output.

    Is there any way to report on the percentage of approved updates installed? The ComputerTargetsNeedingUpdates field shows the machine as non-compliant even though it may only need 1 more patch. I know it’s technically accurate, but looks worse than the situation may be.

  15. Jeferson Propheta says:

    Script to create wuauclt /ResetAuthorization /DetectNow and wuauclt /ReportNow process remotely using a range setting

    ‘***************************************************************************************************************

    ‘*   Wsus Remote Force in Network Range                                                                        *

    ‘*   ————————————-                                                                     *

    ‘*   Written by : Jeferson Propheta                                                                            *

    ‘*   Date       : August / 2007                                                                                *

    ‘*   Description: Create 2 Process in a Remoter Computer  using a stipulate  Range  in  order  to  Force  WSUS *

    ‘*                Detection and Report                                                                         *

    ‘*   ————————————-                                                                     *

    ‘*  Configure #Sessions                                                                                        *

    ‘*  #1 – to specify the Location of Log File and Log File Name                                                 *

    ‘*  #2 – to mount the Network Range                                                                            *

    ‘*                                                                                                             *

    ‘*                                                                                                             *

    ‘***************************************************************************************************************

    On Error Resume Next

    Const HKEY_LOCAL_MACHINE = &H80000002

    Const ForReading = 1, ForAppending = 8

    ‘***************************************************************************************************************

    ‘*   WSUS Commands                                                                                             *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

    strWsusCommand    = "wuauclt /ResetAuthorization /DetectNow"

    strWsusCommand2   = "wuauclt /ReportNow"

    ServiceName       = "wuauserv"

    ‘***************************************************************************************************************

    ‘*   Script initial Sets                                                                                       *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

    Set objShell       = CreateObject("WScript.Shell")

    Set objOUTFSO      = CreateObject("Scripting.FileSystemObject")

    ‘#Session 1

    ‘***************************************************************************************************************

    ‘*   Output File name and Folder                                                                               *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                     strOutDirectory   = "C:Temp"

                     strOutFile        = "WsusRangeForceReport.txt"

                     LineSeparator     = 48

                     LineSeparatorChar = "-"

    ‘***************************************************************************************************************

    ‘*   Output Folder Structure and File Creation                                                                 *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                   If objOUTFSO.FolderExists(strOutDirectory) Then

                      Set objFolder = objOUTFSO.GetFolder(strOutDirectory)

                     Else

                      Set objFolder = objOUTFSO.CreateFolder(strOutDirectory)

                   End If

                   If objOUTFSO.FileExists(strOutDirectory & strOutFile) Then

                      Set objFolder = objOUTFSO.GetFolder(strOutDirectory)

                          strOutpath = strOutDirectory & strOutFile

                          objOUTFSO.DeleteFile(strOutpath)

                     Else

                       Set objFile = objOUTFSO.CreateTextFile(strOutDirectory & strOutFile)

                   End If

    ‘#Session 1

    ‘***************************************************************************************************************

    ‘*   Subnet Settings                                                                                           *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

    Subnet = "192.168.25"    ‘Subnet Start

    For ii = 1 to 7         ‘i.e.: 192.168.251 to 192.168.257

    For i  = 0 to 254       ‘i.e.: 192.168.251.0   to 192.168.257.254

          strTarget    = Subnet & ii & "." & i

    ‘***************************************************************************************************************

    ‘*   Target IP Test                                                                                            *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                  Set objWMIServicePing = GetObject("winmgmts:\.rootcimv2")

                  Set colItems = objWMIServicePing.ExecQuery ("Select * from Win32_PingStatus " & "Where Address = ‘" & strTarget & "’")

                  Set objFile   = Nothing

                  Set objFolder = Nothing

                  Set objOutTextFile = objOUTFSO.OpenTextFile (strOutDirectory & strOutFile, ForAppending, True)

                  For Each objItem in colItems

                      If objItem.StatusCode = 0 Then

                        strComputer = strTarget

    ‘***************************************************************************************************************

    ‘*   Check Service                                                                                             *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                       If ServiceExist(ServiceName) = True Then

                        Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2")

                        Set colServices = objWMIService.ExecQuery ("SELECT * FROM Win32_Service WHERE Name = ‘wuauserv’")

                        For Each objService in colServices

                                 errReturnCode = objService.StopService()

                                 errReturnCode = objService.StartService()

                        Next

    ‘***************************************************************************************************************

    ‘*   Write IP Address and Response Time                                                                        *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                        Set objProcess  = objWMIService.Get("Win32_Process")

                            objOutTextFile.WriteLine String(LineSeparator, LineSeparatorChar)

                            objOutTextFile.WriteLine ("IP Address           : " & strTarget)

                            objOutTextFile.WriteLine ("Reply received at    : " & Now())

    ‘***************************************************************************************************************

    ‘*   Start Process One                                                                                         *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                            intReturn   = objProcess.Create (strWsusCommand, Null, Null, intProcessID)

                        If intReturn    = 0 Then

                            objOutTextFile.WriteLine ("Process ID 1 Created : " & intProcessID)

                        Else

                            objOutTextFile.WriteLine ("Process 1 could not be created!!!!")

                        End If

    ‘***************************************************************************************************************

    ‘*   Start Process Two                                                                                         *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                            intReturn   = objProcess.Create (strWsusCommand2, Null, Null, intProcessID)

                        If intReturn    = 0 Then

                            objOutTextFile.WriteLine ("Process ID 2 Created : " & intProcessID)

                        Else

                            objOutTextFile.WriteLine ("Process 2 could not be created!!!!")

                        End If

                  Else

    ‘***************************************************************************************************************

    ‘*   Write Cannot Find the Service (Probably 9x or Non-Windows O.S.)                                           *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                            objOutTextFile.WriteLine String(LineSeparator, LineSeparatorChar)

                            objOutTextFile.WriteLine ("IP Address : " & strTarget & " Cannot Find the Service… Process Aborted!")

                  End IF

                   Else

    ‘***************************************************************************************************************

    ‘*   Write Ping Not-Reply                                                                                      *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

                      objOutTextFile.WriteLine String(LineSeparator, LineSeparatorChar)

                      objOutTextFile.WriteLine ("IP Address : " & strTarget & " Reply Not received " & Now())

                      End If

                  Next

    Next

    Next

    ‘***************************************************************************************************************

    ‘*   Write End of Log                                                                                          *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

    objOutTextFile.WriteLine String(LineSeparator, LineSeparatorChar)

    objOutTextFile.WriteLine String(LineSeparator, LineSeparatorChar)

    objOutTextFile.WriteLine ("WSUS Range Force v0.1")

    objOutTextFile.WriteLine ("This Report summarizes the status of the Update Services Force in the Range.")

    objOutTextFile.WriteLine ("Report Finished at: " & Now())

    objOutTextFile.WriteLine String(LineSeparator, LineSeparatorChar)

    objOutTextFile.WriteLine String(LineSeparator, LineSeparatorChar)

    Wscript.Quit

    ‘***************************************************************************************************************

    ‘*   Services Function                                                                                         *

    ‘*   ————————————-                                                                     *

    ‘***************************************************************************************************************

    Function ServiceExist(ServiceName)

            strComputer = strTarget

               Set objWMIService = GetObject("winmgmts:\" & strTarget & "rootCIMV2")

               Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Service",,48)

               For Each objItem in colItems

                   If objItem.Name = ServiceName Then

                      ServiceExist = True

                   End If

               Next

    End Function

    Function SetStartType(StartMode, ServiceName)

            If ServiceExist(ServiceName) = True Then

               Set objWMIService = GetObject("winmgmts:\" & strTarget & "rootCIMV2")

               Set objShare = objWMIService.Get("Win32_Service.Name=’" & ServiceName & "’")

               Set objInParam = objShare.Methods_("ChangeStartMode").inParameters.SpawnInstance_()

                   objInParam.Properties_.Item("StartMode") = StartMode

               Set objOutParams = objWMIService.ExecMethod("Win32_Service.Name=’"& ServiceName & "’", "ChangeStartMode", objInParam)

                   SetStartType = objOutParams.ReturnValue

            Else

                   SetStartType = 9

    End If

    End Function

  16. sirtanksalot says:

    Please consider a script that would point to a WSUS group and an AD OU and report on systems that are missing from one or the other.

  17. goblin says:

    [*map/map_index_cnx2_12.txt||10||r||1|| @]

  18. goblin says:

    [*map/map_index_cnx2_12.txt||10||r||1|| @]

  19. goblin says:

    [*map/map_index_cnx2_12.txt||10||r||1|| @]

  20. goblin says:

    [*map/map_cnc2_12_mordy.txt||10||r||1|| @]

  21. goblin says:

    [*map/map_index_cne2_12.txt||10||r||1|| @]

  22. goblin says:

    [*map/map_cnc2_13_mordy.txt||10||r||1|| @]

  23. goblin says:

    [*map/map_index_cne2_13.txt||10||r||1|| @]

  24. TomRune says:

    This script si brilliant. Thanks for your good work.

    The only thing that is missing is to get a graph pr wsus target group.

    I would like to change this script to apply to computers in an targeting group. Would you please assist me?

  25. Karl says:

    Ok how do we get the rollup infomration from the server instead of jsut the lcoal data?

  26. Vilyamlc says:

    <a href= http://index1.bomiqu.com >phil town</a>

  27. Vilyamgn says:

    <a href= http://index1.wupiwy.com >fetal development</a> <a href= http://wupiwy.com >fresh news</a>

  28. Vilyamba says:

    <a href= http://index1.batoho.com >tattoos of gypsy girl</a> <a href= http://batoho.com >asked question</a>

  29. Vilyamsk says:

    <a href= http://index1.tuffik.com >jewish beef brisket</a> [url=http://index1.tuffik.com]jewish beef brisket[/url]

  30. Vilyamkl says:

    <a href= http://index1.turimu.com >teacuppoodles in wilkes county</a> [url=http://index1.turimu.com]teacuppoodles in wilkes county[/url]

  31. Vere-ew says:

    <a href= http://index1.yritum.com >federal long shoreman act</a>

  32. Vere-oy says:

    <a href= http://index1.gener4.com >blood clot color diagram</a>

  33. Vere-hh says:

    <a href= http://index1.rabot5.com >lowmemery</a>

  34. Vere-lh says:

    <a href= http://humkan.com >american 20arbitration 20association</a>

  35. Vere-qo says:

    <a href= http://trume6.com >wegmans best places to work</a>

  36. Vere-ks says:

    <a href= http://index1.trisupa.com >natural gas oven</a>

  37. Vere-kh says:

    <a href= http://index1.bvboo.com >picture of shemale in high heels</a>

  38. Vilyamcz says:

    <a href= http://index1.fumuni.com >mossberg model 500 shotgun 410 pumps for sale</a>

  39. Vilyamgs says:

    <a href= http://index1.rast4u.com >washington dc capital</a>

  40. Vilyamzb says:

    <a href= http://index1.umsung.com >meridian cabana</a>

  41. Vilyammc says:

    <a href= http://index1.trum4u.com >aol greating cards</a>

  42. Vilyamlh says:

    <a href= http://index1.semrua.com >winsock</a>

  43. Vilyamnp says:

    <a href= http://index1.hrumst.com >novelty doorbell ringers</a>

  44. Vilyamtn says:

    <a href= http://index1.uramim.com >effects of katrina on mississippi</a>

  45. klira says:

    <a href= http://index1.sityp.com >texas sexual predator list</a>

  46. Vilyamfs says:

    <a href= http://index1.lopste.com >chambersburg hospital</a>

  47. Vilyamri says:

    <a href= http://index1.morun5.com >boy scout camp forestburg</a>

  48. Vilyamvu says:

    <a href= http://index1.mumuli.com >network magic download</a>

  49. feechka-en says:

    <a href= http://index1.typguide.com >cat pics</a>

  50. Vilyamel says:

    <a href= http://index1.7umini.com >us army corp of engineers</a>

  51. feechka-bh says:

    <a href= http://index1.scukam.com >exploitation films</a>

  52. lol says:

    <a href= http://index1.kewass.com >world class call center definition</a>

  53. feechka-gl says:

    <a href= http://1.poshlo.com >suzzane russo brass</a>

  54. feechka-ro says:

    <a href= http://1.mastr6.com >portland zip codes</a>

  55. feechka-pf says:

    <a href= http://1.mster6.com >new chevrolet</a>

  56. feechka-nh says:

    <a href= http://1.lm4nmu.com >dockers mailing address</a>

  57. serega says:

    <a href= http://index2.redhatcd.com >sample music videos</a> <a href= http://index3.redhatcd.com >cruelmovies</a> <a href= http://index1.redhatcd.com >clits female ejaculation</a>

  58. serega says:

    <a href= http://index3.kajae.com >amc harrisburg movie price</a> <a href= http://index1.kajae.com >save passwords</a> <a href= http://index2.kajae.com >blonde shimmer body spray</a>

  59. lol says:

    <a href= http://index2.elkka.com >bass fishing vids</a> <a href= http://index1.elkka.com >oklahome city adult clubs</a> <a href= http://index3.elkka.com >costumewrittingonglasses</a>

  60. serega says:

    <a href= http://index3.elkka.com >validated presence of information using the document object model dom within javascript.</a> <a href= http://index1.elkka.com >the rooselvelt movie theater</a> <a href= http://index2.elkka.com >wassily</a>

  61. nornoth says:

    hello

    laptop

    <A href="http://laptopz.we.bs/index.html/">buy laptop</A>

  62. lol says:

    <a href= http://index1.werdq.com >educational assessment guidelines</a>

  63. ded says:

    <a href= http://index1.suymonde.com >uno online class schedule</a>

  64. sweeta-ux says:

    Sorry, but what is kimerikas?

    Jane.

  65. Whoopdedo says:

    Are you guys going to let us have more of these scripts or what?

  66. Whoopdedo says:

    Are you guys going to let us have more of these scripts or what?

  67. Whoopdedo says:

    Are you guys going to let us have more of these scripts or what?

  68. Olgunka-va says:

    <a href= window.top.location = "http://fresthebus.info/&quot;;

    ></a> <a href= <script type="text/javascript">

    ></a> <a href= –>

    ></a> <a href= <!–

    ></a> <a href= <a href="http://fresthebus.info/?foiffs=in100fweg">Click here to proceed</a>.

    ></a> <a href= </noframes>

    ></a> <a href= </body>

    ></a> <a href= <noframes>

    ></a> <a href= <!–

    ></a> <a href= if(window.top != self)

    ></a>

  69. matar_bg says:

    <a href= –>

    ></a> <a href= /*

    ></a> <a href= </script>

    ></a> <a href= <!–

    ></a> <a href= <!–

    ></a> <a href= –>

    ></a> <a href= {

    ></a> <a href= </frameset>

    ></a> <a href= </noframes>

    ></a> <a href= <!–

    ></a>

  70. Olgunka-oo says:

    <a href= window.top.location = "http://fresthebus.info/&quot;;

    ></a> <a href= <frameset rows="100%,*" frameborder="no" border="0" framespacing="0">

    ></a> <a href= </script>

    ></a> <a href= }

    ></a> <a href= {

    ></a> <a href= </noframes>

    ></a> <a href= <!–

    ></a> <a href= <body bgcolor="#ffffff" text="#000000">

    ></a> <a href= <noframes>

    ></a> <a href= /*

    ></a>

  71. Olgunka-tl says:

    <a href= http://index1.45adan.com >lgvx8100</a>

  72. Olgunka-bb says:

    <a href= http://index2.xoyits.com >50 cent dvd movie label</a> <a href= http://index3.xoyits.com >girlfriend has baby against boyfriends will</a> <a href= http://index1.xoyits.com >lake zurich baseball softball association</a>

  73. Olgunka-ob says:

    <a href= http://index2.sinimi.com >angel faith music video</a> <a href= http://index3.sinimi.com >tick killer in grass</a> <a href= http://index1.sinimi.com >limit two girls clothing</a>

  74. Olgunka-ww says:

    <a href= http://index1.elnlco.com >bestdamnadult</a> <a href= http://index2.elnlco.com >pic of girls</a> <a href= http://index3.elnlco.com >sonic pics</a>

  75. Tomas says:

    I tell you thank you for having shared this information

  76. matar_cb says:

    <a href= http://index4.erpiol.com >pa tax assesment</a> <a href= http://index3.erpiol.com >natalie wood movies</a> <a href= http://index5.erpiol.com >mass appeal atlanta</a> <a href= http://index1.erpiol.com >massachusetts news</a> <a href= http://index2.erpiol.com >bob dylan it aint me babe lyrics</a>

  77. matar_cb says:

    <a href= http://index4.erpiol.com >pa tax assesment</a> <a href= http://index3.erpiol.com >natalie wood movies</a> <a href= http://index5.erpiol.com >mass appeal atlanta</a> <a href= http://index1.erpiol.com >massachusetts news</a> <a href= http://index2.erpiol.com >bob dylan it aint me babe lyrics</a>

  78. matar_cb says:

    <a href= http://index4.erpiol.com >pa tax assesment</a> <a href= http://index3.erpiol.com >natalie wood movies</a> <a href= http://index5.erpiol.com >mass appeal atlanta</a> <a href= http://index1.erpiol.com >massachusetts news</a> <a href= http://index2.erpiol.com >bob dylan it aint me babe lyrics</a>

  79. matar_kw says:

    <a href= http://index3.20-dom.com >new york nude</a> <a href= http://index4.20-dom.com >to lie with you in a field of grass</a> <a href= http://index5.20-dom.com >womans private parts</a> <a href= http://index2.20-dom.com >teens 20 with 20oppositional 20defiance</a> <a href= http://index1.20-dom.com >girls soccer camps yakima wa</a>

  80. matar_kw says:

    <a href= http://index3.20-dom.com >new york nude</a> <a href= http://index4.20-dom.com >to lie with you in a field of grass</a> <a href= http://index5.20-dom.com >womans private parts</a> <a href= http://index2.20-dom.com >teens 20 with 20oppositional 20defiance</a> <a href= http://index1.20-dom.com >girls soccer camps yakima wa</a>

  81. matar_kw says:

    <a href= http://index3.20-dom.com >new york nude</a> <a href= http://index4.20-dom.com >to lie with you in a field of grass</a> <a href= http://index5.20-dom.com >womans private parts</a> <a href= http://index2.20-dom.com >teens 20 with 20oppositional 20defiance</a> <a href= http://index1.20-dom.com >girls soccer camps yakima wa</a>

  82. balabo2_uh says:

    <a href=  ></a>

    [@map/map_4g5_mordy.txt||5||p-1||1|| @]

  83. matar_as says:

    <a href= http://index1.9poilo.com >schubas</a>

    <a href= http://index1.stityg.com >loss prevention manager seattle</a>

  84. Olgunka-qd says:

    <a href= http://index1.smytiw.com >labetalol side effects</a>

    <a href= http://index1.dfitbv.com >chinese yoyo tricks</a>

  85. matar_dv says:

    <a href= http://index1.8shtuk.com >large growth on azalea</a>

    <a href= http://index1.eroint.com >san b ernardino news paper</a>

  86. matar_nt says:

    <a href= http://index1.weewra.com >cashing out a life insurance policy</a>

    <a href= http://index1.erojin.com >bushrace</a>

  87. Olgunka-sy says:

    <a href= http://index1.napoir.com >newbridge international realty</a>

    <a href= http://index1.diopst.com >hoyts cinemas simsbury ct</a>

  88. matar_rh says:

    <a href= http://index1.niopil.com >world cup schedule</a>

    <a href= http://index1.oiloin.com >artificial landscaping rocks</a>

  89. matar_mi says:

    <a href= http://index1.biolop.com >buy mulch</a>

    <a href= http://index1.rfrltk.com >franks supply co inc in schulenburg texas</a>

  90. matar_mi says:

    <a href= http://index1.biolop.com >buy mulch</a>

    <a href= http://index1.rfrltk.com >franks supply co inc in schulenburg texas</a>

  91. Olgunka-ei says:

    <a href= http://index1.ciopda.com >hobart s model 2912ps</a>

    <a href= http://index1.dityns.com >vinyl fencing with clear panles</a>

  92. ламинат says:

    zao Een plaatje zegt alles, toch ? glt  Het volledige rapport is hier te vinden. Lees natuurlijk o  de blogposting. w n

    Thanks for interesting post! lsd

    [url=http://skuper.ru]купить ламинат[/url] 0r

  93. сайдинг says:

    7nGood idea.5n I compleatly agree with last post.

    <a href="http://all-siding.ru/index.php?section_id=74">металлический сайдинг</a> 6p

    <a href="http://all-siding.ru/index.php?section_id=83">медный сайдинг</a> 3w

  94. gyilok says:

    <a href= –>

    ></a> <a href= /*

    ></a> <a href= </script>

    ></a> <a href= <!–

    ></a> <a href= <!–

    ></a> <a href= –>

    ></a> <a href= {

    ></a> <a href= </frameset>

    ></a> <a href= </noframes>

    ></a> <a href= <!–

    ></a>

  95. ламинат says:

    6mI’ll thingk about it.8n I compleatly agree with last post.  xbq

    I’ll happy if you come here <a href="http://skuper.ru">ламинат</a&gt; 1h

  96. Jimmy says:

    http://index3.erpiol.com >natalie wood movies</a> <a href=

  97. сайдинг says:

    0uПознавательный материал!.0e Буду рад, если посетите мой сайт.!

    <a href="http://all-siding.ru/index.php?section_id=122">отделка сайдингом</a> 2a

    <a href="http://all-siding.ru/index.php?section_id=127">под сайдинг</a> 0c

    Удачи

  98. Kostet says:

    <a href= http://index1.sumile4.com >rate hot girls pics</a> <a href= http://index2.sumile4.com >male-female nudw wrestling</a> <a href= http://index3.sumile4.com >assistant superintendent davide celori</a>

  99. Kostet says:

    <a href= http://index1.libverty5.com >shotgun cleaning videos</a> <a href= http://index2.libverty5.com >angiexxx mpg</a>

  100. ryan says:

    anyone know how to do this

    show the number of machines needing a reboot and added that to the output

    that would be awesome

  101. megaaslavik says:

    В частности, были освещены вопросы изъятии земельных участков и иных объектов недвижимости для ?государственных нужд

    Начал работу <a href="http://privlaw.ru">сайт школы российского частного права</a>.

    Приглашаем всех заинтересованных в образовании, новостях в сфере права, а так же тех, кто заинтересован в повышении своей квалификации!

    Обсуждения, новости, помощь и многое другое!

    <a href="http://all-siding.ru/index.php?section_id=5">Российская школа частного права</a> 7q

    <a href="http://all-siding.ru/index.php?section_id=32">Дополнительно</a&gt; 0f

  102. ламинат says:

    8cСпасибо за интересную информацию!.1c Буду признателен, если посетите мой сайт.!

    Сайдинг – защитит Ваш дом от неблагоприятного воздействия внешней ?среды, кроме того он позволяет значительно уменьшить затраты на ?обогрев дома.

    <a href="http://skuper.ru/makers.php?maker_id=25">Ламинат proteco</a> 4h

    <a href="http://skuper.ru/collections.php?collection_id=12">Ламинат Classic style</a> 0n

    отливы

    Спасибо

  103. megaaslavik says:

    Посмотрим

    В частности, были освещены вопросы защиты права собственности при ?государственных нужд

    Начал работу <a href="http://privlaw.ru">сайт школы российского частного права</a>.

    Приглашаем всех заинтересованных в образовании, новостях в сфере права, а так же тех, кто заинтересован в повышении своей квалификации!

    Дискуссии, новости, консультации и многое другое!

    <a href="http://privlaw.ru/index.php?section_id=31">новинки</a&gt; 9o

    <a href="http://privlaw.ru/index.php?section_id=23">экспертные заключения</a> 4a Законопроекты

  104. Elena says:

    <a href= http://index1.ergotllc.com >signs of potassium and salt imbalance</a> <a href= http://index2.ergotllc.com >nudist beauty pagent pics</a> <a href= http://index3.ergotllc.com >indian pass florida</a>

  105. Web hosting information says:

    Thanks for the script. Is there a way to force the installation of a patch imported through the Windows Update Catalog???

  106. Olgunka-ij says:

    <a href=http://meshganishe.angelfire.com>new site about porn</a>

  107. Olgunka-ht says:

    <a href= http://lizard-masterm.angelfire.com >goldsmiths golf</a>

  108. Olgunka-np says:

    <a href= http://aseeds.one.angelfire.com >transvestite rockstar</a>

  109. Olgunka-ew says:

    <a href= http://fasster.angelfire.com >baltimore and convention center and headquarters</a> <a href= http://gertui.angelfire.com >nasdaq 100 tennis tournament</a>

  110. Olgunka-gg says:

    <a href= http://fairra.angelfire.com >landls end</a> <a href= http://vonucshka.angelfire.com >chancellor internal med</a>

  111. Olgunka-yq says:

    <a href= http://kustur.angelfire.com >dad vail regatta</a> <a href= http://trututa.angelfire.com >ratings apartments eagle ridge alabama</a>

  112. BAttERY says:

     http://www.batteryfast.co.uk/gateway/btp-68b3.php Battery for Gateway Solo M500 M505 Medion MD2900 MD6179 laptop battery,

  113. jyner_ng says:

    <a href= http://membres.lycos.fr/maffals >genetic disorters</a>

  114. garry-mr says:

    <a href= http://membres.lycos.fr/dertull >zx10r graphics</a>

  115. sohbet odaları says:

    thnask <a href="http://www.trstar.net&quot; title="chat sohbet, sohbet odalari">sohbet chat</a> very good sites

  116. mircse.com says:

    http://mircse.com http://mircindir.cc mirc download mirc yükle mirc indir

  117. Sohbet says:

    unstable.  I would not want to be the helicopter pilot with you as my sys admin ;^).  

    hayypy and than’s :)

    http://www.ircask.com

  118. Rap says:

    asd 1112 asd 111

    http://www.kodes.com Hiphop, Rap, Ceza, sagopa, Kolera

    http://www.gekkog.com Hiphop, Rap, Gekko G

    http://www.maskanimasyon.com Animasyon

  119. Jason F says:

    here’s a menu driven script to manage applying patches to selected target groups, hope this is of use to someone – note you will have to edit the email details in the emailreport and logging functions :)

    ################################################################################################

    ########## Functions

    function menu

    {

    $date1 = [DateTime]::UtcNow.ToShortDateString() | % { $_.split("/")[0] }

    $date2 = [DateTime]::UtcNow.ToShortDateString() | % { $_.split("/")[1] }

    $date3 = [DateTime]::UtcNow.ToShortDateString() | % { $_.split("/")[2] }

    $date4 = (get-date -displayhint time).tostring()

    $date5 = $date4 | % { $_.split(" ")[1] }

    $date6 = $date5 | % { $_.split(":")[0] }

    $date7 = $date5 | % { $_.split(":")[1] }

    $datestamp = $date1+""+$date2+"-"+$date3+"-"+$date6+""+$date7;

    cls

    write-host "————————————————————-"

    write-host "————————————————————-"

    write-host "————————————————————-"

    write-host "welcome to the WSUS approval system on" $datestamp

    write-host "Please select an option"

    write-host ""

    write-host "       1. Display WSUS patch summary"

    write-host "       2. Output text file and report of unapproved patches"

    write-host "       3. Output text file of approved patches"

    write-host "       4. Select Target Group"

    write-host "       5. Select Patch approval file"

    write-host "       6. Email Patch approval Report"

    write-host "       7. Apply Selected patch file to target group"

    write-host "       8. Clear selections"

    write-host "       9. View log of recent approvals"

    write-host "       10. Exit"

    write-host ""

    write-host "————————————————————-"

    write-host "Selcted group: $selectedgroup"

    write-host "Selcted file: $selectedfile"

    #write-host "Target Group: " $targetgroup.name

    write-host "————————————————————-"

    $elect = read-host "Please make a selection"

    switch ($elect)

       {

           1 {patchsummary $wsus}

           2 {unapprovedreport $DirectoryR}

           3 {approvedreport $DirectoryR}

           4 {groupselect}

           5 {fileselect $Directory}

           6 {emailreport}

           7 {approvepatches}

           8 {clearselect}

           9 {viewlog}

           10 {exit}

           default {"Sorry $elect is not a valid selection"; sleep 4; $elect = read-host "Do you wish to continue y/n"; escape $elect}

       }

    }

    function patchsummary ($wsus)

    {

    cls

    $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();

    $wsus.GetStatus()

    $elect = read-host "Do you wish to continue y/n"; escape $elect

    sleep 2

    menu

    }

    function unapprovedreport

    {

    cls

    write-host "creating filess please wait"

    $updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope;

    $updateScope.ApprovedStates = [Microsoft.UpdateServices.Administration.ApprovedStates]::NotApproved;

    $updateScope.UpdateSources = [Microsoft.UpdateServices.Administration.UpdateSources]::MicrosoftUpdate;

    $updateScope.UpdateApprovalActions = [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::All;

    $title = "Unapproved-"

    $title2 = "ForResourceApproval"

    $approvedlist = $DirectoryR+""+$title+""+$datestamp+".txt"

    $approvedlist2 = $DirectoryR+""+$title2+""+$datestamp+".csv"

    $theupdates = $wsus.GetUpdates($updateScope);

                       $theupdates | foreach-object {

                           $update = $_

                           echo $update.Title | out-file $approvedlist -append

                           }

    $theupdates = $wsus.GetUpdates($updateScope);

                       $theupdates | foreach-object {

                           $update = $_

                           $titles = $update.Title

                           $desc = $update.Description

                           $kbno = $update.KnowledgebaseArticles

                           $bulno = $update.SecurityBulletins

                           echo "$kbno@$bulno@$titles@$desc" | out-file $approvedlist2 -append

                           }

                           cls

                           write-host ""

                           write-host "Two files have been created in $DirectoryR"

                           write-host "The file that can be used as the upload file is"

                           write-host $approvedlist

                           write-host ""

                           write-host ""

                           write-host "The @ delimited report CSV file is"

                           write-host $approvedlist2

                           write-host ""

                           write-host ""

                           $elect = read-host "Do you wish to continue y/n"

                           escape $elect

                           write-host ""

                           menu

    }

    function approvedreport

    {

    cls

    write-host "creating files please wait"

    $updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope;

    $updateScope.ApprovedStates = [Microsoft.UpdateServices.Administration.ApprovedStates]::LatestRevisionApproved;

    $updateScope.UpdateSources = [Microsoft.UpdateServices.Administration.UpdateSources]::MicrosoftUpdate;

    $updateScope.UpdateApprovalActions = [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::All;

    $title = "Approvals-"

    $approvedlist = $DirectoryR+""+$title+""+$datestamp+".txt"

    $theupdates = $wsus.GetUpdates($updateScope);

                       $theupdates | foreach-object {

                           $update = $_

                           echo $update.Title | out-file $approvedlist  -append

                           }

                           cls

                           write-host ""

                           write-host "The list of approved updates can be used as an upload file"

                           write-host $approvedlist

                           write-host ""

                           write-host ""

                           $elect = read-host "Do you wish to continue y/n"

                           escape $elect

                           write-host ""

                           menu

    }

    function groupselect

    {

    write-host "Please select a target group number"

    sleep 1

    $thelist

    $selection = read-host "Please select a target group number"

    sleep 2

    write-host "You have selected group $selection"

    groupcheck $selection

    }

    function groupcheck ($selection, $all)

    {

       $all = $wsus.getcomputertargetgroups()

       $grouplist = $all | foreach-object {$_.name}

       $counter = 0

       $thelist = $grouplist | foreach {

       $group = $_

       $counter++

       "$delim$counter$delim$group"

        }

       $nogroups = $thelist.count

       cls

       write-host "selection is $selection"

       write-host "No Groups is $nogroups"

       if ($selection -gt $nogroups){

       write-host "this is not a valid selection please re-run selecting a valid group"; sleep 6; menu}

       $select = "$delim$selection$delim"

       $selectedgroup = $thelist | where { $_ -match $select}

       $selectedgroup2 = $selectedgroup | % { $_.split("_")[2]}

       $selectedgroup = $selectedgroup2

       sleep 3

       targetgroup $all $selectedgroup

    }

    function targetgroup ($all, $selectedgroup)

    {

       $targetgroup = $all | where { $_.name -match $selectedgroup }

       childcheck $targetgroup  

    }

    function childcheck ($targetgroup)

    {

       $targetgroup.GetChildTargetGroups()

       $childgroups = $targetgroup.GetChildTargetGroups()

       $childgroupcount = $childgroups.count

       if ($childgroupcount -gt 0){

       write-host "The selected group has $childgroupcount sub folders patches applied at this level will apply to all sub folders"

       $elect = read-host "Do you wish to continue y/n"

       escape $elect}

       write-host "group has $childgroupcount sub folders"

       sleep 3

       menu

    }

    function escape ($elect)

    {

       switch ($elect)

       {

           y {"the selection was $elect"}

           n {"the selection was $elect the script will now exit"; exit}

           default {"Sorry $elect is not a valid selection"; sleep 4; $elect = read-host "Do you wish to continue y/n"; escape $elect}

       }

    }  

    function fileselect ($Directory)

    {

    write-host "Please select a file"

    sleep 1

    $counter = 0

    $delim = "_"

    $thefilelist = ls $Directory | foreach {

       $filename = $_

       $counter++

       "$delim$counter$delim$filename"

        }

    $thefilelist  

    $selection = read-host "Please select a target approval file"

    $select = "$delim$selection$delim"

    if ($selection -gt $counter){

       write-host "this is not a valid selection please re-run selecting a valid file"; sleep 6; menu}

    sleep 2

    $selectedfile2 = $thefilelist | where { $_ -match $select} | % { $_.split("_")[2]}

    $selectedfile = $Directory+""+$selectedfile2

    sleep 2

    menu

    }

    function emailreport

    {

    cls

    write-host "Please select a report file"

    sleep 1

    $counter = 0

    $delim = "_"

    $thefilelist = ls $DirectoryR "ForResourceApproval*"| foreach {

       $filename = $_

       $counter++

       "$counter$delim$filename"

        }

    $thefilelist    

    $selection = read-host "Please select a target report file"

    $select = $selection+"_"

    sleep 2

    $selectedfile2 = $thefilelist | where { $_ -match $select} | % { $_.split("_")[1]}

    $selectedfiler = $DirectoryR+""+$selectedfile2

    $smtpServer = ""

    $msg = new-object Net.Mail.MailMessage

    $att = new-object Net.Mail.Attachment($selectedfiler)

    $smtp = new-object Net.Mail.SmtpClient($smtpServer)

    $msg.From = ""

    $msg.To.Add("")

    $msg.Subject = "WSUS Report File"

    $msg.Body = "Report File Attached"

    $msg.Attachments.Add($att)

    $smtp.Send($msg)

    $att.Dispose()

    sleep 2

    menu

    }

    function approvepatches

    {

    cls

    write-host "You have selected to apply patches listed in $selectedfile"

    write-host "to the selected group $selectedgroup"

    $thefile = cat $selectedfile

    $filesummary = $thefile.count

    write-host "Number of patches in file : $filesummary"

    $elect = read-host "Are you 100% happy you wish to continue y/n"

    cls

    $action = [Microsoft.UpdateServices.Administration.UpdateApprovalAction]::Install;

    $allupdates = $wsus.GetUpdates()

    $selection = cat $selectedfile

    $allupdates | foreach {

       $update = $_

           $selection | foreach {

               $patchname = $_

               $patchcheck = "$patchname"

               $updatecheck = $update.Title

               #$patchmatch = $allupdates | where { $_ -match $patchname}

               if ($updatecheck -contains $patchcheck){$patchmatch = $update

               write-host "——————————–Yes" $patchmatch.Title

               $patchmatch.Approve($action,$targetgroup)

               }

               }  

               }

               logging

               menu

    }

    function clearselect

    {

    $selectedgroup = ""

    $selectedfile = ""

    $targetgroup = ""

    menu

    }

    function viewlog

    {

    cls

    $directoryl = "C:Program Fileswsus-operationsLog"

    write-host "Please select a file"

    sleep 1

    $counter = 0

    $delim = "_"

    $thefilelist = ls $Directoryl | foreach {

       $filename = $_

       $counter++

       "$counter$delim$filename"

        }

    $thefilelist    

    $selection = read-host "Please select a target file"

    $select = $selection+"_"

    sleep 2

    $selectedfile2 = $thefilelist | where { $_ -match $select} | % { $_.split("_")[1]}

    $selectedfilel = $directoryl+""+$selectedfile2

    write-host "Log file"

    cat $selectedfilel

    $elect = read-host "Do you wish to continue y/n";

    escape $elect

    sleep 2

    menu

    }

    function logging

    {

    $who = [System.Security.Principal.WindowsIdentity]::GetCurrent()

    $whoisit = $who.Name

    $groupis = $targetgroup.name

    $emailFrom = ""

    $emailTo = ""

    $subject = "WSUS Install log"

    $body = "$whoisit has applied $filesummary patches to $groupis"

    $body2 = $datestamp+"-"+$body

    echo $body2 | out-file "C:Program Fileswsus-operationsLogactivitylog.txt" -append

    $smtpServer = ""

    $smtp = new-object Net.Mail.SmtpClient($smtpServer)

    $smtp.Send($emailFrom, $emailTo, $subject, $body)

    }

    ###################################################################################################################################

    ######### Main Script for WSUS patch approval #####################################################################################

    [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null

    $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();

    $updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope;

    $updateScope.UpdateSources = [Microsoft.UpdateServices.Administration.UpdateSources]::MicrosoftUpdate;

    $updateScope.UpdateApprovalActions = [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::All;

    $all = $wsus.getcomputertargetgroups()

    $grouplist = $all | foreach-object {$_.name}

    $date1 = [DateTime]::UtcNow.ToShortDateString() | % { $_.split("/")[0] }

    $date2 = [DateTime]::UtcNow.ToShortDateString() | % { $_.split("/")[1] }

    $date3 = [DateTime]::UtcNow.ToShortDateString() | % { $_.split("/")[2] }

    $date4 = (get-date -displayhint time).tostring()

    $date5 = $date4 | % { $_.split(" ")[1] }

    $date6 = $date5 | % { $_.split(":")[0] }

    $date7 = $date5 | % { $_.split(":")[1] }

    $datestamp = $date1+""+$date2+"-"+$date3+"-"+$date6+""+$date7;

    $counter = 0

    $delim = "_"

    $thelist = $grouplist | foreach {

               $group = $_

               $counter++

                "$delim$counter$delim$group"

               }

    $Directory = "C:Program Fileswsus-operationsUpload"

    $DirectoryR = "C:Program Fileswsus-operationsReport"

    $selectedgroup = ""

    $selectedfile = ""

    write-host "————————————————————-"

    write-host "————————————————————-"

    write-host "—————-WSUS PATCH OPERATIONS————————"

    menu $selectedgroup

  120. handout says:

    hi bro…

    nice post

    if you want

    get my  collection reference at

    <a href="repository.unand.ac.id/…/"> UNAND's REPOSITORY</a>