Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xSQLServerScript: Not obvious how to use Windows Authentication #272

Closed
johlju opened this issue Dec 29, 2016 · 0 comments · Fixed by #280
Closed

xSQLServerScript: Not obvious how to use Windows Authentication #272

johlju opened this issue Dec 29, 2016 · 0 comments · Fixed by #280
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Dec 29, 2016

Details of the scenario you try and problem that is occurring:
When using this resource with the Credential parameter it is not obvious how to use the resource if one wants to logon to the instance using Windows Authentication.

  • Add to the description of the parameter Credential how to use Windows Authentication. And that it is controlled by parameter PsDscRunAsCredential. And without either Credential and PsDscRunAsCredential the account SYSTEM is used as the login.
  • The following configurations should be added to the Examples folder

The DSC configuration that is using the resource (as detailed as possible):
The following configuration is logging in using SQL Authentication.

xSQLServerScript "$($currentSqlInstance)-RunSQLScript"
{
    ServerInstance = "localhost\Instance"
    SetFilePath = "C:\DSCTemp\SQLScripts\Set-RunSQLScript.sql"
    TestFilePath = "C:\DSCTemp\SQLScripts\Test-RunSQLScript.sql"
    GetFilePath = "C:\DSCTemp\SQLScripts\Get-RunSQLScript.sql"

    Credential = $SqlAdministratorCredential
}         

The following configuration is logging in using Windows Authentication with the account SYSTEM.

xSQLServerScript "$($currentSqlInstance)-RunSQLScript"
{
    ServerInstance = "localhost\Instance"
    SetFilePath = "C:\DSCTemp\SQLScripts\Set-RunSQLScript.sql"
    TestFilePath = "C:\DSCTemp\SQLScripts\Test-RunSQLScript.sql"
    GetFilePath = "C:\DSCTemp\SQLScripts\Get-RunSQLScript.sql"
}         

The following configuration is logging in using Windows Authentication with the provided credentials.

xSQLServerScript "$($currentSqlInstance)-RunSQLScript"
{
    ServerInstance = "localhost\Instance"
    SetFilePath = "C:\DSCTemp\SQLScripts\Set-RunSQLScript.sql"
    TestFilePath = "C:\DSCTemp\SQLScripts\Test-RunSQLScript.sql"
    GetFilePath = "C:\DSCTemp\SQLScripts\Get-RunSQLScript.sql"

    PsDscRunAsCredential = $SqlAdministratorCredential
}         

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2012 R2, SQL Server 2008 R2 (with SQL Server 2016 SQLPS-module), PS 5.0

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Dec 29, 2016
@johlju johlju self-assigned this Dec 31, 2016
@johlju johlju removed their assignment Apr 16, 2017
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Apr 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant