Share all details about your problem, including any error messages you may have received.
I have a rule that generates a report in form of txt. Is there a way I can have this rule export this file to a shared folder instead of exporting it internally?
Recently, Microsoft has deprecated NTLM authentication. However, it remains possible to utilize SMB2 or SMB3 protocols. In considering these alternatives, I consistently recommend the use of SMB3 for its enhanced security features.
I just tried doing this via powershell and get the error that the constructor doesn’t exist:
An unexpected error occurred: java.lang.Exception: sailpoint.tools.GeneralException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: ``import sailpoint.object.Identity; import java.util.List; import java.util.A . . . ‘’ : Typed variable declaration : Constructor error: Can’t find constructor: sailpoint.connector.RPCService(java.lang.String, java.lang.String) in class: sailpoint.connector.RPCService
This is the rule I’m using to execute powershell scripts:
import sailpoint.object.Identity;
import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import sailpoint.object.RpcRequest;
import sailpoint.object.RpcResponse;
import sailpoint.connector.RPCService;
// Let's suppose we've already run "Generate Local File Rule" or we know the path
String localFilePath = "C:\\temp\\generatedFile.txt";
String sharedFilePath = "\\\\Server\\Share\\generatedFile.txt";
// Prepare data for the IQService script
Map data = new HashMap();
data.put("postScript", "Powershell Rule"); // Ties to your <Rule name="Powershell Rule" ... />
// If you want to reference an application, as in your original code:
Application ad = context.getObjectByName(Application.class, "AD");
data.put("Application", ad.getAttributes());
// Build an AccountRequest
AccountRequest accountRequest = new AccountRequest();
accountRequest.setApplication("IIQ");
accountRequest.setOperation(AccountRequest.Operation.Modify);
// Add the localFilePath and sharedFilePath as new attributes
accountRequest.add(new AttributeRequest("localFilePath", ProvisioningPlan.Operation.Add, localFilePath));
accountRequest.add(new AttributeRequest("sharedFilePath", ProvisioningPlan.Operation.Add, sharedFilePath));
// Optionally keep the existing attribute for email, if needed:
accountRequest.add(new AttributeRequest("email", ProvisioningPlan.Operation.Add, "test@gmail.com"));
// Pass the accountRequest to IQService
data.put("Request", accountRequest);
// Example: Connect to your IQService
// (Make sure the host, port, TLS, etc. are correct for your environment)
RPCService service = new RPCService("iqServiceHost","iqServicePort",useTLS);
RpcRequest request = new RpcRequest("ScriptExecutor", "runAfterScript", data);
RpcResponse response = service.execute(request);
// Parse response
Map res = response.getResultAttributes();
if (res.getMessages() != null && res.getMessages().size() > 0){
// For example, check if the first message is "Success!"
if(res.getMessages().get(0).equals("Success!")){
System.out.println("PowerShell script executed successfully.");
}
}