PowerShell Logo Small

Get-OdbcDsn



This is the built-in help made by Microsoft for the command 'Get-OdbcDsn', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' 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

Gets ODBC DSNs.

SYNTAX


Get-OdbcDsn [[-Name] <String>] [-AsJob] [-CimSession <CimSession>] [-DriverName <String>] [-DsnType <String>] [-Platform <String>] [-ThrottleLimit <Int32>]
[<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-OdbcDsn cmdlet gets Open Database Connectivity (ODBC) data source names (DSNs) from the computer. You can specify values for the Name, DsnType, Platform, and
DriverName parameters. If you do not specify Name or DriverName, the cmdlet gets all DSN names and all driver names respectively. If you do not specify any parameter, the
cmdlet gets all ODBC DSNs from the computer.


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



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=287606
Add-OdbcDsn
Remove-OdbcDsn
Set-OdbcDsn
N:Wdac



REMARKS

<

Examples


Example 1: Get all DSNs

PS C:\> Get-OdbcDsn



This command gets all ODBC User DSNs and System DSNs that use 32-bit or 64-bit ODBC drivers.




Example 2: Get ODBC System DSNs by name

PS C:\> Get-OdbcDsn -Name "MyPayroll" -DsnType "System" -Platform "32-bit"



This command gets the ODBC System DSNs named MyPayroll stored in the 32-bit registry location.




Example 3: Get ODBC DSNs with names that contain a string

PS C:\> Get-OdbcDsn -Name "*Payroll*"



This command gets all ODBC User DSNs and System DSNs with names that contain the string Payroll. The DSNs are stored in the native hive of the registry location.




Example 4: Get all ODBC User DSNs for specified driver

PS C:\> $dsnArray = Get-OdbcDsn -DriverName "SQL Server*"



This command gets all ODBC User DSNs that use a driver that has the specified name, and then stores those DSN in the $dsnArray variable.