Script explain

Any Kixstart Expert to explain this code.

Thank you

Function GetSoftwareInfo($_RemoteMachine)

	DIM $HKLMAppPaths1, $HKLMAppPaths2, $App1, $App2, $Key, $SoftInfo, $Path,$AppName,$AppVer

	DIM $DisplayName, $DisplayVersion, $FileVer, $_Apps[0]

	$HKLMAppPaths1 = '\\'+$_RemoteMachine+'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths'

	If not @ERROR

	$HKLMAppPaths2 = '\\'+$_RemoteMachine+'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'

	$App1=ArrayEnumKey($HKLMAppPaths1)

	$App2=ArrayEnumKey($HKLMAppPaths2)

	For Each $Key In $App1
		$Path = ReadValue($HKLMAppPaths1 + "\" + $Key,"")

		If Len($Path)

      		If InSTR($Path,'%')
				$Path = ExpandEnvironmentVars($Path)
			EndIf

			If InSTR($Path,'"')
				$Path=Split($Path,'"')[1]
			EndIf

			$Path       = IIf(InSTR($Key,'WRITE.EXE'),'',$Path)
      		$Path       = IIf(InSTR($Key,'winzip.exe'),'',$Path)

			If Trim(GetFileVersion($Path,'FileDescription')) <> ""

				If Trim(GetFileVersion($Path,'BinFileVersion'))='0.0.0.0'
					$FileVer = 'FileVersion'
				Else
					$FileVer = 'BinFileVersion'
				EndIf

				If discardApp (Trim($DisplayName))
					$_Apps[UBound($_Apps)]=Trim(GetFileVersion($Path,'FileDescription')) + CHR(42) + $Path + CHR(42) + Trim(GetFileVersion($Path,$FileVer))
					ReDIM preserve $_Apps[UBound($_Apps)+1]
;			        	$SoftInfo = $SoftInfo + Trim(GetFileVersion($Path,'FileDescription')) + CHR(42)
 ;       				   + $Path + CHR(42) + Trim(GetFileVersion($Path,$FileVer)) + @CRLF
				EndIf

			EndIf

		EndIf

	Next
	
;	ReDIM preserve $_Apps[UBound($_Apps)-1]
						
	For Each $Key In $App2

		$DisplayName    = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayName')
		$DisplayVersion = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayVersion')
		$DisplayName    = IIf(InSTR($SoftInfo,$DisplayName),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'ACDSee'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Acrobat 6.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Illustrator'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 5.5'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 6.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 7.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Reader'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Alcohol 120'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Dreamweaver MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Fireworks MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Flash MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'FreeHand MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'LiveReg'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'LiveUpdate'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'MSN Messenger'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Macromedia FreeHand'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Microsoft Office FrontPage'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Microsoft Outlook'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Net2Phone'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'RoboHelp Office'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'SnagIt'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Symantec AntiVirus'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Windows Media Encoder'),'',$DisplayName)

		If Len($DisplayName)

			If Len($DisplayVersion)

				If not discardApp (Trim($DisplayName))
					$_Apps[UBound($_Apps)]=Trim($DisplayName) + CHR(42) + Trim($DisplayVersion)
					ReDIM preserve $_Apps[UBound($_Apps)+1]

;					$SoftInfo = $SoftInfo + Trim($DisplayName) + CHR(42) + Trim($DisplayVersion) + @CRLF
				EndIf

			EndIf

		EndIf

	Next

	EndIf
	
	if ubound($_Apps)>0
		ReDIM preserve $_Apps[UBound($_Apps)-1]
	endif
	$GetSoftwareInfo=$_Apps

EndFunction


Function WMIQuery($what,$where,$_machine)

	;$osname = WMIQuery("Caption","Win32_OperatingSystem",$machine)
	;$sysname = WMIQuery("CSName","Win32_OperatingSystem",$machine)
	;$Manufacturer = WMIQuery("Manufacturer","Win32_OperatingSystem",$machine)
	;$OSVersion = WMIQuery("Version","Win32_OperatingSystem",$machine)
	;$OSBuild = WMIQuery("BuildNumber","Win32_OperatingSystem",$machine)
	;$Language = WMIQuery("OSLanguage","Win32_OperatingSystem",$machine)
	;$ServicePack = WMIQuery("CSDVersion","Win32_OperatingSystem",$machine)
	;$BootDevice = WMIQuery("BootDevice","Win32_OperatingSystem",$machine)
	;$SystemDevice = WMIQuery("SystemDevice","Win32_OperatingSystem",$machine)
	;$WinDir = WMIQuery("WindowsDirectory","Win32_OperatingSystem",$machine)
	;$SysDir = WMIQuery("SystemDirectory","Win32_OperatingSystem",$machine)
	;$LastBoottime = WMIQuery("LastBootupTime","Win32_OperatingSystem",$machine)
	;$OSSerial = WMIQuery("SerialNumber","Win32_OperatingSystem",$machine)
	;$SystemBIOSVer = WMIQuery("SMBIOSBIOSVersion","Win32_BIOS",$machine)
	;$SysBIOSDate = WMIQuery("Version","Win32_BIOS",$machine)
	;$CPUDescription = WMIQuery("description","Win32_Processor",$machine)
	;$MaxClock = WMIQuery("maxclockspeed","Win32_Processor",$machine)
	;$Family = WMIQuery("family","Win32_Processor",$machine)
	;$Stepping = WMIQuery("stepping","Win32_Processor",$machine)
	;$DeviceID = WMIQuery("deviceid","Win32_Processor",$machine)
	;$DiskNames = WMIQuery("name","Win32_LogicalDisk",$machine)
	;$FileSys = WMIQuery("filesystem","Win32_LogicalDisk",$machine)
	;$FreeSpace = WMIQuery("freespace","Win32_LogicalDisk",$machine)
	;$Modem = WMIQuery("Description","Win32_POTSModem",$machine)
	;$LoggedOn= WMIQuery("UserName","Win32_ComputerSystem",$machine)
	;$Printers = WMIQuery("Name","Win32_printer",$machine)
	;For Each $nic In Split(WMIQuery("ProductName","Win32_NetworkAdapter",$machine),"|")
	;	If InSTR($nic,"miniport")=0 and InSTR($nic,"RAS")=0 and InSTR($nic,"Parallel")=0
	;		?$nic
	;		$NicCard = $nic
	;		$Applications = WMIQuery("Caption","Win32_Product",$machine)
	;		$Services = WMIQuery("Caption","Win32_Service",$machine)
	;	EndIf
	;Next

	
	DIM $strQuery, $objEnumerator, $value

	$strQuery = "Select "+$what+" From "+$where
;	$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//"+$_machine)
	$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $_machine + "\root\cimv2")
	
	If not @ERROR
		$objEnumerator = $SystemSet.ExecQuery($strQuery)

	
		For Each $objInstance In $objEnumerator
			
			If @ERROR = 0 and $objInstance <> ""
				$=Execute("$$value = $$objInstance.$what")
				$WMIQuery="$value"+"|"+"$WMIQuery"
			EndIf
		
		Next
		
	Else
		?@ERROR
	EndIf
		
	$WMIQuery=Left($WMIQuery,Len($WMIQuery)-1)
	
EndFunction


Function WMIService ($_What, $_From, optional $_Where,$_Machine)
	
	DIM $strQuery, $objEnumerator, $value,$_Service[0]

	If $_WHere
		$_whereString=" where "+$_where
	EndIf
;	$strQuery = "Select "+$what+" From "+$where
;	$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//"+$_machine)
	$strQuery="Select "+$_What+" from "+$_From+$_wherestring
	$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $_machine + "\root\cimv2")
	
	If not @ERROR
		$objEnumerator = $SystemSet.ExecQuery($strQuery)

	
		For Each $objInstance In $objEnumerator
