Re: Change Service Account

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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\/\/
>
.



Relevant Pages

  • Re: Running compiled windows service python script
    ... I have a windows service. ... I can install, start and stop this service as ... if I create an exe of this script (all required modules ...
    (comp.lang.python)
  • Re: Windows Services
    ... I converted that script to a stand ... > I'm afraid that you can't just run any old executable as a Windows service. ... I think there is some wrapper programs that can wrap around any console ...
    (comp.lang.python)
  • Python script running as Windows service: Clean shutdown
    ... I'm trying to run a Python script as a Windows service with a defined ... I understand that for a clean shutdown of a Windows service one would ... eclient = Eclient ...
    (comp.lang.python)
  • Re: Windows Services
    ... service and how to run a *python script* as a Windows service. ... I have developed a script that monitors a specified folder for changes ... alone exe using py2exe. ...
    (comp.lang.python)
  • Re: Another FTP Scenario
    ... I have an RPG program which accepts each line of the script as a parameter ... I then FTP to the Windows machine, ... End result is a multi-threaded windows service that uses the built in ...
    (comp.sys.ibm.as400.misc)