View Single Post
Old 01-28-2008   #7 (permalink)
Marco Shaw [MVP]


 
 

Re: start-psjob - user credentials

Robin Moffatt wrote:
Quote:

> Got around it by using
> $server = New-Object 'Microsoft.sqlserver.management.smo.server'
> $server_path
> $server.ConnectionContext.LoginSecure = $false
> $server.ConnectionContext.login = $db_user
> $server.ConnectionContext.password = $db_pw
>
> I'd still like to understand how authentication under psjobs works
> though, if anyone can explain it.
Apparently Windows authentication should be the default, but you can
maybe try to force that by adding:
$server=new-object...
$server.ConnectionContext.LoginSecure = $true

Give that a try in your script. If that doesn't work, I'll test and try
to get to the bottom of this.

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec