Quantcast
Channel: Microsoft Identity Manager forum
Viewing all articles
Browse latest Browse all 7443

Using Soren's PS MA for REST API Post in XML format. How to adapt Export script for REST?

$
0
0

I have a working Powershell script that successfully posts to the API.  I am having trouble finding resources to help me adapt this into the script that the PSMA requires for Export.  I am only Exporting.  The objects are being created and updated in the MV through other MAs.  Here is the working script (via ISE).  I have a working Schema script for the 3 attributes already in the MA.  Can anyone assist me with adapting this to the Export.ps1 format that the PSMA requires to export the attributes?  What am I missing?  Thanks.

PARAM
(
  $Username,
  $Password,
  $Credentials,
  $ExportType,
  $Schema
)

BEGIN
{
}
PROCESS
{
$ContentType = "application/xml"
$URI = "https://securewebservicestest.domain.org/ProcessAutomationService/rest/api/request"

$RequestBody = @"<?xml version="1.0" encoding="UTF-8" standalone="yes"?><request type="MiMUserCreate"><credentials><username>svc_mim-lawson_rest</username><password>*************</password></credentials><parameters><parameter><name>USER</name><value>mike</value></parameter><parameter><name>EMP_NUM</name><value>91001</value></parameter><parameter><name>EMAIL</name><value>
            	test2@domain.org</value></parameter></parameters></request> "@

$Result = Invoke-RestMethod -Uri $URI -Method Post -Body $RequestBody -ContentType $ContentType

foreach ($can in $_.ChangedAttributeNames)
      {
        $can | out-file -filepath D:\Software\Temp\Debug.txt -append
        
          }

}
END
{
}


Mike Leach | http://blogs.catapultsystems.com/mleach/default.aspx


Viewing all articles
Browse latest Browse all 7443

Trending Articles