1

Update - Hi, I am embarrassed to say that as a newbie I didn't realise that Tridion was different to Tridion Docs and it is Tridion Docs files that I need to access and manipulate. So I have since found ISHRemote as the PowerShell gallery that I should be using. Thank you for your answers though :-)

I am new to Tridion and want to investigate using the Tridion Powershell Modules to access and manipulate our CMS files. I have used the following link Connecting remotely to Core Services using the Tridion Powershell Modules to try to connect to our remote Tridion server but am getting an error on calling $client.GetCurrentUser().

    Exception calling "GetCurrentUser" with "0" argument(s): "Could not connect to
net.tcp://<hostname>:2660/CoreService/2012/netTcp. The connection attempt lasted for a time span of 00:00:21.0035230. TCP
error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection
failed because connected host has failed to respond <ip address>:2660. "
At line:1 char:1
$client.GetCurrentUser()

    CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    FullyQualifiedErrorId : EndpointNotFoundException

My questions are - can I be confident that the Core Service is running on the remote server or is there something that I need to configure there? and do you see anything obvious that I can follow up on in the error message?

Any feedback appreciated, Regards, Ann

2
  • Welcome to Tridion StackExchange, What is the version of Tridion? where you are running the PowerShell command? In the CMS server or remotely on your laptop?
    – Velmurugan
    Commented Oct 7, 2020 at 13:51
  • Is that your tridion site cms using https? Is there any SSO/SAML2.O anything enabled?
    – Velmurugan
    Commented Oct 7, 2020 at 13:53

2 Answers 2

1

It can sometimes be a bit tricky to get exactly the right settings. The good news is that once you've found them, the core service is a very powerful tool for working with Tridion.

Having imported the module you should be able to configure the settings using Set-TridionCoreServiceSettings. Here's a snippet from one of my own scripts. Obviously the variables also need to have suitable values, and you need to do this setup before you call Get-TridionCoreServiceClient.

Set-TridionCoreServiceSettings -HostName $Hostname 
Set-TridionCoreServiceSettings -Version $version
Set-TridionCoreServiceSettings -CredentialType $credentialType
Set-TridionCoreServiceSettings -ConnectionType $connectionType
Set-TridionCoreServiceSettings -Credential $ServiceAccountCredential

So which of these are relevant to your problem?

Version

Each version of the service has its own endpoint. Your error message says CoreService/2012, which I think corresponds to -version '2011-SP1'. In general, each version of Tridion supports service endpoints for several previous versions, but I think version 9 dropped support for 2011. The trick here is to type in a nonsense value for -version, and the response will list the possible valid values. Then you can choose the one closest to the version of Tridion you are using. The module will construct the correct endpoint address based on this.

Connection Type

Also visible in your error message is netTcp, which indicates that you have a -connectionType of netTcp. The core service runs over netTcp or http.

NetTcp is a good choice if you are calling the service from on the server, as it's very efficient, but it's often not exposed through firewalls. This protocol is served by the TcmServiceHost service, so you might also want to check if the service is running.

From a remote server, you'll very often want to be using HTTP, which might be secured in a variety of different ways. This is hosted by IIS, so won't rely on the TcmServiceHost. One common setup is to have HTTP with Basic authentication secured with SSL (i.e. HTTPS). For this example, you'd need -CredentialType Basic -ConnectionType Basic-SSL

In any case, the module creates an endpoint URI based on the various options you specify. All you have to do is figure out the right combination.

0
1

You could well have valid connection parameters, but make sure that the ports you are using are open. For netTcp port 2660 must be open on your firewall, note also that netTcp is a non-routable protocol.

So one example to connect over https would be

Set-TridionCoreServiceSettings -ConnectionType Basic-SSL  -HostName  $SDLCloudCMS -Version Sites-9.0 -Credential $credential -CredentialType Basic 

$client = Get-TridionCoreServiceClient
$CMSVersion = $client.GetApiVersion()

But it depends on what is configured in your CMS server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.