Endpoint Protection

 View Only
Expand all | Collapse all

Importing & Linking Policies into SEPM with a script

  • 1.  Importing & Linking Policies into SEPM with a script

    Posted Jul 23, 2013 05:15 PM

    Hi,

    I need to make a powershell script that can take .dat policy files from media, import them into SEPM and link them to the correct groups they are supposed to be applied to.

    I understand that this can be done quite easily in the SEPM GUI, but I need to make this anyways.

    Right now, I'm not even sure if this is possible, so I would appreciate any help. Thanks!



  • 2.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 23, 2013 05:21 PM

    Haven't seen this done before. It would require editing the DB itself which is not recommended by Symantec. I suppose you can call support to see what can be done as they probably have the best working knowledge of how to accomplish or recommended way to proceed. Perhaps they even have a tool to do it already.



  • 3.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 24, 2013 05:21 AM

    "Thumbs Up" to Brian's post above.

    This would likely be accomplished via sql scripts rather than powershell.  There are a few articles on the SEP DB Schema out there, one of which can be found below for SEP12.1RU2:

    http://www.symantec.com/docs/DOC6039

    The schemas for other versions of SEP can be found by searching for "database schema" in the below page:

    http://www.symantec.com/business/support/index?page=content&key=54619&channel=TECHNICAL_SOLUTION

    Might be worth having a rummage to see if your DBAs can figure out how to accomplish this.  Clearly, any direct manipulation of the SEP DB is unlikely to be supported frown



  • 4.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 24, 2013 07:32 AM

    Hello,

    the SEPM does not have command line options to do those things via a script neither there's a verified procedure to do it by using SQL statements, I'm afraid.



  • 5.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 24, 2013 11:23 AM

    Thanks for the answers everyone! You pretty much confirmed what I thought.

    However, would it be possible to do something via web services like this?

     

    http://forum.support.veritas.com/connect/downloads/sepm121-ru2-webservices-importing-policy-example

    I can't actually get this script to work though.



  • 6.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 24, 2013 11:51 AM

    I'd recommend you try sending a PM to Yoann WYFFELSif you want help with that script.

    As far as I can tell, it makes references to a couple of files that are not included in the download.



  • 7.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 24, 2013 01:42 PM

    I've PMed that user, but I realise running that script wont work. I'm just trying to figure out how these web services work, because I'm not familiar with them.



  • 8.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 25, 2013 04:17 AM

    Hello,

    All scripts (except those I wrote and share on Symantec Community) are included in the "SEP 12.1 RUx - part 2 - Tools" download (provided by Symantec, part 1 is SEP/SEPM setup).

    If you don't have it, download it on fileconnect, or contact technical support to have a link.

    Once downloaded, you'll find all documentations and scripts in the "Integration\SEPM_WebService_SDK\Sample_Code\PowerShell" folder ! :)



  • 9.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 25, 2013 04:23 AM

    Webservices aren't so much hard to run, you'll need to carefully read documentation and do exactly what they tell you to do (and understand the "token" system :p).

    In fact, you'll not be able to apply a policy directly into SEPM database. Too much actions have to be done (I already study that point !). The only way, is like you already find: webservices.

    Anyway, I'm here if you have some difficulties about installation/configuration.

    See you

     



  • 10.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 25, 2013 04:33 AM

    You'll also need my other script if you want to do some scheduled tasks:

    https://www-secure.symantec.com/connect/downloads/sepm121-ru2-webservices-refresh-token

     



  • 11.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 25, 2013 10:39 AM

    Hi, I found the scripts and tried following the steps in the readme file in the powershell folder. I am not able to get Write-AccessTokenToConfig to work when I try running it though. I have already copied the client ID and client secret numbers into config.xml, as well as the directory of the WSDL files, but the script still won't execute properly. The IP and port #s are the defaults.



  • 12.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 26, 2013 04:25 AM

    Do you mean "Write-TokenToConfig.ps1" ?

    I can't find any "Write-AccessTokenToConfig.ps1"...

    Do you have any errors details ? Do you run with "powershell -STA" ?

    Do you configure powershell to run unisgned powershell script ?



  • 13.  RE: Importing & Linking Policies into SEPM with a script

    Posted Jul 30, 2013 01:51 PM

    Sorry, "Write-TokenToConfig.ps1" is what I meant.

    EDIT:

    I have been able to get the ImportPolicy.ps1 script to work! Now, is there a way link this policy to a group? Or must that still be done manually?

    Thanks!

     

    EDIT #2:

    I've got that part working too now. This got a lot easier once I found the reference guide =)



  • 14.  RE: Importing & Linking Policies into SEPM with a script

    Posted Aug 08, 2013 04:44 AM

    Sorry for the n00bie question but can you use Web Services to run  scheduled task such as do a full scan on a on a list of computers as you would in SEPM?



  • 15.  RE: Importing & Linking Policies into SEPM with a script

    Posted Aug 09, 2013 11:55 AM

    That could be possible. Check the reference guide for all the available command functions:
    D:\Tools\Integration\SEPM_WebService_SDK\ReferenceGuide\index.html



  • 16.  RE: Importing & Linking Policies into SEPM with a script

    Posted Aug 11, 2013 07:16 PM

    Thank you Philip C. 

    We  still running on SEPM 11 at the moment but will be upgrading soon. I've been looking at the documentation I dont think there is allot of info on the symantec forums yet. But the refrence link you mentioned is quite useful.

    I 've managed to locate the webservice command to do what i want:

    CommandClientResult com.symantec.sepm.webservice.client.command.CommandService.runClientCommandScan  ( @WebParam(name="computerGUIDList") String[]  computerGUIDList,  

      @WebParam(name="scanType") String  scanType  
     )  

     

    I Just wasnt sure how to execute or call the command webservice library or if it was only to be used with workflow solution. Looking at the sample code in D:\Tools\Integration\SEPM_WebService_SDK\Sample_Code\PowerShell\CommandServiceTest.ps1

    I assume you can use powershell to establish a connection to the web services API?

     

     

     



  • 17.  RE: Importing & Linking Policies into SEPM with a script

    Posted Aug 12, 2013 04:05 AM

    Hi Zack,

    All powershell scripts to etablish connection and send commands to webservices are included in SEP 12.1 RUx - part 2 - Tools download.



  • 18.  RE: Importing & Linking Policies into SEPM with a script

    Posted Nov 28, 2013 04:28 AM

    Hi

    I'm running the ImportPolicy webservice method from Symantec workflow but there's an Exception:

    The method or operation is not implemented.

    Version is:12.1.3001.165

     

    Any clue anyone?