|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Copy file from server to workstation at logon
Can someone help regarding a file I would like copied to the local PC
everytime they logon to the domain. Server is 2000 and using active directory Thanks As long as the user has read permissions on the network share and write
permissions to the local directory, you can get by with a simple COPY command in a batch file. Create a simple script and a GPO to run it as a logon script. Or is there more to this question than meets the eye? -- Jeffery Hicks Microsoft PowerShell MVP http://www.scriptinganswers.com http://www.powershellcommunity.org Now Available: WSH and VBScript Core: TFM Coming Soon: Windows PowerShell: TFM 2nd Ed. Show quote "116" <1**@discussions.microsoft.com> wrote in message news:16AB0EBA-7D55-4C25-95EA-0C749B604D8F@microsoft.com... > Can someone help regarding a file I would like copied to the local PC > everytime they logon to the domain. > > Server is 2000 and using active directory > > Thanks One other approach would be to create a scheduled task set to run on logon
that runs the script. This would get around any permission issues because you could specify credentials. You could also remotely setup the task using SCHTASKS.EXE. -- Jeffery Hicks Microsoft PowerShell MVP http://www.scriptinganswers.com http://www.powershellcommunity.org Now Available: WSH and VBScript Core: TFM Coming Soon: Windows PowerShell: TFM 2nd Ed. Show quote "116" <1**@discussions.microsoft.com> wrote in message news:16AB0EBA-7D55-4C25-95EA-0C749B604D8F@microsoft.com... > Can someone help regarding a file I would like copied to the local PC > everytime they logon to the domain. > > Server is 2000 and using active directory > > Thanks On Nov 21, 7:31 pm, 116 <1***@discussions.microsoft.com> wrote:
> Can someone help regarding a file I would like copied to the local PC Try this script. Create a new GPO and apply on the OU containing the> everytime they logon to the domain. > > Server is 2000 and using active directory > > Thanks target computer. In that GPO, create a new startup script under Computer Configuration, and apply this script. Change the server, share, file and target names. This script copies the file to Windows folder of the target computer. '-----------Script starts--------------- on error resume next Const OverwriteExisting = TRUE strComputer = "." Set objFSO = CreateObject("Scripting.FileSystemObject") Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root \cimv2") Set colSettings = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colSettings objFSO.CopyFile "\\server\share \file.ext" ,objOperatingSystem.WindowsDirectory & "\" , OverwriteExisting Next set objFSO = null set objWMIService = null set colSettings = null '---------------Script ends----------------- |
|||||||||||||||||||||||