;			?$objInstance.Name

			If $ObjInstance.Name<>""
				$_Service[UBound($_Service)]=$objInstance.Name
				ReDIM preserve $_Service[UBound($_Service)+1]
			EndIf
		Next

		ReDIM preserve $_Service[UBound($_Service)-1]
	Else
		?@ERROR
	EndIf
		
	$WMIService=$_Service
	
EndFunction

Function discardApp ($AppName)

	DIM $reject
	$IgnoreApp="Hotfix", "Zone DataFile", "Update for Windows", "Windows Defender Signatures", "Windows Genuine Advantage",
		+ "WebFldrs XP", "Norton WMI Update", "MSXML", 'Intel($) Extreme Graphics', "HighMAT Extension To Microsoft Windows XP CD Writing Wizard",
		+ "Debuggin Tools for Windows", "Landesk", "Junk E-mail Reporting Tool", "Microsoft Application Error Reporting",
		+ "SoundMax","Windows Installer","High Definition Audio Driver", "Graphics Media Accelerator Driver","SigmaTel Audio","Windows Rights Management Client"
		+ "Intel(R) Extreme Graphics","Service Pack","Security Update"

	$reject=0

	For Each $Application In $IgnoreApp
		Select
			Case InSTR($AppName,$Application)
				$reject=1
		EndSelect
	Next	

	$discardApp=$reject

EndFunction

