Re: What does this script do?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



That executable isn't on my company laptop but, I did a search on that and
apparently it's a client agent for some network monitoring software that was
used by an outside IT support company that had been hired here.

Thanks

"Pegasus [MVP]" <news@xxxxxxxxxxxxx> wrote in message
news:euHyrL%23JKHA.3632@xxxxxxxxxxxxxxxxxxxxxxx
*** See below.

"JohnB" <jbrigan@xxxxxxxxx> wrote in message
news:%23Ucsk69JKHA.1340@xxxxxxxxxxxxxxxxxxxxxxx
I just started in a new job working as a network admin at a company that
the previous, and only, IT person was fired. So I'm figuring everything
out on my own, unfortunately.
I've dabbled in scripting before, but it's been a long time, and I never
was an expert at it.

There are a lot of scripts on the DCs, it looks like there is one named
for each computer on the network. Can someone take a look at this, I'm
not sure what they're doing.

This is the Machine Startup script:

---------------------------------
Option Explicit
Dim file
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
file =
"\\bd.local\SysVol\bd.local\Policies\{55D19949-91D6-4DB0-A947-DBFFEEAB1290}\Machine\Scripts\Startup\"&WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")&".vbs"
dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(file)) Then
WshShell.Run file, 10, true
Set WshShell = Nothing
End If
It looks to me like the Startup script looks for a vbs file the name of
the computer that it is run on, if it find it, it runs that file, if not
it does nothing.
*** Yes.

And this is one of the many scripts in the same folder

---------------------------------
Option Explicit
dim installMediaPath, installMediaFileName
installMediaPath =
"\\bd.local\SysVol\bd.local\Policies\{55D19949-91D6-4DB0-A947-DBFFEEAB1290}\Machine\Scripts\Startup"
installMediaFileName = "KcsSetup17188355.exe"
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
dim tempDir
tempDir = WshShell.ExpandEnvironmentStrings("%TEMP%")
dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile installMediaPath & "\" & installMediaFileName, tempDir &
"\" & installMediaFileName
*** Copy KcsSetup...exe to the local temp folder.

WshShell.Run tempDir & "\" & installMediaFileName, 10, true
Const HKEY_LOCAL_MACHINE = &H80000002
dim oReg
Set
oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
dim strValue
oReg.GetStringValue HKEY_LOCAL_MACHINE,
"SYSTEM\CurrentControlSet\Services\KaseyaAgent", "ImagePath", strValue
*** Get a string value from the registry. This is presumably
*** an executable that launches Kaseya.

WshShell.Run strValue
*** Launch Kaseya.

Set oReg = Nothing
Set WshShell = Nothing
Set fso = Nothing

---------------------------------
The next script looks like it is copying the KcsSetupxxxx file to the
local drive and executing it. But, after that I'm lost. Is it running a
file that's referenced in the registry?
*** Yes.

I've only been here a few days. And I just turned on a PC that hadn't
been turned on in quite a while, it needed a new power supply. When it
booted up for the first time I noticed it was much slower than what it
should have been, and looked at Task Manager and saw that Wscript was
using a lot of RAM and CPU.
*** See what happens when you launch the executable specified in
*** HKLM\SYSTEM\CurrentControlSet\Services\KaseyaAgent\ImagePath
*** from the console.

And help would be appreciated.

TIA





.



Relevant Pages

  • What does this script do?
    ... I just started in a new job working as a network admin at a company that the ... dim installMediaPath, installMediaFileName ... It looks to me like the Startup script looks for a vbs file the name of the ...
    (microsoft.public.scripting.wsh)
  • Re: What does this script do?
    ... This is the Machine Startup script: ... Set WshShell = Nothing ... dim installMediaPath, installMediaFileName ...
    (microsoft.public.scripting.wsh)
  • RE: export user accounts from NT 4.0 domain
    ... ATTENTION THE SCRIPT MUST BE RUNNED FROM A COMPUTER WHERE EXCEL IS ... from the information in a Microsoft Excel spreadsheet. ... Dim strLast, strFirst, strMiddle, strPW, intRow, intCol ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)
  • Re: Password Expire
    ... We have one fron end Edge server in our DMZ which passes email onto two ... I used to schedule a script to run every 24 hours on my Exchange 2003 ... Dim fso, txtarray, BodyText ... Call ProcessFolder (objContainer, numDays) ...
    (microsoft.public.exchange.admin)
  • Re: LDAP query information
    ... a "Dim" statement. ... execution of the script. ... ' Filter on computer object. ... ' Construct LDAP syntax query. ...
    (microsoft.public.windows.server.scripting)