Open AlexMilotin opened 2 years ago
Wow. Thank you for sharing!
@AlexMilotin - I have spent all weekend doing something Similar - how are you finding it speed wise? - i have got it scanning about 200 boxes in 8 hours.
@AlexMilotin - I have spent all weekend doing something Similar - how are you finding it speed wise? - i have got it scanning about 200 boxes in 8 hours.
I had quite a struggle in running it remotely. The first version using Background jobs took about 8 to 12 hours (depending on the server, when executing it remotely). This version i can happily say that that took 3 hours for my entire infrastructure of 460 servers. The difference seems that was done by creating the jobs in the PSSession as Remote Jobs and then the network factor was not a problem anymore. There are 3 ways you can do it. Measure-Command helped me a lot in find the fastest one.
Give it a try, using -MAXJob parameter and set it to 200. You'll be amazed.
Hi @AlexMilotin - Tried the script - it ran in powershell fine but in the CSV it says it hasnt scanned - have you used a specific version of logpresso? Also in the 1st script are you just copying the EXE or the ps1 aswell?
Hi @ajddba . Yes starting from 2.3.2 and above. The log4j-scan.exe needs to be located on C:\temp on each server
If you want to that in a faster way you can use PS workflow to copy the file. That if you have SMB enabled Place the tool and the vcruntime140.dll in case you're missing VC++ on the servers (since this is a prerequisite) in D:\log4scan\tool\ . The workflow below will copy the 2 files from there to C:\Temp on the servers. Afterwards you can use the script to run it remotely. Be aware that you need at least PS V3.0 on the servers for this to work.
Workflow CopyStuff {
$Computers = gc "D:\log4scan\servers.txt"
$Source = "D:\log4scan\tool\*"
$Destination = "C$\temp\"
foreach -parallel ($Computer in $Computers){
Copy-Item -Path $source -Destination "\\$Computer\$Destination" -Recurse
}
}
CopyStuff
Legend thank you!
Since i've been dealing with a lot of infrastructure without a proper deployment tool and i had to find a way to run the tool on multiple servers at once. Some of people might already found another way, but i feel in debt to at least provide my 2 cent. You can define the variable locations as you please, this is what i used so far.
Copy files to multiple servers -> using PS workflow
I hope it helps someone