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 Reply Children
  • This is the script and the failed result in red 

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

    "Add-CASearch : Cannot convert 'System.Object[]' to the type 'System.Xml.XmlDocument' required by parameter 'XmlSearchDefinition'. Specified method is not