Set-R1DataSource

SYNOPSIS

Updates a data source.

SYNTAX

NewPassword

Set-R1DataSource [-name] <String> [[-active] <Boolean>] [[-description] <String>] [[-defaultSchema] <String>]
 [[-addedSchemas] <String[]>] [[-hostName] <String>] [[-port] <Int32>] [[-ssl] <Boolean>] [[-bindDn] <String>]
 [[-baseDn] <String>] [[-url] <String>] [[-username] <String>] [[-customProps] <Hashtable>]
 [-sdcMappings <Hashtable>] [-password] <SecureString> [-WhatIf] [-Confirm] [<CommonParameters>]

ExistingCredentials

Set-R1DataSource [-name] <String> [[-active] <Boolean>] [[-description] <String>] [[-defaultSchema] <String>]
 [[-addedSchemas] <String[]>] [[-hostName] <String>] [[-port] <Int32>] [[-ssl] <Boolean>] [[-bindDn] <String>]
 [[-baseDn] <String>] [[-url] <String>] [[-username] <String>] [[-customProps] <Hashtable>]
 [-sdcMappings <Hashtable>] [-useExistingCredentials] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Updates a data source.

The current data source is retrieved and sent back with the supplied values applied over it, so a property left unspecified keeps its current value. Because the shape differs between LDAP, database and custom sources, the request is built from what the API returned rather than from a fixed list of properties.

The request body is sent as UTF8 bytes so that a supplied password cannot be captured by Windows PowerShell parameter binding or module logging.

EXAMPLES

Example 1

Set-R1DataSource -name 'opendj' -description 'Corporate directory' -useExistingCredentials

Changes the description, leaving every other property as it is and keeping the stored password.

Example 2

Set-R1DataSource -name 'opendj' -password $Secret

Changes the bind password.

Example 3

Set-R1DataSource -name 'opendj' -hostName 'ldap2.example.com' -useExistingCredentials

Moves the data source to another host, telling the server to keep the stored credentials.

PARAMETERS

-name

The name of the data source.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-active

Whether the data source is active.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-description

A description of the data source.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-defaultSchema

The schema used by default for this data source.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-addedSchemas

The schemas linked to the data source.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-hostName

The host of the directory server. The API property is host, which cannot be used as a parameter name because it is a PowerShell automatic variable.

Type: String
Parameter Sets: (All)
Aliases: host

Required: False
Position: 6
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-port

The port of the directory server.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: 0
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ssl

Whether the connection uses SSL.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-bindDn

The DN used to bind to the directory server.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-baseDn

The base DN of the data read from the directory server.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-url

The JDBC URL of the database.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-username

The account used to connect to the database.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 12
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-customProps

The properties of a custom data source, as a hashtable of names to values.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 13
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-password

The password used to authenticate. Supply it only to set or change it.

Type: SecureString
Parameter Sets: NewPassword
Aliases:

Required: True
Position: 14
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-useExistingCredentials

Tells the server to keep every stored password. Supply it on any update which is not setting a new password.

Type: SwitchParameter
Parameter Sets: ExistingCredentials
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-sdcMappings

A map of Secure Data Connector mappings, keyed by name. Each value gives the host and port the connector reaches the data source on, and optionally the group id.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Void

NOTES

The API does not return the bind password: a data source that has one reads back an empty string, and one that has none reads back null. Sending that empty string back would be read as an instruction to clear the password.

Null means leave it alone only for the password fields of a custom data source. For an LDAP or database data source it is read as no password at all, which leaves the data source unable to connect.

Every update therefore has to say what becomes of the password, and the two ways of saying it cannot be combined: -password sets a new one, and -useExistingCredentials keeps the stored one. A call which gives neither is refused rather than guessed at.

Get-R1DataSource

New-R1DataSource