Import of XML searches using Powershell

We have a script that creates multiple XML files to send a notification when a security group is modified. We can import these manually in Change Auditor no problem and they work fine. But I cannot find any Powershell cmdlet in Change Auditor Powershell module to import these XML file while this features is implemented in the GUI. Only the Add-CASearch I can see which is not doing what I need. Is there a way to import just like we do in the GUI but using Powershell?

Or maybe there is a folder (hidden) that I am not seeing to copy over these XML?  

We are at a point that for every groups created, there is an authority approver email address attached to it and every time there is a new group, a new alert needs to be created.  The script saves a tons of time, but if we could add the import part to CA in the script, it will help a tons.

Thanks in advance

Parents
  • Ok, I was able to get this going by adding [xml]  before variable for on the get-content line.  But, it doesn't import all of the fields from the XML as the GUI client does.  It's not importing the email values (ex: toAddress, replyto, CC,BCC) and they well populated in the XML and again, the import feature using the same exact XML works very well using Change Auditor client.  I'm on 7.3 btw

    Here is an example for other that are in the same situation.  The documentation example forgot that part.

    $ChangeAuditorPowershellModuleFile = "C:\Program Files\Quest\ChangeAuditor\Client\ChangeAuditor.PowerShell.dll"
    $ChangeAuditorInstallationName = "default"
    $connection = Connect-CAClient -InstallationName $ChangeAuditorInstallationName
    [xml] $XMLFile = Get-Content "C:\Change Auditor Alerts\Alert1.xml"
    
    Add-CASearch –Connection $connection –XmlSearchDefinition $XMLFile –IsPublic –Path Shared\Alertsfolder –Name “My Alert” -PassThru

Reply
  • Ok, I was able to get this going by adding [xml]  before variable for on the get-content line.  But, it doesn't import all of the fields from the XML as the GUI client does.  It's not importing the email values (ex: toAddress, replyto, CC,BCC) and they well populated in the XML and again, the import feature using the same exact XML works very well using Change Auditor client.  I'm on 7.3 btw

    Here is an example for other that are in the same situation.  The documentation example forgot that part.

    $ChangeAuditorPowershellModuleFile = "C:\Program Files\Quest\ChangeAuditor\Client\ChangeAuditor.PowerShell.dll"
    $ChangeAuditorInstallationName = "default"
    $connection = Connect-CAClient -InstallationName $ChangeAuditorInstallationName
    [xml] $XMLFile = Get-Content "C:\Change Auditor Alerts\Alert1.xml"
    
    Add-CASearch –Connection $connection –XmlSearchDefinition $XMLFile –IsPublic –Path Shared\Alertsfolder –Name “My Alert” -PassThru

Children