Function GetPatchInfo($_RemoteMachine)

	DIM $HKLMAppPaths1, $HKLMAppPaths2, $App1, $App2, $Key, $SoftInfo, $Path,$AppName,$AppVer

	DIM $DisplayName, $DisplayVersion, $FileVer, $_InstalledPatch[0]

	$HKLMAppPaths1 = '\\'+$_RemoteMachine+'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths'

	If not @ERROR

	$HKLMAppPaths2 = '\\'+$_RemoteMachine+'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
	$HKLMAppPaths3 = '\\'+$_RemoteMachine+'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products'

	$App1=ArrayEnumKey($HKLMAppPaths1)

	$App2=ArrayEnumKey($HKLMAppPaths2)
	$App3=ArrayEnumKey($HKLMAppPaths3)

	For Each $Key In $App1
		$Path = ReadValue($HKLMAppPaths1 + "\" + $Key,"")

		If Len($Path)

      		If InSTR($Path,'%')
				$Path = ExpandEnvironmentVars($Path)
			EndIf

			If InSTR($Path,'"')
				$Path=Split($Path,'"')[1]
			EndIf

			$Path       = IIf(InSTR($Key,'WRITE.EXE'),'',$Path)
      		$Path       = IIf(InSTR($Key,'winzip.exe'),'',$Path)

			If Trim(GetFileVersion($Path,'FileDescription')) <> ""

				If Trim(GetFileVersion($Path,'BinFileVersion'))='0.0.0.0'
					$FileVer = 'FileVersion'
				Else
					$FileVer = 'BinFileVersion'
				EndIf

				If GetPatch (Trim($DisplayName))
					$_installedPatch[UBound($_InstalledPatch)]=Trim($DisplayName) + CHR(42) + Trim($DisplayVersion)
					ReDIM preserve $_InstalledPatch[UBound($_InstalledPatch)+1]
				EndIf

			EndIf

		EndIf

	Next

	For Each $Key In $App2

		$DisplayName    = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayName')
		$DisplayVersion = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayVersion')
		$DisplayName    = IIf(InSTR($SoftInfo,$DisplayName),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'ACDSee'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Acrobat 6.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Illustrator'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 5.5'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 6.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 7.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Reader'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Alcohol 120'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Dreamweaver MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Fireworks MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Flash MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'FreeHand MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'LiveReg'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'LiveUpdate'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'MSN Messenger'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Macromedia FreeHand'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Microsoft Office FrontPage'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Microsoft Outlook'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Net2Phone'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'RoboHelp Office'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'SnagIt'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Symantec AntiVirus'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Windows Media Encoder'),'',$DisplayName)

		If Len($DisplayName)

			If Len($DisplayVersion)
				
				If GetPatch (Trim($DisplayName))
					$_installedPatch[UBound($_InstalledPatch)]=Trim($DisplayName) + CHR(42) + Trim($DisplayVersion)
					ReDIM preserve $_InstalledPatch[UBound($_InstalledPatch)+1]
				EndIf

			EndIf

		EndIf

	Next
	
	For Each $Key In $App3

		$HKLMAppPaths4 = '\\'+$_RemoteMachine+'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\'+$key+'\Patches'

		$App4=ArrayEnumKey($HKLMAppPaths4)
		
		For Each $key4 In $app4

		$DisplayName    = ReadValue($HKLMAppPaths4 + "\" + $Key4,'DisplayName')
		$DisplayVersion = 1
		$DisplayName    = IIf(InSTR($SoftInfo,$DisplayName),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'ACDSee'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Acrobat 6.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Illustrator'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 5.5'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 6.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Photoshop 7.0'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Adobe Reader'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Alcohol 120'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Dreamweaver MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Fireworks MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Flash MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'FreeHand MX'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'LiveReg'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'LiveUpdate'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'MSN Messenger'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Macromedia FreeHand'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Microsoft Office FrontPage'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Microsoft Outlook'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Net2Phone'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'RoboHelp Office'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'SnagIt'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Symantec AntiVirus'),'',$DisplayName)
		$DisplayName    = IIf(InSTR($DisplayName,'Windows Media Encoder'),'',$DisplayName)

;		?$displayname
		If Len($DisplayName)

			If Len($DisplayVersion)
				
				If GetPatch (Trim($DisplayName))
;					?Trim($DisplayName) + CHR(42) + Trim($DisplayVersion)
;					?$_installedPatch[UBound($_InstalledPatch)]
					$_installedPatch[UBound($_InstalledPatch)]=Trim($DisplayName) + CHR(42) + Trim($DisplayVersion)
					ReDIM preserve $_InstalledPatch[UBound($_InstalledPatch)+1]
;					$SoftInfo = $SoftInfo + Trim($DisplayName) + CHR(42) + Trim($DisplayVersion) + @CRLF
				EndIf

			EndIf

		EndIf
		Next

	Next
	


	EndIf
	ReDIM preserve $_InstalledPatch[UBound($_InstalledPatch)-1]
	
	$GetPatchInfo=$_InstalledPatch

EndFunction


Function GetPatch ($AppName)

	DIM $reject
	$IgnoreApp="Hotfix", "Update for Windows","Service Pack","Security Update","Update for Office"

	$reject=0

	For Each $Application In $IgnoreApp
		Select
			Case InSTR($AppName,$Application)
				$reject=1
		EndSelect
	Next	

;	?$appname+" - "+$reject
	$GetPatch=$reject

EndFunction

function IsLaptop ($_ComputerName)
	$WinMGT=GetObject("winmgmts:\\"+$_ComputerName+"\root\cimv2")

	If @ERROR
		? "Could not contact " $_ComputerName
	Else

		$Chassis = $WinMgt.ExecQuery("Select ChassisTypes from Win32_SystemEnclosure")
		$audited=0

		For Each $_item In $Chassis
			?"Chassis Type Num = " + $_item.ChassisTypes(0)
			$_ChassisType=EchoType($_item.ChassisTypes(0))
			If $_ChassisType<>""
				select
					case $_ChassisType="Portable"
						?"  This machine is a "+$_ChassisType
						$isLaptop=1
					case $_ChassisType="Laptop"
						?"  This machine is a "+$_ChassisType
						$isLaptop=1
					case $_ChassisType="Notebook"
						?"  This machine is a "+$_ChassisType
						$isLaptop=1
					case $_ChassisType="Hand Held"
						?"  This machine is a "+$_ChassisType
						$isLaptop=1
					case $_ChassisType="Docking Station"
						?"  This machine is a "+$_ChassisType
						$isLaptop=1	
				endselect
			EndIf
		Next
	EndIf
endfunction

function EchoType ($_type)

select
    Case $_type=1 $strChassis = "Maybe Virtual Machine"
    Case $_type=2 $strChassis = "??"
    Case $_type=3 $strChassis = "Desktop"
    Case $_type=4 $strChassis = "Thin Desktop"
    Case $_type=5 $strChassis = "Pizza Box"
    Case $_type=6 $strChassis = "Mini Tower"
    Case $_type=7 $strChassis = "Full Tower"
    Case $_type=8 $strChassis = "Portable"
    Case $_type=9 $strChassis = "Laptop"
    Case $_type=10 $strChassis = "Notebook"
    Case $_type=11 $strChassis = "Hand Held"
    Case $_type=12 $strChassis = "Docking Station"
    Case $_type=13 $strChassis = "All in One"
    Case $_type=14 $strChassis = "Sub Notebook"
    Case $_type=15 $strChassis = "Space-Saving"
    Case $_type=16 $strChassis = "Lunch Box"
    Case $_type=17 $strChassis = "Main System Chassis"
    Case $_type=18 $strChassis = "Lunch Box"
    Case $_type=19 $strChassis = "SubChassis"
    Case $_type=20 $strChassis = "Bus Expansion Chassis"
    Case $_type=21 $strChassis = "Peripheral Chassis"
    Case $_type=22 $strChassis = "Storage Chassis" 
    Case $_type=23 $strChassis = "Rack Mount Unit"
    Case $_type=24 $strChassis = "Sealed-Case PC" 
endselect

?$strChassis
$EchoType= $strChassis

endfunction


Function IsProcessRunning($fnStrServer, $fnStrProcess,optional $fnOwner )
    Dim $Process, $strObject
	
    $IsProcessRunning = "False"
	$strObject = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $fnStrServer + "\root\cimv2")
	$fnQuery="Select * from win32_process where caption="+$fnStrProcess
	$ProcessObj=$strObject.ExecQuery("Select * from win32_process")
	;$ProcessObj=$strObject.ExecQuery($fnQuery)
	
	$count=0
	for each $process in $processObj
	
		if $process.caption=$fnStrProcess
			$getowner=$process.GetOwner()
			
			if $fnOwner<>""
				if $getowner=1
					?$process.caption+" run by "+$fnOwner
					$IsProcessRunning = "True"
				endif
			else
				$IsProcessRunning="True"
			endif
		endif
	next

EndFunction

Function IsProcessRunningMoreThanOnce($fnStrServer, $fnStrProcess,optional $fnOwner,optional $fnThreshold)
    Dim $Process, $strObject
	
	if $fnThreshold=""
		?$fnThreshold=1
	endif
	
    $IsProcessRunningMoreThanOnce = "False"
	$strObject = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $fnStrServer + "\root\cimv2")
