Why will this simple script NOT run under XP?

Why will this simple script NOT run under XP?

Post by TFoste » Wed, 02 Jul 2003 02:57:07



I have this simple script that runs fine under windows
2000 but it does not run under XP.  At first I thought it
might be Zone Alarm but the script still doesn't work when
I close Zone Alarm.

    Dim objNameSpace
    Dim Domain

    Set objNameSpace = GetObject("WinNT:")
    For Each Domain in objNamespace
        msgbox Domain.Name
    Next

Thanks,

Tom

 
 
 

Why will this simple script NOT run under XP?

Post by Richard Mueller [MVP » Wed, 02 Jul 2003 04:01:48



> I have this simple script that runs fine under windows
> 2000 but it does not run under XP.  At first I thought it
> might be Zone Alarm but the script still doesn't work when
> I close Zone Alarm.

>     Dim objNameSpace
>     Dim Domain

>     Set objNameSpace = GetObject("WinNT:")
>     For Each Domain in objNamespace
>         msgbox Domain.Name
>     Next

Hi,

It's not Zone Alarm. I'm not sure it's W2k vs XP. On both W2k and Win9x I
find that at first your code outputs nothing. However, I added similar code
to enumerate the LDAP namespace and ever since both namespaces enumerate my
domain. I have no explanation, but now your snippet works on both clients,
plus NT.

Note that binding to WinNT: (or LDAP:) is usually done to invoke the
OpenDSObject method, with which you can supply alternate credentials.
Perhaps no credentials are required to bind to "WinNT:", so you have no
rights to see anything. If later the client somehow does authenticate you to
WinNT:, you can henceforth see objects in the namespace. Just guessing.

Personnally, I bind to the RootDSE object with the LDAP provider to
determine the DNS domain name. I then use NameTranslate to convert this to
the NetBIOS domain name if I need it. If your intent is to determine the
NetBIOS domain name, then either use RootDSE and NameTranslate, or find some
reliable way to force authentication to the WinNT: namespace. I don't know
how to do that without first knowing the NetBIOS domain name, and I'd hate
to rely on my experience above (binding to LDAP: first). Otherwise, if you
know your client is NT or above, you can use WshShell to retrieve the
UserDomain environment variable.

--
Richard
Microsoft MVP Scripting and ADSI
http://www.rlmueller.net
--

 
 
 

1. Simple script doesn't run

Could someone explain me why I am not able to get this script running on my
SMS-clients?

xcopy "c:\sms_repository\as400\NS2000.ws" "c:\temp" >> c:\temp.txt
xcopy "c:\sms_repository\as400\Primary Enviroment.env" "c:\temp" >>
c:\temp.txt
xcopy "c:\sms_repository\as400\hosts" "c:\temp" >> c:\temp.txt

I defined the source-directory as: c:\sms_repository\as400
this directory contains the files I wish to copy to my clients.

Permissions should be OK; program runs with admin rights... I was able to
execute a comparable file on my workstation...why can't I run this simple
script with SMS without getting the status >failed<???

Cheers from Holland!

Piet

2. Asynchronous pulldown menus, why not?

3. Simple script doesn't run...

4. Amiga 2000 & Many Extras

5. Fax Server WHY WHY WHY WHY WHY !!!!!!!

6. WTB: AC Adapter/Power Supply for Model 600

7. SMSLS.BAT not running, but pre-existing logon scripts running

8. Bringing in Interleaf files

9. Simple schedule not running to completion

10. Why non-administrators do not execute login scripts

11. Logon script not running

12. Not running Logon script, and UPS shutdown

13. Logon Script not running