x

SQL 08 Agent PowerShell job fails: "Logon failure: unknown user name or bad password"

I get this error:

"reason: Error authenticating proxy domain\user, system error: Logon failure: unknown user name or bad password."

This happens when I start my SQL 2008 Agent job that I created.

The job is owned by my domain account, I have full sysadmin rights on the SQL 08 install.

This is running on my local machine (for dev/testing).

There is 1 step which runs a PowerShell script:

       function Remove-OldFiles($folder, $logFile, $filter, $age)
    {
        Get-ChildItem $folder* -Include $filter -Exclude $logFile |
            ? { $_.LastWriteTime -le (Get-Date).AddMinutes(-$age) } |Remove-Item -verbose
    }

 Remove-OldFiles '\\server-name\c$\PSHtest\' 'DeleteLog.txt' *.txt, *.xml 3

It runs as a proxy account.

This proxy account is allowed to use the PowerShell subsystem only and as my domain account is part of sysadmin I have not assigned it to the proxy account principals list.

The proxy account uses a credential that is just my own domain account.

If I use the SQL Agent account to run the script the job does NOT fail, but the script itself cannot execute and returns the error:

"The error information returned by PowerShell is: 'An object at the specified path \servername\c$\PSHtest does not exist. "

Which is why I assigned a proxy to run, a proxy that has access to that part of the network for testing.

Suggestions on how I can correct this?

I've seen pages that say this error may be due to the service account not being enabled for delegation. Could that be the cause of this problem?

I am not familiar with the details of delegation so if that is the reason behind it a brief explanation would be greatly appreciated.

Thank you!

more ▼

asked Nov 19, 2009 at 03:39 PM in Default

Maxer gravatar image

Maxer
25 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Based on the URL you are attempting to access an administrative share on the server.

Try creating a non-administrative share and assign it permissions for your SQL Agent ID and/or Proxy account then try again.

more ▼

answered Nov 19, 2009 at 05:46 PM

Blackhawk-17 gravatar image

Blackhawk-17
11.9k 28 31 36

Ah of course! Wasn't even thinking there, I'll try that now and post back. Thanks for pointing that out :)

However, what about my proxy account? That account is my domain account which is admin on the local machine, why does that fail for my proxy account? My original issue of "reason: Error authenticating proxy domain\user, system error: Logon failure: unknown user name or bad password." ?
Nov 20, 2009 at 02:21 PM Maxer
I also had the SA account disabled so enabling that allowed Mixed Mode auth to work it seemed, then all was well.
Dec 01, 2009 at 11:35 AM Maxer
(comments are locked)
10|1200 characters needed characters left

The URL was part of the issue and it turns out that I had the SA account disabled and it appears that needs to be enabled for mixed auth to work. After doing that it seemed to work properly.

more ▼

answered Dec 01, 2009 at 11:35 AM

Maxer gravatar image

Maxer
25 1 1 1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1834
x88

asked: Nov 19, 2009 at 03:39 PM

Seen: 3847 times

Last Updated: Nov 19, 2009 at 03:39 PM