Page 1 of 1 1
Topic Options
#157096 - 2006-02-13 04:43 AM Mcafee EPO
rwani Offline
Fresh Scripter

Registered: 2002-11-10
Posts: 20
Loc: Houston
Hello

I need to write a script to install EPO agent on workstations. What I need is for the script to:

1.Check to confirm that workstation does not belong to RESERACH OU.
2. Check if epo agent is already installed. If Yes than do nothing.
3. If agent is not installed than install the agent.

Thanks for your help.

Top
#157097 - 2006-02-13 05:15 AM Re: Mcafee EPO
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There is an InContainer() UDF to determine OU.

Look for the file to indicate ePO is already installed:
\Documents and Settings\All Users\Application Data\Network Associates\Common Framework\LastPropsSentToServer.xml

Install with:
\\server\share\FramePkg.exe /install=agent /forceinstall
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157098 - 2006-02-14 04:40 PM Re: Mcafee EPO
rwani Offline
Fresh Scripter

Registered: 2002-11-10
Posts: 20
Loc: Houston
Thanks for the post. I read about Incontainer UDF. Can I use the following statement:

if not incontainer("OU=Research,DC=cs,DC=utexas,DC=edu", "Computer")
\\server\share\FramePkg.exe /install=agent /forceinstall

endf

What I want to accomplish is to prevent the installation of epo agent on any computers in RESERACH OU including and sub OU's under reserach.

Domain: cd.utexas.edu(cs is the child domain under utexas)
RESERACH: OU with sub OU's containg research computers.

Full Script:

If exist c:\document and settings\all users\application data\network associates\common framework\lastpropsSentToserver.xml

Goto End_script

end if

if not incontainer("OU=Research,DC=cs,DC=utexas,DC=edu", "Computer")

\\server\share\FramePkg.exe /install=agent /forceinstall

end if

:End_Script

Top
#157099 - 2006-02-15 02:37 PM Re: Mcafee EPO
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Use (untested)


Code:
Break on
if not exist ("c:\document and settings\all users\application data\network associates\common framework\lastpropsSentToserver.xml")
if incontainer("OU=Research,DC=cs,DC=utexas,DC=edu", "Computer") = 0

shell "\\server\share\FramePkg.exe /install=agent /forceinstall"
endif
endif



