• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

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

Would anyone know why a VBscript that works on 2000 and 2003, wouldn't work on NT?
0
SpinBob
Asked:
SpinBob
  • 4
  • 4
1 Solution
 
mdiglioCommented:
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
 
SpinBobAuthor Commented:
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
 
SpinBobAuthor Commented:
That's text file, not test file.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
mdiglioCommented:
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
 
grayeCommented:
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
 
SpinBobAuthor Commented:
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
 
mdiglioCommented:
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
 
SpinBobAuthor Commented:
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
 
mdiglioCommented:
Glad you got it working!
Thanks for the points
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now