PowerShell Logo Small

Set-OdbcDriver



This is the built-in help made by Microsoft for the command 'Set-OdbcDriver', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Configures the properties for installed ODBC drivers.

SYNTAX


Set-OdbcDriver [-InputObject] <CimInstance[]> [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-RemovePropertyValue <String[]>] [-SetPropertyValue <String[]>] [-Thr
ottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-OdbcDriver [-Name] <String> [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-Platform <String>] [-RemovePropertyValue <String[]>] [-SetPropertyValue <String[]>
] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-OdbcDriver cmdlet configures the properties for installed Open Database Connectivity (ODBC) drivers. Specify properties to add or modify by using the SetPrope
rtyValue parameter. Specify properties to remove by using the RemovePropertyValue parameter.


Use the driver installation program to install and uninstall a driver. You cannot install or uninstall a driver by using Windows PowerShell® cmdlets.


For more information about ODBC and drivers, see Microsoft Open Database Connectivity (ODBC) (http://msdn.microsoft.com/en-us/library/ms710252.aspx) and Drivers (http
://msdn.microsoft.com/en-us/library/ms715383.aspx) on the Microsoft Developer Network.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=287610
Get-OdbcDriver
N:Wdac



REMARKS

<

Examples


Example 1: Assign a value for a 32-bit driver by using a name

PS C:\> Set-OdbcDriver -Name "SQL Server Native Client 10.0" -Platform "32-bit" -SetPropertyValue "CPTimeout=60"



This command assigns the key CPTimeout a value of 60 for the 32-bit driver named SQL Server Native Client 10.0.




Example 2: Remove a property for any driver that starts with a string for the native platform

PS C:\> Set-OdbcDriver -Name "SQL Server*" -RemovePropertyValue "aaa"



This command removes the property named aaa for all drivers with a name that starts with SQL Server under the native platform.




Example 3: Change and remove properties for a driver

PS C:\> Set-OdbcDriver -Name "SQL Server Native Client 10.0" -Platform "All" -RemovePropertyValue @("aaa1", "aaa2") -SetPropertyValue @("aaa3=bbb3", "aaa4=bbb4")



This command operates on any driver named SQL Server Native Client 10.0 under both 32-bit and 64-bit architectures. The command removes the properties aaa1 and aaa2.
It also sets the property aaa3 to bbb3 and the property aaa4 to bbb4.




Example 4: Assign a value for a 32-bit driver by using a name and store the result

PS C:\> $driver = Set-OdbcDriver -Name "SQL Server Native Client 10.0" -Platform "32-bit" -SetPropertyValue "aaa=bbb" -PassThru



This command assigns the key aaa a value of bbb for the 32-bit driver named SQL Server Native Client 10.0, and then stores the driver object in the $driver variable.




Example 5: Change and remove properties for a driver by using the pipeline operator

PS C:\> Get-OdbcDriver "SQL Server Native Client 10.0" -Platform "All" | Set-OdbcDriver -RemovePropertyValue @("aaa1", "aaa2") -SetPropertyValue @("aaa3=bbb3", "aaa4=
bbb4")



This command operates on any driver named SQL Server Native Client 10.0 under both 32-bit and 64-bit architectures. This command removes the properties aaa1 and aaa2.
It also sets the property aaa3 to bbb3 and the property aaa4 to bbb4.




Example 6: Change and remove properties for a driver by using a variable

PS C:\> $driverArray = Get-OdbcDriver "SQL Server Native Client 10.0" -Platform "All"
PS C:\> Set-OdbcDriver -InputObject $driverArray -RemovePropertyValue @("aaa1", "aaa2") -SetPropertyValue @("aaa3=bbb3", "aaa4=bbb4")



This command uses the Get-OdbcDriver cmdlet to get any driver named SQL Server Native Client 10.0 under both 32-bit and 64-bit architectures, and then stores them in
the $driverArray variable. The second command removes the properties aaa1 and aaa2. It also sets the property aaa3 to bbb3 and the property aaa4 to bbb4.