cancel
Showing results for 
Search instead for 
Did you mean: 

Pulling Data from Master Repository

Hey Eveyone,

I am new to the whole scripting thing with ePO and I am having a problem pulling the content of the current branch within the Master Repository. Is it possible to pull that information via the Web API?  If so, are there any of these export data type scripts available on this forum?

1 Reply

Re: Pulling Data from Master Repository

The web api call you are looking for is repository.export.

The below code can be used in Powershell. It will collect the credentials to be used and use the System.Net.WebClient object for the calls.

Note: This will create a file called rep.txt on your ePO server's file system.

$credentials = Get-Credential -Credential $null
$User = $credentials.GetNetworkCredential().UserName
$password = $credentials.GetNetworkCredential().Password
$domain = $credentials.GetNetworkCredential().Domain

$pc = "rep.txt"

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$url = "https://{servername}:8443/remote/repository.export?fileName=$pc"
$navigate = new-object System.Net.WebClient
$navigate.credentials = New-Object system.net.NetworkCredential($user, $password, $domain)
$navigate.DownloadString("$url")