;	$fnQuery="Select * from win32_process where caption="+$fnStrProcess
	$ProcessObj=$strObject.ExecQuery("Select * from win32_process")
;	$ProcessObj=$strObject.ExecQuery($fnQuery)
	
	$count=0
	for each $process in $processObj
	
		if $process.caption=$fnStrProcess
			if $fnOwner
				$getowner=$process.ExecMethod_("GetOwner").User
				if $getowner=$fnOwner
		;			?$process.caption+" run by "+$fnOwner
					$count=$count+1
				endif
			else
				$count=$count+1
			endif
		endif
	next

	;?"count="+$count
		if $count>$fnThreshold
			$IsProcessRunningMoreThanOnce = "True"
		endif
EndFunction


function SvcStatus ($fnMachine, $fnSvcName, $fnStatus)

;	?'sc \\'+$fnMachine+' query "'+$fnSvcName+'"|find /i "'+$fnStatus+'"'
	shell 'cmd /c sc \\'+$fnMachine+' query "'+$fnSvcName+'"|find /i "'+$fnStatus+'">NUL'
	
	if @error=0
		$SvcStatus=1
	else
		$SvcStatus=0
	endif

endfunction

function GetService ($fnMachine)
	Dim $fnSvcList[0]
	if exist ("%tmp%\Service.txt")
		del "%tmp%\Service.txt"
	endif
	
	shell 'cmd /c sc \\'+$fnMachine+' query state= all|find /i "SERVICE_NAME" > %tmp%\Service.txt'
	
	$_=open(9,"%tmp%\Service.txt")

	$fnSVCList[ubound($fnSVCList)]=readline(9)

	do
		redim preserve $fnSVCList[ubound($fnSVCList)+1]
		$fnSVCList[ubound($fnSVCList)]=readline(9)		
	until @error=-1
	
	if ubound ($fnSVCList)>0
		redim preserve $fnSVCList[ubound($fnSVCList)-1]
	endif

	del "%tmp%\Service.txt"
	$GetService=$fnSVCList
	$_=close(9)
endfunction

function SvcAccount($fnMachine,$fnSvcName)
	$fnAcctName="%tmp%\SvcAccount.txt"
	if exist ($fnAcctName)
		del $fnAcctName
	endif
	
	shell 'cmd /c sc \\'+$fnMachine+' qc "'+$fnSvcName+'" |find /i "SERVICE_START_NAME">%tmp%\SvcAccount.txt'
	
	if @error=0
		$_=open(9,$fnAcctName)
		$fnTmp=readline(9)
		$_=close (9)
		
		$fnSVCAccount=split($fnTMP,": ")
		
		if ubound($fnsvcAccount)>0
			$SvcAccount=$fnSVCAccount[1]
		endif
		
	endif
	
	del $fnAcctName
	
endfunction


function SvcAction($fnServer,$fnService,$fnAction, optional $fnTimeOut)

	if $fnTimeOut=""
		$fnTimeOut=300
;		$fnTimeOut=60
	endif
	
	shell 'cmd /c sc \\'+$fnServer+' getdisplayname '+$fnService+'>"%tmp%\svcName.txt"'

	$_=open(7,"%tmp%\svcName.txt")
	$fnTMPLine=readline(7)

	if instr ($fnTMPLine,"=")
		$fnTMP=split($fnTMPLine,"= ")
		$fnServiceName=$fnTMP[1]
	else
		$fnServiceName=$fnService
	endif

	$_=close(7)
	
	del "%tmp%\svcname.txt"	
	
	if $fnAction="Start"
		shell 'cmd /c sc \\'+$fnServer+' start "'+$fnService+'" >NUL'
		sleep 10

		$fntmpSvcStatus=0
		$fntimeStamp=0

		do
			$fntmpSvcStatus=1
			
			if not svcStatus($fnServer,$fnService,"running")
				$fntmpSvcStatus=0
;				$fntimeStamp=$fntimeStamp+5
				if svcStatus($fnServer,$fnService,"START_PENDING")
					?$fnServer+": "+$fnServiceName+" - still starting."
				else
					?$fnServer+": "+$fnServiceName+" - Retrieving status."
