Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Connect-JobScheduler [-Url] <Uri> [[-Credentials] <PSCredential>] [[-Id] <String>] [-AskForCredentials] [-UseDefaultCredentials] [[-ProxyUrl] <Uri>] [[-ProxyCredentials] <PSCredential>] [-ProxyUseDefaultCredentials] [[-Base] <String>] [[-Timeout] <Int32>] [[-SSLProtocol] <String>] [[-Certificate] <X509Certificate2>] [[-CertificateThumbprint] <String>] [[-KeyStorePath] <String>] [[-AddRootCertificate] <String>] [-SkipCertificateCheck] [-MasterDetails] [<CommonParameters>]

...

A connection to the JOC Cockpit Web Service is established including support for credentials and use of a proxy.

The cmdlet authenticates a user and returns an access token in case of successful authentication
that is used for subsequent requests to the Web Service.

Caveat:
* This cmdlet calls the Invoke-WebRequest cmdlet that may throw an error "The response content cannot be parsed because the Internet Explorer engine
is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again."

* This problem is limited to Windows. The reason for this error is a weird PowerShell dependency on IE assemblies.
* If Internet Explorer is not configured then it prompts the user for configuration when being launched.

* To disable IE's first launch configuration window you can modify the Windows registry
** by running a PowerShell script: Set-ItemProperty -Path "'HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" ' -Name "'DisableFirstRunCustomize" ' -Value 2
** by using the "'regedit" ' utility and navigating in the HKLM hive to the above key "'DisableFirstRunCustomize" ' and assigning the value "'2"'.
** this operation requires administrative permissions.

...

Required?false
Position?8
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

Certificate

-Certificate <String>
This parameter currently is not used. It is provided for future releases of JOC Cockpit
that support client authentication certificates.
The certificate specified with this parameter replaces the account/password specified during login. <X509Certificate2>
This parameter can be used for client authentication if JOC Cockpit is configured for mutual authentication with HTTPS (SSL).
If JOC Cockpit is configured to accept one-factor authentication then the certificate specified with this parameter replaces
the password for login. If JOC Cockpit requires two-factor authentication then a certificate is required
in addition to specifying a password for login.

Consider that this parameter expects a certificate with the data type [System.Security.Cryptography.X509Certificates.X509Certificate2].
This parameter can be used for Windows only. For other operating systems use the -KeyStorePath parameter.

Use of this parameter requires that the certificate object includes the private key and the certificate chain, i.e. the certificate
and any intermediate/root certificates required for validation of the certificate.

This parameter cannot be used with the -CertificateThumbprint parameter or -KeyStorePath parameter.

Required?false
Position?9
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

CertificateThumbprint

-CertificateThumbprint <String>
This parameter can be used for client authentication if JOC Cockpit is configured for mutual authentication with HTTPS (SSL).
If JOC Cockpit is configured to accept one-factor authentication then the certificate identified with this parameter replaces
the password for login. If JOC Cockpit requires two-factor authentication then a certificate is required
in addition to specifying a password for login.

This parameter can be used for Windows only. For other operating sysems use the -KeyStorePath parameter.

Use of this parameter requires a certificate store to be in place that holds the private key and certificate chain, i.e. the same certificate
and any intermediate/root certificates required for validation of the certificate. Consider this parameter a reference
to a certificate entry in your Windows certificate store that includes the private key and certificate chain.

This parameter cannot be used with the -Certificate parameter or -KeyStorePath parameter.

Required?false
Position?10
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

KeyStorePath

-KeyStorePath <String>
This parameter can be used for client authentication if JOC Cockpit is configured for mutual authentication with HTTPS (SSL).
If JOC Cockpit is configured to accept one-factor authentication then the certificate from the keystore specified with this parameter replaces
the password for login. If JOC Cockpit requires two-factor authentication then a certificate is required
in addition to specifying a password for login.

This parameter expects the path to a keystore file, preferably a PKCS12 keystore, that holds the private key and certificate chain, i.e. the certificate
and any intermediate/root certificates required for validation of the certificate. Certificates of type X509 are supported.

The cmdlet adds the private key, certificate and any intermediate/root certificates from the keystore to the certificate store
used by the current account. This parameter can be used for Windows and Unix operating systems.

This parameter cannot be used with the -Certificate parameter or -CertificateThumbprint parameter.

Required?false
Position?911
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

...

-AddRootCertificate <String>
Specifies the location of a file that holds the root certificate that was when signing the JOC Cockpit
SSL certificate.

* For Windows environments the root certificate by default is looked up in the Windows Certificate Store, however,
this parameter can be used to apply a root certificate from a location in the file system.
* For Linux environments a path is specified to the root certificate file.

Required?false
Position?1012
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

...

PS > $credential = ( New-Object -typename System.Management.Automation.PSCredential -ArgumentList 'root', ( 'root' | ConvertTo-SecureString -AsPlainText -Force) )
Connect-JobScheduler http://localhost:4446 $credential scheduler

...

PS > cmdkey /generic:JobScheduler Web Service /user:root /pass:root
$credentials = Get-JobSchedulerSystemCredentials -TargetName "JobScheduler Web Service"
Connect-JobScheduler -Url http://localhost:4446 -Credentials $credentials

...