The second line in leew's post above should likely read something like:
If "%errorlevel%" == "1" Copy \\server\staff\abc.xls "%userprofile%\desktop"
Since there are spaces in the path, you may receive an error similar to "syntax is incorrect" without the quotes. Depending upon how distributed your environment may be, you may also want to change the reference to NETLOGON to use the device that authenticated the user. Something like this:
%logonserver%\netlogon\ifm
If you were opposed to using external utilities, you could likely complete this task using VBScript and ADSI (if your client OS is Windows 2000 or newer or you have the DS client installed on NT4). Something similar to this saved with a .vbs extension would likely accomplish the task:
Set objWSHNetwork = WScript.CreateObject("WScr
Set objWSHShell = WScript.CreateObject("WScr
Set objGroup = GetObject("WinNT://" & objWSHNetwork.UserDomain & "/Staff")
If objGroup.IsMember("WinNT:/
Set objFSO = WScript.CreateObject("Scri
objFSO.CopyFile "\\server\staff\abc.xls", objWSHShell.ExpandEnvironm
End If
' The only line that would require modification is the call to the CopyFile method, which would need an accurate source path (and possibly a different destination). I typed this blind (as I suspect leew did :) , so post back if you encounter any errors. Good luck!
Main Topics
Browse All Topics





by: leewPosted on 2005-05-02 at 19:14:48ID: 13914565
Download the IFMEMBER command line utility from Microsoft (http://www.microsoft.com/ windows200 0/techinfo /reskit/to ols/ new/if member-o.a sp). Place it in the logon script folder (\\server\netlogon) and then use the following script:
"YourDomain\Staff"
\\server\netlogon\ifmember
If "%errorlevel%" == "1" Copy \\server\staff\abc.xls %userprofile%\desktop