;					$fntimeStamp=$fntimeStamp
				endif
									
				sleep 5
				$fntimeStamp=val($fntimeStamp)+5
			
			else
				?$fnServiceName+" - Started"			
			endif
			
			?"  "+$fnServer+" Current Time: "+val($fntimeStamp)
			?"  "+$fnServer+" TimeOut Time: "+$fntimeout
			
		until val($fnTimeStamp)>=$fntimeOut or $fntmpSvcStatus=1
		
		if $fntmpSvcStatus=1
			$SVCAction=1
		else
			$SVCAction=0
		endif
		
	endif

	if $fnAction="Stop"
		shell 'cmd /c sc \\'+$fnServer+' stop "'+$fnService+'" >NUL'
		sleep 7
		$fntimeStamp=0
					
		do
			$fntmpSvcStatus=1
				
			if not svcStatus($fnServer,$fnService,"stopped")
				$fntmpSvcStatus=0
				if svcStatus($fnServer,$fnService,"STOP_PENDING")
					?$fnServiceName+" - still stopping."
				else
					?$fnServiceName+" - retrieving status."
				endif
							
				sleep 5
				$fntimeStamp=val($fntimeStamp)+5

			else
				?$fnServiceName+" - Stopped"
			endif
				?"  "+$fnServer+" Current Time: "+val($fnTimeStamp)
				?"  "+$fnServer+" TimeOut Time: "+$fntimeout
														
		until val($fnTimeStamp)>=$fntimeOut or $fntmpSvcStatus=1
		
		if $fntmpSvcStatus=1
			$SVCAction=1
		else
			$SVCAction=0
		endif
		
	endif

	
endfunction

function GetOwner ($fnMachine)

	$fnCompLDAP=OtherADObject("dNSHostName="+$fnMachine+"."+%userdnsdomain%)
	$fnCompObj=getObject($fnCompLDAP[0])
	$fnowner=$fnCompObj.managedBy
	if $fnowner<>"" and not instr ($fnowner,"anonymous")
		$fnUserLDAP=OtherADObject("distinguishedName="+$fnowner)
		$GetOwner=$fnUserLDAP[0]
	endif
		
endfunction


function StartSiebelServices ($fnSiebelData, $fnSiebelPS,optional $fnStartupScript)

	$fnTimeLimit=600
	$fnblat="\\Mydomain.corp\NETLOGON\HQ\Scripts\blat.exe"				; commandline email utility
	$fnOBPSSvc="sawsvc" ; oracle presentation server service name
	$fnOrcJavaHostsvc="sawjavahostsvc" ; oracle java host service name
	$fnOC4Jsvc="OC4J"  ; oc4j service name
	$fnOrcSrvSvc="Oracle BI Server"	;oracle bi service name
	$fnOrcSchedSvc="Oracle BI Scheduler" ; oracle sched  service name
	$fnFrom="DoNotReply@@Mydomain.com"
