Re: VBS Logon and move computer script
From: Adrian Marsh (NNTP) (marsh_removeme__at_lucent.com)
Date: 11/24/04
- Next message: Raul Rego: "Re: logon script on w2k domain"
- Previous message: Stefano Baronio: "Re: WMI & other operating systems"
- In reply to: Richard Mueller [MVP]: "Re: VBS Logon and move computer script"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Nov 2004 15:14:51 +0000
Richard,
Could you take a look at the following lines and tell me if you can see
an obvious problem?
I switched over the Computer scripts, and it works for actually moving
the PC account, but when its finished and rebooted I get a message
saying cmd.exe had failed, and then I have subsequent problems with
other programs. If I take this script out of the login process, those
problems go away.
If I run this script manually from a cmd.exe/cscript prompt, I get :
"Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
\\swocmpq02\software$\_logon\_moveaccount.vbs(3, 1) (null): There is no
such object on the server."
Which is correct I guess, but how can I make the error message go
away??? If I put that PC back into Computers, then no error occurs..
Is there another way of doing the same thing??
Top of script:
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set currentAccount = GetObject("LDAP://CN=" & strComputer &
",CN=Computers,DC=uk-lab,DC=lucent,DC=com")
If not currentAccount is Nothing Then
.....
Richard Mueller [MVP] wrote:
> Hi,
>
> If all of your clients are W2k or above, it might be better to run this as
> StartUp script (using Group Policy). StartUp scripts run with System
> privileges, which might be enough for you. There is no user, but you can
> manipulate the computer account.
>
> A program running on the client cannot reboot the machine and then continue
> running. I would suggest that you find a way to detect that the tasks in
> Script A are complete. This might be checking the location of the computer
> object. Or, you might have to save a "flag" file on the hard drive
> indicating that the tasks in Script A are complete. Then, the next time the
> machine starts (after the reboot), the program would check first to see if
> Script A is complete. If so, continue with the tasks in Script B and C.
>
> In fact, there should also be a flag to indicate when all the tasks are
> complete. When the program starts, if it detects this final flag, it knows
> everthing has been done and exits.
>
> The flag can be the existence of a file, a registry entry, the value of an
> AD attribute (of the computer object), or perhaps the location of the
> computer object. Otherwise, you have make sure it is OK for the program to
> run repeatedly.
>
- Next message: Raul Rego: "Re: logon script on w2k domain"
- Previous message: Stefano Baronio: "Re: WMI & other operating systems"
- In reply to: Richard Mueller [MVP]: "Re: VBS Logon and move computer script"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|