Solved

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

Posted on 2006-06-28
9
287 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
  • 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question about INSTR  - need to extract data MS ACCESS query 6 56
SQL VB connection works in one PC and doesn't in another 15 64
Spell Check in VB6 13 114
RUNRMTCMD from AS/400 12 47
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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

832 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