#63009 - 2002-02-11 05:28 PM
MCA......... Help !!!!!
|
Anonymous
Anonymous
Unregistered
|
MCA,Can you help me with the following script. I'm trying to push out via scriptlogic, an updated local security policy file, (localpolicy.inf). When I run it, I get the following error message (Error 3 copying file - the system cannot find the path specified). When I look into my registry, the affected key is UPDATED to the localpolicy.inf, however when I look at the local security settings on my PC, the file hasn't been updated. I deliberately changed one of the settings on my PC under maximum password age FROM 31 days TO 5 days to see if the script would make the change. (the localpolicy.inf file that I'm trying to copy to the user's PCs has the correct settings), but it's not being changed by the script. Any ideas? ============================================= $Fil = "localpolicy.inf" $Src = "\\Server Name\netlogon" $Dst = WRITEVALUE ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SeCEdit", "TemplateUsed", "\\Server Name\netlogon\localpolicy.inf", "REG_SZ") $DstSize = GETFILESIZE ("$Dst\$Fil") $DstTime = GETFILETIME ("$Dst\$Fil") $SrcSize = GETFILESIZE ("$Src\$Fil") $SrcTime = GETFILETIME ("$Src\$Fil") IF EXIST ("$Dst\$Fil") = 0 ; REM ** File not found on client COPY "$Src\$Fil" "$Dst\$Fil" IF (@ERROR = 0) ? "Success copying file to client" ELSE ? "Error @ERROR copying file (@SERROR)" ENDIF ELSE IF ($SrcSize <> $DstSize) OR ($SrcTime <> $DstTime) COPY "$Src\$Fil" "$Dst\$Fil" IF (@ERROR = 0) ? "Success copying file to client" ELSE ? "Error @ERROR copying file (@SERROR)" ENDIF ELSE ? "Verified file already exists on client" ENDIF ENDIF
|
|
Top
|
|
|
|
#63011 - 2002-02-11 06:21 PM
Re: MCA......... Help !!!!!
|
Anonymous
Anonymous
Unregistered
|
Drill,I've made the change you suggested and I'm still getting "Error 3 copying file (The system cannot find the path specified.)" This is the exact same message I described earlier. Any further suggestions? $Fil = "localpolicy.inf" $Src = "\\Server Name\netlogon" WRITEVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SeCEdit", "TemplateUsed", "\\Server Name\netlogon\localpolicy.inf", "REG_SZ") $DstSize = GETFILESIZE ("$Dst\$Fil") $DstTime = GETFILETIME ("$Dst\$Fil") $SrcSize = GETFILESIZE ("$Src\$Fil") $SrcTime = GETFILETIME ("$Src\$Fil") IF EXIST ("$Dst\$Fil") = 0 ; REM ** File not found on client COPY "$Src\$Fil" "$Dst\$Fil" IF (@ERROR = 0) ? "Success copying file to client" ELSE ? "Error @ERROR copying file (@SERROR)" ENDIF ELSE IF ($SrcSize <> $DstSize) OR ($SrcTime <> $DstTime) COPY "$Src\$Fil" "$Dst\$Fil" IF (@ERROR = 0) ? "Success copying file to client" ELSE ? "Error @ERROR copying file (@SERROR)" ENDIF ELSE ? "Verified file already exists on client" ENDIF ENDIF 
|
|
Top
|
|
|
|
#63012 - 2002-02-12 03:06 AM
Re: MCA......... Help !!!!!
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,We have already answer your email. Following text has been returned: A quick look at your script code:
$fil = "localpolicy.inf" $src = "\\F103003\netlogon" $dst = WRITEVALUE ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SeCEdit", "TemplateUsed", "\\f103003\netlogon\localpolicy.inf", "REG_SZ") $dstsize = GETFILESIZE ("$Dst\$Fil") $dsttime = GETFILETIME ("$Dst\$Fil") $srcsize = GETFILESIZE ("$Src\$Fil") $srctime = GETFILETIME ("$Src\$Fil") IF EXIST ("$Dst\$Fil") = 0 ; REM ** File not found on client COPY "$Src\$Fil" "$Dst\$Fil" IF (@error = 0) ? "Success copying file to client" ELSE ? "Error @ERROR copying file (@SERROR)" ENDIF ELSE IF ($srcsize <> $dstsize) OR ($srctime <> $dsttime) COPY "$Src\$Fil" "$Dst\$Fil" IF (@error = 0) ? "Success copying file to client" ELSE ? "Error @ERROR copying file (@SERROR)" ENDIF ELSE ? "Verified file already exists on client" ENDIF ENDIF
shows possible problem with the $dest. WriteValue will assign a number and not a filename to variable $dest. Possible that it should be a ReadValue call. F.e. specifies the actual destination for your testsystem and rerun your procedure for activating the localplociy.inf. Still problems - possible a real ScriptLogic problem - we advice you to publish this problem on one of the forums of http://www.scriptlogic.com site also. Normally anything should be possible with ScriptLogic. We advice you to include the "localpolicy.inf" contents too. Also specifies special configuration settings for your ScriptLogic program. Please let us know the results. greetings. btw: we doesn't download your pictures. too much bytes for downloading. advice: send only compressed BMPs.
|
|
Top
|
|
|
|
#63014 - 2002-02-13 12:46 AM
Re: MCA......... Help !!!!!
|
Anonymous
Anonymous
Unregistered
|
MCA,I've got the script to run from my desktop. (see attached script) Everything copies over from the localpolicy.inf file as it should and the files are updated. Two problems: PROBLEM #1: How can I get this script to run on each users PC AFTER the logon process? We have several network drives and shared printers that are mapped during the logon process with scriptlogic. In order for my script to run successfully, it will need to execute AFTER the drives/printers have been mapped. It is possible to execute this script via a batch file? PROBLEM #2: I only need the script to run ONCE. If the designated file already exists, how can I get the script to immediately go to the end and not run everytime? ============================================= Dim $Index CLS $variable = ReadValue ("HKEY_LOCAL_MACHINE\SOFTWARE|Microsoft\Windows NT\CurrentVersion\SeCEdit\","TemplateUsed") If $variable = "\\ServerName\netlogon\localpolicy.inf" ? "Revised security file exists." goto skipfile ;Endif ;If $Returncode <> 0 Else ? "Revised security file not present. New file copied." $Index = 0 $ReturnCode = SendKeys("^{ESC}") $ReturnCode = SendKeys("R") $ReturnCode = SendKeys("%systemroot%\system32\secpol.msc /s") $ReturnCode = SendKeys("{ENTER}") Sleep(2) $ReturnCode = SendKeys("~A") $ReturnCode = SendKeys("I") $ReturnCode = SendKeys("\\ServerName\netlogon\localpolicy.inf") $ReturnCode = SendKeys("{ENTER}") $ReturnCode = SendKeys("~{F4}") EndIF :skipfile ?"End of Script"
|
|
Top
|
|
|
|
#63016 - 2002-02-13 05:24 PM
Re: MCA......... Help !!!!!
|
Anonymous
Anonymous
Unregistered
|
MCA,Let me make sure I understand what you mean. Are you saying I can run both of the scripts that you mention within the same kix file OR should I run a separate file that calls up the second file? Here's what I'm attemtping to run. I'm running the first portion of the script you posted as follows: IF (Readvalue ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SeCEdit\","TemplateUsed") <> "\\Server\netlogon\localpolicy.inf") RUN '%comspec% /c \\Server\netlogon\kix32.exe \\Server\netlogon\update_security_file.kix ' ENDIF EXIT The above script should call up the second script, right? The second script (below)runs fine without the above script. Should these two script be ran together of separate? Could you post the ENTIRE script the way it should be ran? Thanks!
SLEEP 60 ; - choose a period which is enough DIM $index CLS $variable=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SeCEdit\","TemplateUsed") IF $variable <> "\\Server\netlogon\localpolicy.inf" ? "Revised security file not present. New file copied." $index=0 $returncode=SendKeys("^{ESC}") $returncode=SendKeys("R") $returncode=SendKeys("%systemroot%\system32\secpol.msc /s") $returncode=SendKeys("{ENTER}") SLEEP 2 $returncode=SendKeys("~A") $returncode=SendKeys("I") $returncode=SendKeys("\\Server\netlogon\localpolicy.inf") $returncode=SendKeys("{ENTER}") $returncode=SendKeys("~{F4}") ENDIF :skipfile ?"End of Script"
|
|
Top
|
|
|
|
#63017 - 2002-02-17 06:35 AM
Re: MCA......... Help !!!!!
|
Anonymous
Anonymous
Unregistered
|
MCA,Can you post the ENTIRE script the way it should be ran?
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1283 anonymous users online.
|
|
|