The script should connect to another server and create a XML file with the below content.
<?xml version='1.0'?>
<action>
<type>UPDATE_JOB</type>
<attribute name="job_id" value="331" />
<attribute name="variables">
<map>
<entry name="cc_WaitApprove_Continue" value="true"/>
<entry name="cc_Approved" value="false"/>
</map>
</attribute>
</action>
Update 1: I was able to create a XML file in the same server using the following code, I am not sure how to code to connect to another server and create the XML file there:
Param( [string] $jobid, [string] $path)
$Location = $path
#"C:\Users\sks"
$x = @"
<?xml version='1.0'?>
<action>
<type>UPDATE_JOB</type>
<attribute name="job_id" value="$jobid" />
<attribute name="variables">
<map>
<entry name="cc_WaitApprove_Continue" value="true"/>
<entry name="cc_Approved" value="false"/>
</map>
</attribute>
</action>
"@
New-Item -Path $Location -Name "testing.xml" -ItemType File -value $x
Update 2:
I googled and found I can use like this. What does the C$
means? Is it C:\
?
$uncServer = "\\10.11.12.124"
$uncFullPath = "$uncServer\C$\backup\folder"
$username = "anton"
$password = "p@ssw0rd"
net use $uncServer $password /USER:$username
New-Item -Path $uncFullPath -Name "testing.xml" -ItemType File -value $x