Advertisement
Guest User

Remote BHV Export

a guest
Jun 4th, 2014
1,802
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2.     Description:
  3.     Script to copy histroy of target computer
  4.    
  5.     Author:
  6.     William Fischer
  7.    
  8.     Last Revised Date:
  9.     06/04/2014
  10.    
  11.     Notes:
  12.     Must have Browsing History View installed for this to work
  13. #>
  14.  
  15. #Name of Remote Computer
  16. $RemoteHost
  17.  
  18.  
  19. #This is for Vista, 7 and 8
  20. Function Windows-6
  21. {
  22.     #set-location $BHV
  23.     & $BHV"./BrowsingHistoryView.exe" /HistorySource 3 /HistorySourceFolder $Source\"Users\" /VisitTimeFilterType 1 /LoadIE 1 /LoadFIrefox 1 /LoadChrome 1 /LoadSafari 1 /scomma $Destination".csv"
  24. }
  25.  
  26. #This is for XP
  27. Function Windows-5
  28. {
  29.    
  30.     & $BHV"./BrowsingHistoryView.exe" /HistorySource 3 /HistorySourceFolder $Source\"Documents and Settings\" /VisitTimeFilterType 1 /LoadIE 1 /LoadFIrefox 1 /LoadChrome 1 /LoadSafari 1 /scomma $Destination".csv"
  31. }
  32.  
  33.  
  34. #Asks for remote computer's name
  35. $RemoteHost = read-host "Please enter name of remote computer"
  36. #Checks OS version
  37. $Version = (Get-WmiObject -computername $RemoteHost -class Win32_OperatingSystem).version
  38.  
  39. #Figures out file name from remote host and current date
  40. $Month = (get-date).month
  41. $Day = (get-date).day
  42. $Year = (get-date).year
  43. $Date = echo $Month $Day $Year
  44. $Name = echo $RemoteHost $Date
  45. #Source of history
  46. $Source = echo \\$RemoteHost\c$\
  47. #Destination of history
  48. #Change this to where you want the file to be placed
  49. $Destination = echo \\______________________\$Name
  50. #Location of Browsing History View tool
  51. #Change this to BHV location
  52. $BHV = echo \\________________________\
  53.  
  54. if ($Version-eq "5")
  55. {
  56.     #write-host "Windows 7"
  57.     Windows-5
  58. }
  59.     #As long as it is not Windows XP it will call the version for Vista+
  60.     else
  61.     {
  62.         Windows-6
  63.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement