This script worked last week, and now it doesn't. I don't know what
has changed, but I know the script hasn't changed.

The portion that's failing can be run alone:
-=-=-=-
Set oService = GetObject("WinMgmts:{impersonationLevel=impersonate}!\
\SERVERNAME\root\cimv2:Win32_Service.Name='SERVICENAME")

oService.stopService
-=-=-=-

I'm running it as privileged admin, the same way I ran it last week
when it worked. Now it gives me a dialog box titled "Windows Script
Host" with this data:
Script: [path to script]
Line: 3
Char: 1
Error: A security package specific error occured.
Code: 80070721
Source: (null)

Re: Error while using impersonation to manage a service remotely by Al

Al
Thu Oct 18 20:48:19 PDT 2007


"Rick Onanian" <groups.theholycow@xoxy.net> wrote in message
news:1192735701.515258.81200@v29g2000prd.googlegroups.com...
> This script worked last week, and now it doesn't. I don't know what
> has changed, but I know the script hasn't changed.
>
> The portion that's failing can be run alone:
> -=-=-=-
> Set oService = GetObject("WinMgmts:{impersonationLevel=impersonate}!\
> \SERVERNAME\root\cimv2:Win32_Service.Name='SERVICENAME")
>
> oService.stopService
> -=-=-=-
>
> I'm running it as privileged admin, the same way I ran it last week
> when it worked. Now it gives me a dialog box titled "Windows Script
> Host" with this data:
> Script: [path to script]
> Line: 3
> Char: 1
> Error: A security package specific error occured.
> Code: 80070721
> Source: (null)

Seems like a privilege issue. I'd check to see that the account you are
using is still a member of the local administrators group on the target
machine.

/Al



Re: Error while using impersonation to manage a service remotely by Rick

Rick
Fri Oct 19 06:22:38 PDT 2007

On Oct 18, 11:48 pm, "Al Dunbar" <AlanD...@hotmail.com.nospaam> wrote:
> Seems like a privilege issue. I'd check to see that the account you are
> using is still a member of the local administrators group on the target
> machine.

I think it's a privilege issue too. However, using the same account, I
can login to that machine and restart the service, and I can even do
it remotely using services.msc.


Re: Error while using impersonation to manage a service remotely by Rick

Rick
Thu Oct 25 08:30:44 PDT 2007

On Oct 18, 3:28 pm, Rick Onanian <groups.theholy...@xoxy.net> wrote:
> This script worked last week, and now it doesn't. I don't know what
> has changed, but I know the script hasn't changed.

A co-worker wrote some different code that does the job. Today I went
to put that code into my script and tested the script first, and now
it's working again. Is a little consistency too much to ask?

I'm still going to re-write with the new code, which should be more
reliable.