Solved

VBscript not working on NT platform...A stumper!!

Posted on 2006-06-28
9
291 Views
Last Modified: 2010-04-07
Would anyone know why a VBscript that works on 2000 and 2003, wouldn't work on NT?
0
Comment
Question by:SpinBob
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 16

Expert Comment

by:mdiglio
ID: 17001333
Hello,
Without seeing what is in your script...one guess is because you're using WMI

you can download wmi for NT here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=C174CFB1-EF67-471D-9277-4C2B1014A31E&displaylang=en

Other than that you'll have to post your script or at least the part it failed on.
what was the error message?
0
 

Author Comment

by:SpinBob
ID: 17001653
The script pulls the data from a csv test file and either Enables, Deletes or Disables the user account based on the input file. Here's the Function for Delete user. The error message is "File name or class name not found during Automation operation". Again, this works on all 2000 and 2003 platforms. It breaks on NT. The NT plaforms are at Sp6 with all of the updates. The MDAC, JET, WSH and WMI are all updated.

Function fncDeleteUser(strInHost, strInUser)
  On Error Resume Next
  Set objStore = GetObject("WinNT://" & strInHost)     <-- This is the line where I get the error message
  Call objStore.Delete("user", strInUser)
     If err.number <> 0 Then
        strCurrentDescription = "USER NOT FOUND"
        err.clear
     End If
  fncLogOut strInHost,strInUser,strCurrentDescription,"Delete"
End Function
0
 

Author Comment

by:SpinBob
ID: 17001672
That's text file, not test file.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 16

Expert Comment

by:mdiglio
ID: 17003158
What happens if you put this line after the on error resume next:
msgbox strInHost

Where is this script running from...does the account it is running from have the necessary permissions?

does it fail if you hard coded everything?
Set objStore = GetObject("WinNT://NTComputer")

I don't know what the differences are with NT 4.0 and I can't test them but would changing that line to this be any different
GetObject("WinNT://" & strInHost & "")
( Hey...its worth a shot )
0
 
LVL 41

Expert Comment

by:graye
ID: 17006208
I was thinking that the strInHost name is probably a FQN name like SomeServer.SomeDomain.Com rather than a NetBIOS name such as SOMESERVER
0
 

Author Comment

by:SpinBob
ID: 17007359
It's returning the machine name, GetObject("WinNt://NTcomputer), it's puking on something that's for sure.

I'm really confused by it all. I've covered the internet and all of the scripts keep using GetObject(), but it doesn't work. The NT Servers being tested are not PDCs or BDCs, these are Standalone, with no Active Directory. The test bed is a Workgroup not a domain.

0
 
LVL 16

Accepted Solution

by:
mdiglio earned 500 total points
ID: 17009176
Just for clarification, when I suggested hardcoding ("WinNT://NTComputer")
I meant to say ("WinNT://YOUR-NTComputer-NAME")

While looking for the possible causes I have also seen the GetObject written like this:
Set objStore = GetObject("WinNT://" & strInHost & ",computer")

This line came from here:
http://dev.coadmin.dk/Resources/ADSI%20SDK%205%20HTML/winnt.htm

I think that link also suggests downloading
Active Directory Extension for Windows NT 4.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=7C219DCC-EC00-4C98-BA61-FD98467952A8&displaylang=en

I know you're in a workgroup and not a domain but give that a look.
I would be hesitant to load anything new on your NT server just yet
0
 

Author Comment

by:SpinBob
ID: 17011006
Well done mdiglio. It was the Dsclient I was missing. All is well. You earned the 500 points my friend. Thanks to everyone for your help.
0
 
LVL 16

Expert Comment

by:mdiglio
ID: 17011395
Glad you got it working!
Thanks for the points
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question