Home All Groups Group Topic Archive Search About

How to run a script by a domain user ?

Author
30 Dec 2008 2:42 PM
Sunny Chan
Hi,

My question is how to let the domain user run the logon script.

************************************************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
    ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled =
True")
For Each objNetAdapter in colNetAdapters
    objNetAdapter.SetGateways array()
next
************************************************************************************

About this logon script, the users of Domain Admin can be run. But the users
of Domain User can not.

Author
30 Dec 2008 4:17 PM
Pegasus (MVP)
Show quote Hide quote
"Sunny Chan" <cl_***@sina.com> wrote in message
news:uPiOXzoaJHA.4664@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> My question is how to let the domain user run the logon script.
>
> ************************************************************************************
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> Set colNetAdapters = objWMIService.ExecQuery _
>    ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled =
> True")
> For Each objNetAdapter in colNetAdapters
>    objNetAdapter.SetGateways array()
> next
> ************************************************************************************
>
> About this logon script, the users of Domain Admin can be run. But the
> users of Domain User can not.

See the many replies you received in the scripting.vbscript newsgroup and
have a look here about the merits of cross-posting vs. multi-posting:
http://www.blakjak.demon.co.uk/mul_crss.htm. If you wish to extend the
exposure of your original post then cross-posting is the recommended method
to avoid duplication of effort.