Re: Change Service Account
- From: "Arne Tiedemann" <ArneTiedemann@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 Dec 2005 03:19:02 -0800
Hello,
thanks for your reply.
I've test them, but it dosn't work.
To me someone can say which the other parameters to mean objService.Change(
X, X, X, X, X, X,"Domain\User", "Password").
I've change the script to
-------script snip ----------
objService.Change( , , , , , 0, "X-SafeGuard@xxxxxx", "")
-------end -----------
and this works fine, but I dont know what 0 means.
Are the parameter anywhere documented?
Thanks and by by
"/\\/\\o\\/\\/" wrote:
> Arne Tiedemann wrote:
> > Hello @All,
> >
> > I'll change the logon User for a Windows Service but I get an error in my
> > Script.
> >
> > ---- My Script -------------
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:" _
> > & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> >
> > Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
> > Set objWMIService =
> > SWBemlocator.ConnectServer(strComputer,"\root\CIMV2",UserName,Password)
> > Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where
> > DisplayName = 'SafeGuard Easy Client'",,48)
> >
> >
> > For each objService in colItems
> >
> > errServiceChange = objService.Change( , , , , , ,"Domain\User")
> > errPasswdChange = objService.Change( , , , , , , ,"Passwd")
> >
> > wscript.echo(errServiceChange &":"& errPasswdChange)
> >
> > objService.StopService()
> > wscript.sleep 20000
> > objService.StartService()
> >
> > Next
> >
> > ------- Ende -----------
> >
> > The 'errServiceChange' returns 21 an the Service is not changed from
> > LocalSystem to the User!
> >
> > Can Anybody Help me?
> >
> > Thanks an have i nice christmas
>
> error 21 means
>
> 21 - Invalid parameters have been passed to the service.
>
> i think you miss a parameter in the first call, you need to set the
> password with the user,
>
> errServiceChange = objService.Change( , , , , , ,"Domain\User","Passwd")
>
> that will do both at the same time, if that does not work check your
> user parmeter
>
> gr /\/\o\/\/
>
.
- Follow-Ups:
- Re: Change Service Account
- From: /\\/\\o\\/\\/
- Re: Change Service Account
- References:
- Re: Change Service Account
- From: /\\/\\o\\/\\/
- Re: Change Service Account
- Prev by Date: Re: wireless in XP
- Next by Date: Re: Change Service Account
- Previous by thread: Re: Change Service Account
- Next by thread: Re: Change Service Account
- Index(es):
Relevant Pages
|