Advertisement
adamchilcott

checkKaspersky.ps1

Oct 9th, 2018
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###########################################################
  2. # Update Kaspersky, Then Run Full-Scan
  3. # Aimed At Remote Monitoring And Management Solutions (RMM)
  4. # LogMeIn Central, AVG Managed Workplace Et. al
  5. ###########################################################
  6.  
  7. #####################################################################
  8. # Methods To Determine Bitness
  9. #####################################################################
  10. # [System.Environment]::Is64BitOperatingSystem
  11. # (Get-CimInstance -ClassName win32_operatingsystem).OSArchitecture
  12. # (gwmi win32_operatingsystem | select osarchitecture).osarchitecture
  13. #####################################################################
  14.  
  15. ## $detectSystem = [System.Environment]::Is64BitOperatingSystem
  16. $detectSystem = (gwmi win32_operatingsystem | select osarchitecture).osarchitecture
  17.  
  18. ## if ($detectSystem -eq $true)
  19. if ($detectSystem -eq "64-bit")
  20.  
  21. {
  22.     $avpBinary = "C:\Program Files (x86)\Kaspersky Lab\Kaspersky Endpoint Security for Windows\avp.com"
  23. }
  24.  
  25. else
  26.  
  27. {
  28.     $avpBinary = "C:\Program Files\Kaspersky Lab\Kaspersky Endpoint Security for Windows\avp.com"
  29. }
  30.  
  31. & $avpBinary UPDATE
  32.  
  33. & $avpBinary SCAN /ALL /i3 /fa /iChecker=on /iSwift=on
  34.  
  35. #############
  36. # START NOTES
  37. #############
  38.  
  39. ## Reference:
  40. ## <https://support.kaspersky.com/11336>
  41.  
  42. ## gwmi Method Prefered for those still running PowerShell 2.0.
  43.  
  44. # 2-clause license ("Simplified BSD License" or "FreeBSD License")
  45. #
  46. # Copyright © 2018, Adam Brian Chilcott
  47. # All rights reserved.
  48. #
  49. # Redistribution and use in source and binary forms, with or without
  50. # modification, are permitted provided that the following conditions are met:
  51. #
  52. # 1. Redistributions of source code must retain the above copyright notice, this
  53. # list of conditions and the following disclaimer.
  54. # 2. Redistributions in binary form must reproduce the above copyright notice,
  55. # this list of conditions and the following disclaimer in the documentation
  56. # and/or other materials provided with the distribution.
  57. #
  58. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  59. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  60. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  61. # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  62. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  63. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  64. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  65. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  66. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  67. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  68. #
  69. # The views and conclusions contained in the software and documentation are those
  70. # of the authors and should not be interpreted as representing official policies,
  71. # either expressed or implied, of the FreeBSD Project.
  72.  
  73. ###########
  74. # END NOTES
  75. ###########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement