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

avatar image

Maxer
25 1 3 4

(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

avatar image

Blackhawk-17
12k 30 35 42

(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

avatar image

Maxer
25 1 3 4

(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.

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:

x2091
x107

asked: Nov 19, 2009 at 03:39 PM

Seen: 4264 times

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

Copyright 2016 Redgate Software. Privacy Policy