PowerShell Automation Failing (MID SERVER IS UP AN RUNNING)

will_forster
Tera Guru

Good Afternoon Community !

 

We have had an automation piece in our instance for sometime now. It basically installs software automatically via a powershell script once a request is approved.

 

This had stopped working a few weeks ago

 

How it works : 

 

Customer logs a request to have software installed on X machine.

Once approved it goes via an automated sub flow.

This captures a string value in the request which is basicaly an AD group to install software on the machine. 

This is pushed through a powershell script in workflow.

 

 

 

Scrach Pad on workflow

 

try {

    var instance = gs.getProperty("instance_name");
    var hostname = "10.252.142.39"; //"10.252.142.141";//"10.252.142.44";
    var domain = "";


     domain = "10.252.142.39"; 


    workflow.scratchpad.hostname = hostname;
    workflow.scratchpad.groups = "";
    workflow.scratchpad.parameters = "";

    if (instance == "PROD") {
        workflow.scratchpad.groups = current.variables.software_ref.u_ad_group;
        workflow.scratchpad.computer = current.variables.computer.getDisplayValue() + "$";
        workflow.scratchpad.cred = "Orchestration";
    } else {
        workflow.scratchpad.groups = current.variables.software_ref.u_ad_group;
        workflow.scratchpad.computer = current.variables.computer.getDisplayValue() + "$";
        workflow.scratchpad.cred = "Orchestration_Test";
    }
    workflow.scratchpad.script = "d0c33093db1258d03fc7b4f339961901";
    workflow.scratchpad.parameters = '{"domain":"' + domain + '", "adObject":"' + workflow.scratchpad.computer + '", "groupnames":"' + workflow.scratchpad.groups + '", "credType":"AD"}';

} catch (error) {
    gs.log("Error in workflow - Catalog - Software Request - Automated Sub-Workflow - " + current.number + error);
}

 

 

Custom Powershell on workflow

powershell.PNG

The Workflow appears to complete however no AD groups get pushed to the machine/user profile. When debuging the flow we find the below error.

 

WARNING: Error initializing default drive: 'The server has rejected the client credentials.'.
WARNING: Unable to contact the server. This may be because this server does not exist, it is currently down, or it doesnot have the Active Directory Web Services running.
</output>
<debug_info>2023-06-02 11:04:25 Tried Credential: name=svc_test_servicenow, affinity: yes, status=success, sysid=6a47fb5fdb378c900adad278f49619fa, username=HILLSRD\david.edgar@telefonicatech.uk, type=Windows, order=100&#13;

 

 

 

Mid Server

 

will_forster_0-1685713612317.png

 

 

This is a little difficult to explain but feel free to ask any questions.

Any help would be welcomed.

 

 

3 REPLIES 3

Igor Virgilio A
Tera Contributor

Hi Will, 

I've benn facing a similar problem too. I've you found the resolution for this issue?

 

Thank you

BhupeshG
Tera Guru

anyone found a solution for this?

will_forster
Tera Guru

turned out to be a credentials issue. recreating the credentials fixed the issue for us