;	$fnTo="Siebel_Alert@@Mydomain.com"
	$fnTo="Siebel_Alert@@Mydomain.com"
	$fnSiebelLogFolder="c:\Program Files\Mydomain Tools\Logs"

	if not exist ($fnSiebelLogFolder)
		md $fnSiebelLogFolder 
	endif
	
	$fnSiebelLog=$fnSiebelLogFolder+"\SiebelServices.log"
	
	$_=open(9,$fnSiebelLog,5)
	
	$_=writeline(9,@date+" "+@time+chr(9)+@crlf)
	
	if $fnSiebelData<>$fnSiebelPS
		$_=writeline(9,@date+" "+@time+chr(9)+"Starting Siebel Services on "+$fnSiebelData+" and "+$fnSiebelPS+"."+@crlf)
	else
		$_=writeline(9,@date+" "+@time+chr(9)+"Starting Siebel Services on "+$fnSiebelData+"."+@crlf)
	endif
	
	if $fnSiebelData<>$fnSiebelPS and $fnSiebelPS<>""
		$fnServiceOrder=$fnorcSrvSvc,$fnOrcJavaHostsvc,$fnOrcSchedSvc,$fnorcJavaHostsvc,$fnOBPSSvc
	else
		$fnServiceOrder=$fnorcSrvSvc,$fnOrcJavaHostsvc,$fnOBPSSvc,$fnOrcSchedSvc
	endif

	$fnTimeOut=0

	if $fnStartupScript<>2
		?"Checking the status of "+$fnSiebelData+"."
		$_=writeline(9,@date+" "+@time+chr(9)+"Checking the status of "+$fnSiebelData+"."+@crlf)
	
		do
			$fnServerStatus=0
	
			if ping ($fnSiebelData)
				?$fnSiebelData+" is online."
				$_=writeline(9,@date+" "+@time+chr(9)+$fnSiebelData+" is online."+@crlf)
			
				if $fnStartupScript<>1
					if ping ($fnSiebelPS)
						?$fnSiebelPS+" is online."
						$_=writeline(9,@date+" "+@time+chr(9)+$fnSiebelPS+" is online."+@crlf)
						$fnServerStatus=1
					else
						?"Waiting for "+$fnSiebelPS+" to come online."
						$_=writeline(9,@date+" "+@time+chr(9)+"Waiting for "+$fnSiebelPS+" to come online."+@crlf)
						sleep 5
						$fnTimeOut=$fnTimeOut+5
					endif
				else
					$fnServerStatus=1
				endif
			else
				?"Waiting for "+$fnSiebelData+" to come online."
				$_=writeline(9,@date+" "+@time+chr(9)+"Waiting for "+$fnSiebelData+" to come online."+@crlf)
				sleep 5
				$fnTimeOut=$fnTimeOut+5
			endif
			
		until $fnTimeOut>$fnTimeLimit or $fnServerStatus=1
	else 
		$fnServerStatus=1
	endif
		
	if $fnServerStatus=1

		$fnTmpSvcStatus=1
		$fnJ=2
		
		if $fnStartupScript<>2
		
			for $fnI=0 to $fnJ
				if $fnTmpSvcStatus=1
					?"Starting "+$fnServiceOrder[$fnI]+" on "+$fnSiebelData
					$_=writeline(9,@date+" "+@time+chr(9)+"Starting "+$fnServiceOrder[$fnI]+" on "+$fnSiebelData+@crlf)
					if SvcStatus($fnSiebelData,$fnServiceOrder[$fnI],"Stopped")
						$fnTmpSvcStatus=SvcAction($fnSiebelData,$fnServiceOrder[$fnI],"Start")
					else
						?$fnServiceOrder[$fnI]+" on "+$fnSiebelData+" is already running."
						$_=writeline(9,@date+" "+@time+chr(9)+$fnServiceOrder[$fnI]+" on "+$fnSiebelData+" is already running."+@crlf)
					endif
				else
					?"Error starting "+$fnPrevService+"."
					$_=writeline(9,@date+" "+@time+chr(9)+"Error starting "+$fnPrevService+"."+@crlf)
				endif
					
				$fnPrevService=$fnServiceOrder[$fnI]
			next
			
		else
			?$fnTmpSvcStatus=1
		endif
				
		if $fnTmpSvcStatus=1 and $fnStartupScript<>1
			$fnTimeOut=0
			$fnServerStatus=0

			if $fnSiebelData<>$fnSiebelPS
				?"Checking the status of "+$fnSiebelData+" service."
				$_=writeline(9,@date+" "+@time+chr(9)+"Checking the status of "+$fnSiebelPS+"."+@crlf)
			
				do
					$fnServerStatus=0
	
					if ping ($fnSiebelData) and svcStatus($fnSiebelData,$fnOrcSrvSvc,"running") and svcStatus($fnSiebelData,$fnOrcJavaHostsvc,"running") and svcStatus($fnSiebelData,$fnOC4Jsvc,"running") ;and  svcStatus($ThisBIServer,$OrcSchedSvc,"running")=1 
						?$fnSiebelData+" is online and all services running."
						$_=writeline(9,@date+" "+@time+chr(9)+$fnSiebelData+" is online and all services running."+@crlf)
						$fnServerStatus=1
					else
						?"Waiting for "+$fnSiebelData+" to come online."
						$_=writeline(9,@date+" "+@time+chr(9)+"Waiting for "+$fnSiebelData+" to come online."+@crlf)
						sleep 5
						$fnTimeOut=$fnTimeOut+5
					endif

				until $fnTimeOut>$fnTimeLimit or $fnServerStatus=1

				$fnTimeOut=0
				$fnServerStatus=0
			
				do
					$fnServerStatus=0
	
					if ping ($fnSiebelPS)
						?$fnSiebelPS+" is online."
						$_=writeline(9,@date+" "+@time+chr(9)+$fnSiebelPS+" is online and all services running."+@crlf)
						$fnServerStatus=1
					else
						?"Waiting for "+$fnSiebelPS+" to come online."
						$_=writeline(9,@date+" "+@time+chr(9)+"Waiting for "+$fnSiebelPS+" to come online."+@crlf)
						sleep 5
						$fnTimeOut=$fnTimeOut+5
					endif

				until $fnTimeOut>$fnTimeLimit or $fnServerStatus=1
				
			endif
			
			if $fnServerStatus=1
					
				$fnTmpSvcStatus=1
				$fnJ=ubound($fnServiceOrder)
						
				for $fnI=3 to $fnJ
				
					if $fnTmpSvcStatus=1
						if SvcStatus($fnSiebelPS,$fnServiceOrder[$fnI],"Stopped")
							?"Starting "+$fnServiceOrder[$fnI]+" on "+$fnSiebelPS
							$_=writeline(9,@date+" "+@time+chr(9)+"Starting "+$fnServiceOrder[$fnI]+" on "+$fnSiebelPS+@crlf)
							$fnTmpSvcStatus=SvcAction($fnSiebelPS,$fnServiceOrder[$fnI],"Start")
						else
							?$fnServiceOrder[$fnI]+" on "+$fnSiebelPS+" is already running."
							$_=writeline(9,@date+" "+@time+chr(9)+$fnServiceOrder[$fnI]+" on "+$fnSiebelPS+" is already running."+@crlf)
						endif
					else
						?"Error starting "+$fnPrevService+"."
						$_=writeline(9,@date+" "+@time+chr(9)+"Error starting "+$fnPrevService+"."+@crlf)
					endif
					
					$fnPrevService=$fnServiceOrder[$fnI]
					
				next

			endif					

		endif
				
	endif
	
	if svcStatus($fnSiebelData,$fnOrcSrvSvc,"running") and svcStatus($fnSiebelData,$fnOrcJavaHostsvc,"running") and svcStatus($fnSiebelData,$fnOC4Jsvc,"running") and svcStatus($fnSiebelPS,$fnOrcJavaHostsvc,"running") and svcStatus($fnSiebelPS,$fnOBPSSvc,"running")
		?"All services started."
		$_=writeline(9,@date+" "+@time+chr(9)+"All services started."+@crlf)
		$StartSiebelServices=1
	else
		?"!!! Error starting services.  Please check the log."
		?"Log File: "+$fnSiebelLog
		$_=writeline(9,@date+" "+@time+chr(9)+"!!! Error starting services.  Please check the log."+@crlf)
		
		if $fnSiebelData<>$fnSiebelPS
			$fnsubject="Siebel Service Start: Siebel Services failed to start on "+$fnSiebelData+"/"+$fnSiebelPS+"."
			$fnmessage="One or more Siebel services failed to start.  Please check the log file on "+@wksta+".  The log path is "+@crlf+@crlf+$fnSiebelLog
			$_=sendmail($fnTo,$fnfrom,$fnsubject,$fnmessage)
		else
			$fnsubject="Siebel Service Start: Siebel Services failed to start on "+$fnSiebelData+"."
			$fnmessage="One or more Siebel services failed to start.  Please check the log file on "+@wksta+".  The log path is "+@crlf+@crlf+$fnSiebelLog
			$_=sendmail($fnTo,$fnfrom,$fnsubject,$fnmessage)
		endif

		$StartSiebelServices=0
		
	endif
	
	$_=close(9)

	