Edited by Howard Bullock (2006-02-15 02:41 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#157100 - 2006-02-15 02:48 PM Re: Mcafee EPO
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Not like Howard to mess up on his own UDF.
Hint: it returns an array.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157101 - 2006-02-15 02:52 PM Re: Mcafee EPO
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Another hint:
[0]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157102 - 2006-02-16 10:31 PM Re: Mcafee EPO
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Sorry for the confusion. Yes the version 1 of the UDF returns an array. Version 2 which I use in my environment now does not.

Both TranslateName() and Incontainer() have been re-written to avoid all the roundtrips to the AD that version 1 caused. This was a pain for Radimus. I really nee to update both the TranslateName() and Incontainer() threads.


Since these UDFs in the version 1 form seem to be used by many, would you recommend preserving the original thread and updating or creating something new?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#157103 - 2006-02-16 10:36 PM Re: Mcafee EPO
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ja, I too rewrote your UDF and sometimes catch myself using my optional parms.
I think you should post new topics and put a note in the old ones that they are deprecated.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157104 - 2006-03-27 10:02 PM Re: Mcafee EPO
rwani Offline
Fresh Scripter

Registered: 2002-11-10
Posts: 20
Loc: Houston
Ok I am trying the following and it is not working. Script works great if I take the incontainer part out. I am using primal script. HELP!!!!!

Cls

;VARIABLES

;Agentinstall command
$agent = "\\msghostepo\epo\framepkg.exe /INSTALL=Agent /instdir=" + Chr(34) + "\Network Associates\Common Framework" + Chr(34) + " /s"
; Agentlog path
$agentlog = "\\msghostepo\epologs\logfiles"
; Set Agent registry key
$ikey="HKEY_LOCAL_MACHINE\Software\Network Associates\ePolicy Orchestrator\Application Plugins\EPOAGENT3000"
; Set current agent version
$curversion = "3.5.0.513"

$rc2 = incontainer("OU=Research,DC=cs,DC=utexas,DC=edu", "Computer")

If $rc2[0] = 0


;SCRIPT

; Check if registry key exists
IF (keyexist($ikey) = 1)
$version=ReadValue($ikey, "Version")
Else
$version="not installed"
EndIf

; Wrong Agent version -> Install new Agent
IF NOT ($version = $curversion)
? "Installing ePO Agent on " + @WKSTA + "- Please wait ..."
SHELL $agent
$version=ReadValue($ikey, "Version")
EndIf

; Create file with Workstation name if it does not exist (do not overwrite existing file)
IF Open( 1 , $agentlog + @WKSTA + ".txt" , 5 ) = 0
$message = "Agent Version is : " + $version
$x = WriteLine( 1 , @DATE + "-" + @TIME + " " + $message + @CRLF )
Else
? "failed to open file, error code : [" + @ERROR + "]"
EndIf

IF NOT ($version = $curversion)
; Create file for action necessary with Workstation name if it does not exist
IF Open( 2 , $agentlog + @WKSTA + "_notinstalled.txt" , 5 ) = 0
$message = "Agent Version is : " + $version
$x = WriteLine( 2 , @DATE + "-" + @TIME + " " + $message + @CRLF )
Else
? "failed to open file, error code : [" + @ERROR + "]"
EndIf
Else
; Remove "action necessary"-file if Version number is correct
DEL $agentlog + @WKSTA + "_notinstalled.txt"
EndIf

EndIf

Exit

Top
#157105 - 2006-03-27 10:10 PM Re: Mcafee EPO
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
What are all the values of $rc2 array?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#157106 - 2006-03-27 10:18 PM Re: Mcafee EPO
rwani Offline
Fresh Scripter

Registered: 2002-11-10
Posts: 20
Loc: Houston
I am not sure if I understand your question...am I missing case statements?
Top
#157107 - 2006-03-27 10:37 PM Re: Mcafee EPO
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
$rc2 should be an array of three values. what is being returned from the function?

Code:

for each $value in $rc2
? $value
next



post the values.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#157108 - 2006-03-27 11:53 PM Re: Mcafee EPO
rwani Offline
Fresh Scripter

Registered: 2002-11-10
Posts: 20
Loc: Houston
Well I should be able to use the following

If InContainer('OU=Reserach,dc=cs,DC=utexas,DC=edu', 'Computer')[0]
Exit

I am using Incontainer UDF that retuns an array [0]. 0 means that computer is not a member of the mentioned domain. May be I need to do some more reading on Arrays...Incontainer UDF and select statements.... "


Edited by rwani (2006-03-27 11:58 PM)

Top
#157109 - 2006-03-28 01:08 AM Re: Mcafee EPO
rwani Offline
Fresh Scripter

Registered: 2002-11-10
Posts: 20
Loc: Houston
Ok I did some reading...so basically in order to use a UDF you also need to copy and paste the function part in your script. Thanks,




If ComputerInGroup('server')=1
exit
endif


Function ComputerInGroup($group,optional $Domain)
Dim $oGrp
if not $domain $domain=@domain endif
$oGrp = GetObject("WinNT://" + $domain + "/" + $group + ",group" )
if @error exit 1 endif

if $oGrp.IsMember("WinNT://" + $domain + "/" + @wksta + "$$" )
$ComputerInGroup=1
else
$ComputerInGroup=0
endif
endfunction


Edited by rwani (2006-03-28 01:11 AM)

Top
#157110 - 2006-03-28 07:31 AM Re: Mcafee EPO
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You will need both InContainer() and TranslateName() for this to work.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.067 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org