Script that changes Legal Notice Text, doesn't apply on all computers?

Discussion in 'Windows Desktop Systems' started by Punkrulz, Mar 29, 2007.

  1. Punkrulz

    Punkrulz Somewhat eXPerienced

    Messages:
    790
    Location:
    Woodbury, NJ
    Blah,

    I am filled with vague subjects lately! I have been tasked with going around to every single computer and getting some information. While doing so, I have been attempting to troubleshoot why a certain script is not applying all of the settings. We have a script that applies at computer logon, that changes LegalNoticeText, Logon Prompt, as well as the welcome message. The script is as follows:

    Code:
    Option Explicit
    ' Constants
    Const HKEY_LOCAL_MACHINE = &H80000002
    ' Variable Declarations
    Dim strComputer
    Dim objReg
    Dim strKeyPath
    Dim strValueName
    Dim strValue
    ' Variable Initialisations
    strComputer = "."
    Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
    strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
    ' Construct the LegalNoticeCaption and set the value
    strValueName = "LegalNoticeCaption"
    strValue = "WARNING!!!"
    objReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
    ' Construct the LegalNoticeText and set the value
    strValueName = "LegalNoticeText"
    strValue = "This system is the property of the **************** and established for the sole use of authorized users for official business only. You have no expectation of privacy in its use. To protect the system from unauthorized use and to ensure that the system is functioning properly, individuals using this computer system are subject to having all of their activities on this system monitored and recorded. Anyone using this system expressly consents to such monitoring."
    strValue = strValue & vbCrLf & vbCrLf
    strValue = strValue & "By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning."
    objReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
    ' Construct the LogonPrompt and set the value
    strValueName = "LogonPrompt"
    strValue = "Any unauthorized access of this system or unauthorized use of the information                on this system by authorized users or others is prohibited."
    objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
    ' Construct the Welcome and set the value
    strValueName = "Welcome"
    strValue = "                                                     DTPD - 1*"
    objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
    ' Tidy up and quit
    Set objReg = Nothing
    WScript.Quit
    Now there are a few computers where the legalnotice hasn't changed, but the other things the script applies has. It's being pushed out by GPO. While on these machines, I even tried running the script manually:

    cscript \\server\netlogon\legalnotice.vbs

    It doesn't seem to generate any errors, but it still doesn't apply the changes! There also isn't anything in the error log as to why. I think these issues are combined with a few other GPO issues we have on machines, but there are no errors to back up any problems.

    Is there anything I can add, or do, to see why the script isn't making the registry change?

    Btw, for those who suggest that we just use the GPO to push out the change, the administrator who wants this wants perfect formatting, which is unachievable via GPO... that was another thread a long time ago, we tried, we failed, moving on. :)
     
  2. Punkrulz

    Punkrulz Somewhat eXPerienced

    Messages:
    790
    Location:
    Woodbury, NJ
    Just to update you guys on this, this is even more strange! I have recruited the help of cpugenius, who had provided me with a registry file that would make the necessary changes. What's strange, is that when I ran the file, it still didn't work.

    Further checking into the registry, it appears that the changes are in fact listed in the registry, but for some reason the logon text is showing something else! Why would that be?