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

SqlServerLogin: Some verbose strings does not output correctly #1096

Closed
johlju opened this Issue Mar 26, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@johlju
Copy link
Collaborator

johlju commented Mar 26, 2018

Details of the scenario you tried and the problem that is occurring

The verbose string below should contain the current state of each property, for example it should say ...is a WindowsUser rather than SqlLogin but it says ...is a rather than SqlLogin (note the $null value between a rather). This is thru for some of the other strings in the below output.

This happens when the login does not exist. The verbose output should hanlde this better. For example maybe it should not write these lines of verbose output when the account is new ('Absent').

VERBOSE: [TEST1]:                            [[SqlServerLogin]NewLogin] 2018-03-26_12-16-58: Getting the login 'TestUser1' from 'test1\MSSQLSERVER'
VERBOSE: [TEST1]:                            [[SqlServerLogin]NewLogin] 2018-03-26_12-16-58: The login 'TestUser1' is Absent from the 'test1\MSSQLSERVER' instance.
VERBOSE: [TEST1]:                            [[SqlServerLogin]NewLogin] 2018-03-26_12-16-58: The login 'TestUser1' on the instance 'test1\MSSQLSERVER' is Absent rather than Present
VERBOSE: [TEST1]:                            [[SqlServerLogin]NewLogin] 2018-03-26_12-16-58: The login 'TestUser1' on the instance 'test1\MSSQLSERVER' is a  rather than SqlLogin
VERBOSE: [TEST1]:                            [[SqlServerLogin]NewLogin] 2018-03-26_12-16-58: The login 'TestUser1' on the instance 'test1\MSSQLSERVER' has PasswordExpirationEnabled set to  rather than False
VERBOSE: [TEST1]:                            [[SqlServerLogin]NewLogin] 2018-03-26_12-16-58: The login 'TestUser1' on the instance 'test1\MSSQLSERVER' has PasswordPolicyEnforced set to  rather than False

The DSC configuration that is using the resource (as detailed as possible)

        SqlServerLogin AddNTServiceClusSvc
        {
            Ensure               = 'Present'
            Name                 = 'TestUser1'
            LoginType            = 'SqlLogin'
            ServerName           = $Node.NodeName
            InstanceName         = $Node.InstanceName
            PsDscRunAsCredential = $SqlAdministratorCredential
        }

Version of the operating system and PowerShell the target node is running

Any

SQL Server edition and version the target node is running

Any

What SQL Server PowerShell modules, and which version, are present on the target node.

n/a

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

Dev

@johlju johlju removed the easy fix label Apr 29, 2018

jpomfret added a commit to jpomfret/SqlServerDsc that referenced this issue Oct 10, 2018

@johlju johlju added in progress and removed help wanted labels Oct 10, 2018

johlju added a commit to jpomfret/SqlServerDsc that referenced this issue Dec 28, 2018

johlju added a commit to jpomfret/SqlServerDsc that referenced this issue Dec 31, 2018

@johlju johlju closed this in #1240 Jan 1, 2019

johlju added a commit that referenced this issue Jan 1, 2019

SqlServerLogin: Addresses issue #1096 - doesn't check properties if l…
…ogin is not present on server (#1240)

- Change to SqlServerLogin so it doesn't check properties for absent logins.
   - Fix for (issue #1096).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment