Solved

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

Posted on 2006-06-28
9
285 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now