Get the computer name in visual basic script

From: noxize (noxize_at_discussions.microsoft.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 09:05:06 -0700

Hi,

I need to change the Local Administrator password on my domain's computers.
I use Windows Server 2003 as a DC and I saw that there is no way to do that
through a GPO. Then I saw the following script on Ms TechNet :

"Changing the Local Administrator Password"

strComputer = "MyComputer"
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator, user")
objUser.SetPassword "testpassword"
objUser.SetInfo

I tried it on my own computer and It worked perfectly. Now I'd like to
deploy it through an "Opening Session Script" and a GPO. But I need to get
the system variable "ComputerName" in my VB Script. How could I get this
variable and apply it to this script ?

I am not a VB developper, help would be much appreciated.

Thanks in advance.



Relevant Pages

  • Re: Login Script user exclusions
    ... You might be able to paste the code below into your script. ... If the list of computers is long this approach might not work, ... Make sure the login script is defined to run via the GPO, ...
    (microsoft.public.windows.server.scripting)
  • Re: Group policy does not apply correctly .. please comment
    ... user policy to be different on some specific computers (e.g terminal servers ... You need to put the logon script into a separate GPO that is linked to ...
    (microsoft.public.windows.group_policy)
  • Re: Computers didnt receive the GPO update on reboot
    ... reboot or script it. ... > selected the startup script properties of my GPO. ... > computers into, it works fine on next reboot. ... > into a new OU in order to have my new startup script working.. ...
    (microsoft.public.win2000.active_directory)
  • Re: Pushing out a password CHange
    ... You can create a script file to affect the change (e.g. net user ... computer startup script GPO. ... the command "net user administrator %1" will change the ... the AGP right to "domain computers" or whatever security group you wish ...
    (microsoft.public.windows.server.general)
  • Re: To force the local admin password
    ... I have very strange issue with a policy. ... I would like to force the local admin password on the computers. ... So I created a policy with a script to apply when the ... The local administrator password is not changed on all computers. ...
    (microsoft.public.windows.server.active_directory)