PowerShell Logo Small

Get-OdbcDsn



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

Retrieves one or more ODBC data source names (DSNs) from the system that match the value passed to the Name parameter. If the Name parameter is not specified, DSNs matching DsnType, Platform, and DriverName constraints will be retrieved. If no parameters are provided, retrieves all ODBC DSNs from the system.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


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 Sourceshttp://msdn.microsoft.com/en-us/library/ms711688.aspx, and
Drivershttp://msdn.microsoft.com/en-us/library/ms715383.aspx.



<

RELATED LINKS

Add-OdbcDsn
Remove-OdbcDsn
Set-OdbcDsn
N:Wdac



REMARKS

<

Examples




PS C:\> Get-OdbcDsn



This command gets all ODBC User DSN(s) and System DSN(s) that are using 32-bit or 64-bit ODBC drivers:






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



This command gets the ODBC System DSN(s) named as "MyPayroll" which is stored in the 32-bit registry location. The Name parameter is
positioned at 0:






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



This command gets all ODBC User DSN(s) and System DSN(s) with name matches the wildcard and which is stored in the native hive of the registry
location:






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



This command gets all ODBC User DSN(s) that is using a driver with a name matching the above wildcard. It also saves the result into a
PowerShell variable for future use: