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


Somewhat eXPerienced
Dec 24, 2001

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:

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
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. :)


Somewhat eXPerienced
Dec 24, 2001
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?

Members online

No members online now.

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Hey ep!

All good with me, applying for microsoft mvp right now, should have done this a while ago.

Notifications don't work, I only found your response by comming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier, mine is perriscalderon at gmail
Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...

Forum statistics

Latest member