Home All Groups Group Topic Archive Search About


Author
11 May 2005 5:18 AM
Danny Tiongco
I wrote a script that copies a file from a domain shared folder and placed it
in the "Computer Logon" script section of AD. It seems that I am having
problems with accessing the shared folder since the script is running on the
local administrator account when the computer starts-up.

Is there a work around for this?

Author
11 May 2005 3:18 PM
Torgeir Bakken (MVP)
Danny Tiongco wrote:

> I wrote a script that copies a file from a domain shared folder and placed it
> in the "Computer Logon" script section of AD. It seems that I am having
> problems with accessing the shared folder since the script is running on the
> local administrator account when the computer starts-up.
>
> Is there a work around for this?
Hi,

To be able to access files over the network from the computer startup
script, you could put the file(s) on a network share and grant read
access for the AD group "Domain Computers" to the share.

Alternatively, from the startup script, you could map a drive on
the fly, like this:

sDomainUser = "arp.corp\computer_fix"
sPswd = "something"

Set oNetwork = CreateObject("Wscript.Network")

oNetwork.MapNetworkDrive _
    "Y:", "\\server\netlogon\some folder",, sDomainUser, sPswd



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Author
13 May 2005 9:24 AM
Danny Tiongco
Thank you so much. It was a great help.

Show quote
"Torgeir Bakken (MVP)" wrote:

> Danny Tiongco wrote:
>
> > I wrote a script that copies a file from a domain shared folder and placed it
> > in the "Computer Logon" script section of AD. It seems that I am having
> > problems with accessing the shared folder since the script is running on the
> > local administrator account when the computer starts-up.
> >
> > Is there a work around for this?
> Hi,
>
> To be able to access files over the network from the computer startup
> script, you could put the file(s) on a network share and grant read
> access for the AD group "Domain Computers" to the share.
>
> Alternatively, from the startup script, you could map a drive on
> the fly, like this:
>
> sDomainUser = "arp.corp\computer_fix"
> sPswd = "something"
>
> Set oNetwork = CreateObject("Wscript.Network")
>
> oNetwork.MapNetworkDrive _
>     "Y:", "\\server\netlogon\some folder",, sDomainUser, sPswd
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx
>

AddThis Social Bookmark Button