View Single Post
Old 01-25-2008   #4 (permalink)
Robin Moffatt


 
 

Re: start-psjob - user credentials

On Jan 25, 3:24 am, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com>
wrote:
Quote:

> 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
>
Quote:

> > I'd still like to understand how authentication under psjobs works
> > though, if anyone can explain it.
>
> I think the important concept here is that you've gone and created a new
> object. The moment you create a object, you need to redefine your
> credentials again.
>
> Marco
Hi Marco,
Thanks for your reply. I'm afraid I don't understand though. If I run
the script from the console, or the commands interactively, I don't
have to authenticate individual objects.
Are you saying that I can't run backgound jobs and use trusted
authentication? That sounds like quite a limitation.
Is there any way I can see what the current credentials of the user
are? Or pick them up from when a script is started as a background
job?

Thanks, Robin.
My System SpecsSystem Spec