Showing posts with label viewer. Show all posts
Showing posts with label viewer. Show all posts

Wednesday, March 28, 2012

Login failed for user Domainname\computername

Hi,

I am using SQL Server 2005. The below message is added to the Application Event Viewer frequently.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

abc is my domain name and xyz is my computer name.

When I look @. the SQL error logs, I find the following message:

Error 18456 Severity 14 state 11

Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

Please let me know if you have any suggessions.

Thanks

Santhosh

It seems like a service running in the computer xyz is trying to connect to your SQL Server instance. This service must likely is running with local system or network service credentials.

I would recommend investigating what is this service by verifying the services installed in machine xyz; and if indeed it is a service that should be connecting to that SQL Server instance, you can grant access by creating a login for the Windows user [abc\xyz$] and then grant proper permissions.

I hope this information helps. Let us know if you have any further questions.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||But, xyz$ is a computer account. How can I create a login for Computer Account in SQL? Is this possible?|||

CREATE LOGIN [abc\xyz$] FROM WINDOWS

It should work, let us know if it worked.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Hi Raul,

I created the login using the above mentioned command. It created find.

But, now I get two messages in event viewer.

One is success audit where is says login successful for user abc\xyz$.

immeditely, it also logs in the below failure message.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

In the earlier posts, you had mentioned about granting permissions to abc\xyz$ account?

What permissions should we grant.

Can you also help me with the syntax to grant those permissions.

Thanks

Santhosh

|||

Creating the loginshould typically be enough to connect to the system (using master DB).I would recommend using SLQ Server Profiler and check the Security Events section (mark show all events to see all possibilities), to be more specific mark everything under Audit Login & Audit logout

I hope this helps,

-Raul Garcia

SDE/T

SQL Server Engine

|||

We created a login for the computer account name in SQL Server.
From SQL Server, we ran
CREATE LOGIN [Domainname\computername$] FROM WINDOWS
The login created successfully.
Now, we see two audit messages for Domainname\Computername$.
First audit message is..

Login Succeded for user Domainname\Computername$. Connection Trusted.(Client :xx.xx.xx.xx)
Second Audit message is.. Login failed for user Domainname\Computername$. (Client :xx.xx.xx.xx)

Before creating the login, we had only login failed message. But, now we get login succeded message and login failed message for the same username.

Any thoughts would be helpful.

Thanks

Santhosh

|||

Unfortunately I really have no idea on what may be happening. I would suggest trying to enable other events, including any permission checks or any queries being started. Hopefully this extra information will give us a clue on why the connection is failing.

-Raul Garcia

SDE/T

SQL Server Engine

Login failed for user Domainname\computername

Hi,

I am using SQL Server 2005. The below message is added to the Application Event Viewer frequently.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

abc is my domain name and xyz is my computer name.

When I look @. the SQL error logs, I find the following message:

Error 18456 Severity 14 state 11

Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

Please let me know if you have any suggessions.

Thanks

Santhosh

It seems like a service running in the computer xyz is trying to connect to your SQL Server instance. This service must likely is running with local system or network service credentials.

I would recommend investigating what is this service by verifying the services installed in machine xyz; and if indeed it is a service that should be connecting to that SQL Server instance, you can grant access by creating a login for the Windows user [abc\xyz$] and then grant proper permissions.

I hope this information helps. Let us know if you have any further questions.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||But, xyz$ is a computer account. How can I create a login for Computer Account in SQL? Is this possible?|||

CREATE LOGIN [abc\xyz$] FROM WINDOWS

It should work, let us know if it worked.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Hi Raul,

I created the login using the above mentioned command. It created find.

But, now I get two messages in event viewer.

One is success audit where is says login successful for user abc\xyz$.

immeditely, it also logs in the below failure message.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

In the earlier posts, you had mentioned about granting permissions to abc\xyz$ account?

What permissions should we grant.

Can you also help me with the syntax to grant those permissions.

Thanks

Santhosh

|||

Creating the loginshould typically be enough to connect to the system (using master DB).I would recommend using SLQ Server Profiler and check the Security Events section (mark show all events to see all possibilities), to be more specific mark everything under Audit Login & Audit logout

I hope this helps,

-Raul Garcia

SDE/T

SQL Server Engine

|||

We created a login for the computer account name in SQL Server.
From SQL Server, we ran
CREATE LOGIN [Domainname\computername$] FROM WINDOWS
The login created successfully.
Now, we see two audit messages for Domainname\Computername$.
First audit message is..

Login Succeded for user Domainname\Computername$. Connection Trusted.(Client :xx.xx.xx.xx)
Second Audit message is.. Login failed for user Domainname\Computername$. (Client :xx.xx.xx.xx)

Before creating the login, we had only login failed message. But, now we get login succeded message and login failed message for the same username.

Any thoughts would be helpful.

Thanks

Santhosh

|||

Unfortunately I really have no idea on what may be happening. I would suggest trying to enable other events, including any permission checks or any queries being started. Hopefully this extra information will give us a clue on why the connection is failing.

-Raul Garcia

SDE/T

SQL Server Engine

Friday, February 24, 2012

Logging to Event Viewer "fails" but SQL Server logging works OK - why?

Greetings,

I am developing a package on my local workstation. I have defined two logging service providers. One is for SQL Server and the other is for the Windows Event Log. I am using the Dts.Log method in a script task to write log entries.

Logging is working properly with the SQL Server provider and rows are being inserted into the sysdtslog90 table. However, the only events that are being logged in the Windows Event Log are the package start and end events which I believe SSIS is doing automatically anyway.

Is there something I need to do to enable WIndows Event Log logging other than defining a log provider and making sure it is checked active? Won't SSIS write to two different logs with one Dts.Log call? Any ideas on what might be going wrong with my approach?

Thanks,

BCB

The answer is no - SSIS won't write to the Windows event log with one Dts.Log call. Writing to the event log takes a little more doing. The following code shows a method I used to do logging to the Windows event log. "rowsInserted" is a parameter that is specific to our business requirements. It can be omitted for most uses.

Public Sub WriteEventLogEntry(ByVal logMessage As String, ByVal entryType As EventLogEntryType, ByVal rowsInserted As Integer)

Try

Dim source As String

Dim log As String

Dim machine As String

' get system variables recorded in event log

Dim vars As Variables

Dts.VariableDispenser.LockOneForRead("System:Stick out tongueackageName", vars)

source = vars("PackageName").Value.ToString()

Dts.VariableDispenser.LockOneForRead("System::MachineName", vars)

machine = vars("MachineName").Value.ToString()

' log in Application group

log = "Application"

If Not EventLog.SourceExists(source, machine) Then

EventLog.CreateEventSource(source, log, machine)

End If

Dim eLog As New EventLog(log, machine, source)

If (rowsInserted >= 0) Then

eLog.WriteEntry(logMessage, entryType, rowsInserted)

Else

eLog.WriteEntry(logMessage, entryType) ' log does not allow negative numbers

End If

Catch ex As Exception

' do nothing - let processing continue

End Try

End Sub