endfunction


function StopSiebelServices ($fnSiebelData, $fnSiebelPS)

	$fnTimeLimit=300
	$fnblat="\\Mydomain.corp\NETLOGON\HQ\Scripts\blat.exe"				; commandline email utility
	$fnOBPSSvc="sawsvc" ; oracle presentation server service name
	$fnOrcJavaHostsvc="sawjavahostsvc" ; oracle java host service name
	$fnOC4Jsvc="OC4J"  ; oc4j service name
	$fnOrcSrvSvc="Oracle BI Server"	;oracle bi service name
	$fnOrcSchedSvc="Oracle BI Scheduler" ; oracle sched  service name
	$fnFrom="DoNotReply@@Mydomain.com"
;	$fnTo="Siebel_Alert@@Mydomain.com"
	$fnTo="blee@@Mydomain.com"
	$fnSiebelLogFolder="c:\Program Files\Mydomain Tools\Logs"

	if $fnSiebelData<>$fnSiebelPS and $fnSiebelPS<>""
		$fnServiceOrder=$fnOBPSSvc,$fnOrcJavaHostsvc,$fnOrcSchedSvc,$fnOrcJavaHostsvc,$fnorcSrvSvc
	else
		$fnServiceOrder=$fnOBPSSvc,$fnOrcSchedSvc,$fnOrcJavaHostsvc,$fnorcSrvSvc
	endif

	if not exist ($fnSiebelLogFolder)
		md $fnSiebelLogFolder 
	endif
	
	$fnSiebelLog=$fnSiebelLogFolder+"\SiebelServices.log"
	
	$_=open(9,$fnSiebelLog,5)
	
	$_=writeline(9,@date+" "+@time+chr(9)+@crlf)
	
	if $fnSiebelData<>$fnSiebelPS
		$_=writeline(9,@date+" "+@time+chr(9)+"Stopping Siebel Services on "+$fnSiebelData+" and "+$fnSiebelPS+"."+@crlf)
	else
		$_=writeline(9,@date+" "+@time+chr(9)+"Stopping Siebel Services on "+$fnSiebelData+"."+@crlf)
	endif
	
	$fnTimeOut=0
	
	$fnTmpSvcStatus=1
	
	if $fnSiebelData<>$fnSiebelPS
		$fnJ=1
	else
		$fnJ=3
	endif
		
	$fnNStatus=NemoHostStatus($fnSiebelPS)
	if $fnNStatus=1 or $fnNStatus=2
		$_=NemoHostMaintenance($fnSiebelPS,"30")
	endif
	
	$fnNStatus=0
	
	for $fnI=0 to $fnJ
		if SvcStatus($fnSiebelPS,$fnServiceOrder[$fnI],"running")
			?"Stopping "+$fnServiceOrder[$fnI]+" on "+$fnSiebelPS
			$_=writeline(9,@date+" "+@time+chr(9)+"Checking the status of "+$fnSiebelPS+"."+@crlf)
			$fnTmpSvcStatus=SvcAction($fnSiebelPS,$fnServiceOrder[$fnI],"Stop")
		else
			$fnTmpSvcStatus=1
			?$fnServiceOrder[$fnI]+" on "+$fnSiebelPS+" is not running."
			$_=writeline(9,@date+" "+@time+chr(9)+$fnServiceOrder[$fnI]+" on "+$fnSiebelPS+" is not running."+@crlf)
		endif
	next
				
	$fnTmpSvcStatus=1
		
	if $fnTmpSvcStatus=1 and $fnSiebelData<>$fnSiebelPS
		$fnTimeOut=0
		$fnServerStatus=0
					
		?"Checking the status of "$fnSiebelData+"."
		$_=writeline(9,@date+" "+@time+chr(9)+"Checking the status of "+$fnSiebelData+"."+@crlf)
				
;		do
;			$fnServerStatus=0
	
;			if ping ($fnSiebelData) and svcStatus($fnSiebelData,$fnOrcSrvSvc,"stopped") and svcStatus($fnSiebelData,$fnOrcJavaHostsvc,"stopped") and svcStatus($fnSiebelData,$fnOC4Jsvc,"stopped") ;and  svcStatus($ThisBIServer,$OrcSchedSvc,"running")=1 
;				?$fnSiebelData+" is online and all services stopped."
;				$_=writeline(9,@date+" "+@time+chr(9)+$fnSiebelData+" is online and all services stopped."+@crlf)
;				$fnServerStatus=1
;			else
;				?"Waiting for "+$fnSiebelData+" to come online."
;				$_=writeline(9,@date+" "+@time+chr(9)+"Waiting for "+$fnSiebelData+" services to stop."+@crlf)
;				sleep 5
;				$fnTimeOut=$fnTimeOut+5
;			endif
;		until $fnTimeOut>$fnTimeLimit or $fnServerStatus=1
				
		$fnServerStatus=1
		
		if $fnServerStatus=1
				
			$fnTmpSvcStatus=1
			$fnJ=ubound($fnServiceOrder)

			$fnNStatus=NemoHostStatus($fnSiebelDATA)
			if $fnNStatus=1 or $fnNStatus=2	
				$_=NemoHostMaintenance($fnSiebelDATA,"30")
			endif
			
			for $fnI=2 to $fnJ
				if SvcStatus($fnSiebelDATA,$fnServiceOrder[$fnI],"running")
					?"Stopping "+$fnServiceOrder[$fnI]+" on "+$fnSiebelDATA
					$_=writeline(9,@date+" "+@time+chr(9)+"Stopping "+$fnServiceOrder[$fnI]+" on "+$fnSiebelDATA+@crlf)
					$fnTmpSvcStatus=SvcAction($fnSiebelDATA,$fnServiceOrder[$fnI],"Stop")
				else
					?$fnServiceOrder[$fnI]+" on "+$fnSiebelDATA+" is not running."
					$_=writeline(9,@date+" "+@time+chr(9)+$fnServiceOrder[$fnI]+" on "+$fnSiebelDATA+" is not running."+@crlf)
				endif
			next
			
		endif					
			
	endif

	sleep 6
	if svcStatus($fnSiebelData,$fnOrcSrvSvc,"Stopped") and svcStatus($fnSiebelData,$fnOrcJavaHostsvc,"Stopped") and svcStatus($fnSiebelData,$fnOrcSchedSvc,"Stopped") and svcStatus($fnSiebelPS,$fnOrcJavaHostsvc,"Stopped") and svcStatus($fnSiebelPS,$fnOBPSSvc,"Stopped")
		?"All services Stopped."
		$_=writeline(9,@date+" "+@time+chr(9)+"All services Stopped."+@crlf)
	else
		?"!!! Error stopping services.  Please check the log."
		?"Log File: "+$fnSiebelLog
		$_=writeline(9,@date+" "+@time+chr(9)+"!!! Error stopping services.  Please check the log."+@crlf)
		
		if $fnSiebelData<>$fnSiebelPS
			$fnsubject="Siebel Service Start: Siebel Services failed to stop on "+$fnSiebelData+"/"+$fnSiebelPS+"."
			$fnmessage="One or more Siebel services failed to stop.  Please check the log file on "+@wksta+".  The log path is "+@crlf+@crlf+$fnSiebelLog
			$_=sendmail($fnTo,$fnfrom,$fnsubject,$fnmessage)
		else
			$fnsubject="Siebel Service Start: Siebel Services failed to stop on "+$fnSiebelData+"."
			$fnmessage="One or more Siebel services failed to stop.  Please check the log file on "+@wksta+".  The log path is "+@crlf+@crlf+$fnSiebelLog
			$_=sendmail($fnTo,$fnfrom,$fnsubject,$fnmessage)
		endif
		
	endif

	$_=close(9)
	$fnNStatus=0
	
endfunction

Open in new window

jskfanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
What exactly do you need to know?  Have you run it or tried to use it?
The first function is about getting version and path information of installed programs on the specified computer.

The other functions as I've scrolled down relate to querying user, computer information (including services running) in a windows network.
0
jskfanAuthor Commented:
the scripts posted in separate questions, are located in our network, we want to know what they are used for and what they exactly do, in order to decide if we will remove them or leave them.
0
RobOwner (Aidellio)Commented:
So like I said before they are for querying computer and user information of your windows computers.  I would keep this script in case you need more information about your computers, unless you've got a system such as Lansweeper that will do it for you.

They are just functions.  Nothing is actually ever run.  Is there another script that actually calls these functions?
0
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

jskfanAuthor Commented:
http://www.experts-exchange.com/Programming/Languages/Scripting/Q_28270146.html

in this link
that s the master script that calls 3 scripts that I have attached to the master script.
0
jskfanAuthor Commented:
http://www.experts-exchange.com/Programming/Languages/Scripting/Q_28270146.html
I attached 3 files which are basically the scripts I individually posted in separate questions in EE.
0
RobOwner (Aidellio)Commented:
So let's just take a step back for a sec. What made you question these scripts?
0
jskfanAuthor Commented:
Those scripts run in our network. We need to document what they do.
they have been used by a user that has been terminated.

we do not want to reinvent the wheels, but we want to be safe and know what thing are doing, for future troubleshooting.

example: what if the script has no impact on anyone, but it does not need to be applied for someone else. we would not know that specific script is the one who prevented someone else to do his work......Just an example.
0
RobOwner (Aidellio)Commented:
ok now that makes sense... you would want to make sure these scripts are legitimate and not doing anything else other than documenting your network.

It does look like it was just an easy way for the employee to document the computers on your network for easy management.

Is there anything in the scripts that concerns you?

If you are wanting someone to say these scripts are ok to use then it would be worth hiring a professional to test these scripts within your network.  I can only give you an indication of what the scripts are intending to do.
0
RobOwner (Aidellio)Commented:
From the number of other questions you have open on this topic I would strongly suggest getting an expert in to analyse these in context with your network.  
The ones that concern me are the scripts that copy profile files back and forth, edit registry settings and install VNC, a remote desktop type application so that you can assist and view any of the computers remotely, to name a few.
You need to determine why (not just what) the scripts are being used in your environment.  I don't really feel comfortable commenting on something without knowing the environment in which they're being used.
0
jskfanAuthor Commented:
let me give you an example.

Let s say there is Script1 that maps drives, but  it is written in a language that I am not familiar with it just like I am not familiar with Kix.

one of the user will complain about he does not get the drives mapped.
So among the scripts that get applied to his account when he logs in, i would not be able to pinpoint which script is used for mapping drives and which one is used for something else, if I do not understand each script what it does..
That was just an example


I thought with Kix expert we can get some clues about the exiting Kix scripts, and in the future we 'll use scripts written in language we are familiar with.

makes sense ?
0
RobOwner (Aidellio)Commented:
Yes it makes sense and I've been in your position! :) very frustrating i know!

So essentially this script has functions only that are obviously referenced from one of your other scripts.  It's content is as I've described in http:#a39586530
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.