Now you are talking about a much more complex issue. I'm not really qualified to talk about how it works, but I can cut/paste some of our code here. We interface with SharePoint through its web api's, and we use PowerShell to do so.
This PowerShell command imports the required functions;
Add-PSSnapin Microsoft.SharePoint.PowerShell
We then create a new webclient and credential it like so;
(Note that &ServerPassword# contains a UC4-encrypted password.)
$WebClient = new-object System.Net.WebClient
$MyPassword = (&UC_JOBMD CMD="echo &ServerPassword#")
$WebClient.Credentials = new-object System.Net.NetworkCredential($username, $Mypassword, $domain)
$MyPassword = ""
Then we upload documents with this instruction;
$WebClient.UploadFile($UploadFullPath, "PUT", $LocalPath)
This is not a very robust solution since it uploads a file without any meta-data. We were planning to enhance it, but then we never got around to it.
Another good resource;
http://letmegooglethat.com/?q=how+to+upload+a+file+to+sharepoint+with+powershell
Original Message:
Sent: 06-10-2019 03:14 PM
From: Shravani Vedantham
Subject: Ping URL from UC4
So I got the requirement wrong, looks like we are trying to copy a file to the SharePoint site. we are not equipped in Powershell and that's why I am asking. Any help is appreciated. I know this thread is not related to what I am asking, but please feel free to send me a message. Thankyou!
Original Message:
Sent: 06-10-2019 02:09 PM
From: Pete Wirfs
Subject: Ping URL from UC4
This PowerShell script returns an integer value if it works. If you pass it a bad url, it will throw an error.
I don't know how your UC4 is set up for calling PowerShell. You should follow your shop best practices for doing so.
write-host $(get-date) **** STARTING REST CALL
$Url = "https://www.google.com/"
$ReturnedInformation = Invoke-RestMethod -Uri $url -Method Get
$ReturnedInformation.length
write-host $(get-date) **** FINISHED REST CALL
Original Message:
Sent: 06-10-2019 10:32 AM
From: Shravani Vedantham
Subject: Ping URL from UC4
Can you please post the powershell script? I am not too familiar with it and we are also trying to achieve this, Used cUrl but failed.
Original Message:
Sent: 06-07-2019 12:58 PM
From: Pete Wirfs
Subject: Ping URL from UC4
I don't know if it is the best way, but I would consider running a PowerShell solution.
Original Message:
Sent: 06-07-2019 08:37 AM
From: Sundaramoorthy R
Subject: Ping URL from UC4
I have an Requirement to Ping a Dynamic URL through UC4. What is the Best way to Ping an URL
#automicwork #automicwebinterface #caautomicworkloadautomation #restapiwebservice