WMI and WSH works on Win2000Pro but not NT 4 
Author Message
 WMI and WSH works on Win2000Pro but not NT 4

Hello,

I've been working with WSH for all of about 2 days now, so my apologies in
advance if this is a stupid question...

I have an NT 4 server that lately has been having a problem with the web and
ftp services stopping with no obvious reason and no event log entries.
After discovering WSH, I realized that this would be a good way to check the
services and restart them if needed.  I can also log entries in the event
log so I can see exactly when the service stops (or reasonably closer than
when the first customer calls to complain).

Anyway, I developed and tested a script on a Windows 2000 Professional
machine and it works great.  However, I copied it to two different NT 4
(SP6a) servers running IIS 4 and WSH 5.1 and get an error on the following
line:

 Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")

The error I get (via WSCRIPT since it's a little more verbose) is:

Script:  c:\wsh\chksvcs.vbs
Line:    27
Char:    2
Error:   Invalid syntax
Code:    800401E4
Source:  (null)

Again, this works great on Win2000 and shows me the status of each service I
pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
verified that the services I'm checking exist and are named the same as on
Win2000.

Thanks!

--Todd.



Thu, 11 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4

WMI download (wbemcore.exe)
http://www.microsoft.com/downloads/release.asp?ReleaseID=10648

--
Michael Harris


  This might seem like to obvious a question, but do you have Windows
  Management installed on the NT 4 server?  It isn't installed by default on
  NT 4, so you do need to add it.  I believe it is on the SP4 CD.

  Stu
  MVP, Exchange



  > Hello,
  >
  > I've been working with WSH for all of about 2 days now, so my apologies in
  > advance if this is a stupid question...
  >
  > Anyway, I developed and tested a script on a Windows 2000 Professional
  > machine and it works great.  However, I copied it to two different NT 4
  > (SP6a) servers running IIS 4 and WSH 5.1 and get an error on the following
  > line:
  >
  >  Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")
  >
  > The error I get (via WSCRIPT since it's a little more verbose) is:
  >
  > Script:  c:\wsh\chksvcs.vbs
  > Line:    27
  > Char:    2
  > Error:   Invalid syntax
  > Code:    800401E4
  > Source:  (null)
  >
  > Again, this works great on Win2000 and shows me the status of each service
  I
  > pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
  > verified that the services I'm checking exist and are named the same as on
  > Win2000.
  >
  > Thanks!
  >
  > --Todd.
  >
  >
  >
  >
  >



Thu, 11 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4
Todd

Try installing  ADSI 2.5. The "800" is a scripting error and the 401 is
usually means ADSI is not available.

Gary


Quote:
> Hello,

> I've been working with WSH for all of about 2 days now, so my apologies in
> advance if this is a stupid question...

> I have an NT 4 server that lately has been having a problem with the web
and
> ftp services stopping with no obvious reason and no event log entries.
> After discovering WSH, I realized that this would be a good way to check
the
> services and restart them if needed.  I can also log entries in the event
> log so I can see exactly when the service stops (or reasonably closer than
> when the first customer calls to complain).

> Anyway, I developed and tested a script on a Windows 2000 Professional
> machine and it works great.  However, I copied it to two different NT 4
> (SP6a) servers running IIS 4 and WSH 5.1 and get an error on the following
> line:

>  Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")

> The error I get (via WSCRIPT since it's a little more verbose) is:

> Script:  c:\wsh\chksvcs.vbs
> Line:    27
> Char:    2
> Error:   Invalid syntax
> Code:    800401E4
> Source:  (null)

> Again, this works great on Win2000 and shows me the status of each service
I
> pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
> verified that the services I'm checking exist and are named the same as on
> Win2000.

> Thanks!

> --Todd.



Thu, 11 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4
This might seem like to obvious a question, but do you have Windows
Management installed on the NT 4 server?  It isn't installed by default on
NT 4, so you do need to add it.  I believe it is on the SP4 CD.

Stu
MVP, Exchange


Quote:
> Hello,

> I've been working with WSH for all of about 2 days now, so my apologies in
> advance if this is a stupid question...

> Anyway, I developed and tested a script on a Windows 2000 Professional
> machine and it works great.  However, I copied it to two different NT 4
> (SP6a) servers running IIS 4 and WSH 5.1 and get an error on the following
> line:

>  Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")

> The error I get (via WSCRIPT since it's a little more verbose) is:

> Script:  c:\wsh\chksvcs.vbs
> Line:    27
> Char:    2
> Error:   Invalid syntax
> Code:    800401E4
> Source:  (null)

> Again, this works great on Win2000 and shows me the status of each service
I
> pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
> verified that the services I'm checking exist and are named the same as on
> Win2000.

> Thanks!

> --Todd.



Fri, 12 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4

Quote:
> This might seem like to obvious a question, but do you have Windows
> Management installed on the NT 4 server?  It isn't installed by default on
> NT 4, so you do need to add it.  I believe it is on the SP4 CD.

> Stu
> MVP, Exchange



> > Hello,

> > I've been working with WSH for all of about 2 days now, so my apologies in
> > advance if this is a stupid question...

> > Anyway, I developed and tested a script on a Windows 2000 Professional
> > machine and it works great.  However, I copied it to two different NT 4
> > (SP6a) servers running IIS 4 and WSH 5.1 and get an error on the following
> > line:

> >  Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")

> > The error I get (via WSCRIPT since it's a little more verbose) is:

> > Script:  c:\wsh\chksvcs.vbs
> > Line:    27
> > Char:    2
> > Error:   Invalid syntax
> > Code:    800401E4
> > Source:  (null)

> > Again, this works great on Win2000 and shows me the status of each service
> I
> > pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
> > verified that the services I'm checking exist and are named the same as on
> > Win2000.

> > Thanks!

> > --Todd.

or you can download it

http://msdn.microsoft.com/downloads/sdks/wmi/download.asp
--
If you would like to reply, please reply via the newsgroup....Thank you!



Fri, 12 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4
OK...don't I feel stupid.  No, I don't believe I ever installed WMI.  I
didn't realize it was a separate component.  However, I just installed it
and am still getting an error.  This time the error is a little different...

Script:  c:\wsh\chksvcs.vbs
Line:    27
Char:    2
Error:   0x80041003
Code:    80041003
Source:  (null)

This one is even more cryptic.  Any ideas?

Thanks!

--Todd.


Quote:
> This might seem like to obvious a question, but do you have Windows
> Management installed on the NT 4 server?  It isn't installed by default on
> NT 4, so you do need to add it.  I believe it is on the SP4 CD.

> Stu
> MVP, Exchange



> > Hello,

> > I've been working with WSH for all of about 2 days now, so my apologies
in
> > advance if this is a stupid question...

> > Anyway, I developed and tested a script on a Windows 2000 Professional
> > machine and it works great.  However, I copied it to two different NT 4
> > (SP6a) servers running IIS 4 and WSH 5.1 and get an error on the
following
> > line:

> >  Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")

> > The error I get (via WSCRIPT since it's a little more verbose) is:

> > Script:  c:\wsh\chksvcs.vbs
> > Line:    27
> > Char:    2
> > Error:   Invalid syntax
> > Code:    800401E4
> > Source:  (null)

> > Again, this works great on Win2000 and shows me the status of each
service
> I
> > pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
> > verified that the services I'm checking exist and are named the same as
on
> > Win2000.

> > Thanks!

> > --Todd.



Fri, 12 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4
OK...time for some more stupid questions...

I installed ADSI 2.5 but it didn't make a difference.  I wouldn't think
anything here would require ADSI, would it?  I'm only looking at the service
status.  I *did* install WMI 1.1 which I had forgotten.  Now I'm getting a
slightly different error message.  It is below.  Can you tell me where one
would find what the portions of the error code mean, like you mention below?

Here's the new error:

Script:  c:\wsh\chksvcs.vbs
Line:    27
Char:    2
Error:   0x80041003
Code:    80041003
Source:  (null)

The error is on the same line as my original post.

Thanks!

--Todd.


Quote:
> Todd

> Try installing  ADSI 2.5. The "800" is a scripting error and the 401 is
> usually means ADSI is not available.

> Gary



> > Hello,

> > I've been working with WSH for all of about 2 days now, so my apologies
in
> > advance if this is a stupid question...

> > I have an NT 4 server that lately has been having a problem with the web
> and
> > ftp services stopping with no obvious reason and no event log entries.
> > After discovering WSH, I realized that this would be a good way to check
> the
> > services and restart them if needed.  I can also log entries in the
event
> > log so I can see exactly when the service stops (or reasonably closer
than
> > when the first customer calls to complain).

> > Anyway, I developed and tested a script on a Windows 2000 Professional
> > machine and it works great.  However, I copied it to two different NT 4
> > (SP6a) servers running IIS 4 and WSH 5.1 and get an error on the
following
> > line:

> >  Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")

> > The error I get (via WSCRIPT since it's a little more verbose) is:

> > Script:  c:\wsh\chksvcs.vbs
> > Line:    27
> > Char:    2
> > Error:   Invalid syntax
> > Code:    800401E4
> > Source:  (null)

> > Again, this works great on Win2000 and shows me the status of each
service
> I
> > pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
> > verified that the services I'm checking exist and are named the same as
on
> > Win2000.

> > Thanks!

> > --Todd.



Fri, 12 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4

WMI Error Constants
http://msdn.microsoft.com/library/psdk/wmisdk/errorwmi_4bxv.htm

WBEM_E_ACCESS_DENIED
0x80041003
The current user does not have permission to perform the action.

--
Michael Harris


  OK...time for some more stupid questions...

  I installed ADSI 2.5 but it didn't make a difference.  I wouldn't think
  anything here would require ADSI, would it?  I'm only looking at the service
  status.  I *did* install WMI 1.1 which I had forgotten.  Now I'm getting a
  slightly different error message.  It is below.  Can you tell me where one
  would find what the portions of the error code mean, like you mention below?

  Here's the new error:

  Script:  c:\wsh\chksvcs.vbs
  Line:    27
  Char:    2
  Error:   0x80041003
  Code:    80041003
  Source:  (null)

  The error is on the same line as my original post.

  Thanks!

  --Todd.



  > Todd
  >
  > Try installing  ADSI 2.5. The "800" is a scripting error and the 401 is
  > usually means ADSI is not available.
  >
  > Gary
  >


  > > Hello,
  > >
  > > I've been working with WSH for all of about 2 days now, so my apologies
  in
  > > advance if this is a stupid question...
  > >
  > > I have an NT 4 server that lately has been having a problem with the web
  > and
  > > ftp services stopping with no obvious reason and no event log entries.
  > > After discovering WSH, I realized that this would be a good way to check
  > the
  > > services and restart them if needed.  I can also log entries in the
  event
  > > log so I can see exactly when the service stops (or reasonably closer
  than
  > > when the first customer calls to complain).
  > >
  > > Anyway, I developed and tested a script on a Windows 2000 Professional
  > > machine and it works great.  However, I copied it to two different NT 4
  > > (SP6a) servers running IIS 4 and WSH 5.1 and get an error on the
  following
  > > line:
  > >
  > >  Set objinst = GetObject("WinMgmts::Win32_service='MSFTPSVC'")
  > >
  > > The error I get (via WSCRIPT since it's a little more verbose) is:
  > >
  > > Script:  c:\wsh\chksvcs.vbs
  > > Line:    27
  > > Char:    2
  > > Error:   Invalid syntax
  > > Code:    800401E4
  > > Source:  (null)
  > >
  > > Again, this works great on Win2000 and shows me the status of each
  service
  > I
  > > pass to it.  Any idea why it doesn't work on NT4 with WSH 5.1?  I've
  > > verified that the services I'm checking exist and are named the same as
  on
  > > Win2000.
  > >
  > > Thanks!
  > >
  > > --Todd.
  > >
  > >
  > >
  > >
  > >
  >
  >



Fri, 12 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4

Return Types: HRESULT and SCODE
http://msdn.microsoft.com/library/books/inole/S10F2.HTM

HRESULT
http://msdn.microsoft.com/library/specs/s1d153.htm

--
Michael Harris




  > OK...don't I feel stupid.  No, I don't believe I ever installed WMI.  I
  > didn't realize it was a separate component.

  Simple mistake to make, especially if you aren't aware of it.

  > However, I just installed it
  > and am still getting an error.  This time the error is a little
  different...
  >
  > Script:  c:\wsh\chksvcs.vbs
  > Line:    27
  > Char:    2
  > Error:   0x80041003
  > Code:    80041003
  > Source:  (null)
  >
  > This one is even more cryptic.  Any ideas?

  There is a way to convert these into less cryptic errors, and it is poorly
  covered in the MS material, so I'm hoping someone more knowledgable will do
  so, and explain it for you (and me)

  Stu



Fri, 12 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4


Quote:
> OK...don't I feel stupid.  No, I don't believe I ever installed WMI.  I
> didn't realize it was a separate component.

Simple mistake to make, especially if you aren't aware of it.

Quote:
> However, I just installed it
> and am still getting an error.  This time the error is a little
different...

> Script:  c:\wsh\chksvcs.vbs
> Line:    27
> Char:    2
> Error:   0x80041003
> Code:    80041003
> Source:  (null)

> This one is even more cryptic.  Any ideas?

There is a way to convert these into less cryptic errors, and it is poorly
covered in the MS material, so I'm hoping someone more knowledgable will do
so, and explain it for you (and me)

Stu



Sat, 13 Jul 2002 03:00:00 GMT  
 WMI and WSH works on Win2000Pro but not NT 4

Excellent, thanks very much.  I've filed those away in my WSH folder :)

Stu

  Return Types: HRESULT and SCODE
  http://msdn.microsoft.com/library/books/inole/S10F2.HTM

  HRESULT
  http://msdn.microsoft.com/library/specs/s1d153.htm



Sat, 13 Jul 2002 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. WSH is not working under NT 4.0

2. WMI and ASP pages not working

3. WMI not working on Wn9x

4. WMI Not working in ASP

5. win2k resource kit VBS files do not work with WMI or WBEM

6. WMI Not working after Server Name Change

7. WMI not working on XP (scriptomatic)

8. ps2ai does not work under NT, why?

9. it's work with windows NT not with Windows 95

10. CODEBASE ON NT NOT WORKING - NEWBIE

11. Drive Map Issue- Works with W2K not with Windows NT

12. Works on NT but not win 98

 

 
Powered by phpBB® Forum Software