How to show a Legal Notice when users log onto the network

Posted on 2009-05-12
Last Modified: 2012-05-06
I am able to add a legal notice to users desktops by modifying the following registry keys:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\legalnoticecaption
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\legalnoticetext

The problem I have is rather than manually applying this to each desktop, I want to find a way to automatically set this via a login script, group policy, etc so I can get the legal notice applied to 100+ systems on the network. I am running a Windows 2003 server domain.  

I've researched how to do this on E.E. and have tried the following:
1) Apply the following commands to the login script:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v LegalNoticeText /d "I put the heading text to be displayed here" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v LegalNoticeCaption /d "I put the message to be displayed here" /f

When I try this from the command line I get the following error:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Program Files\Windows Resource Kits\Tools>reg add "HKEY_LOCAL_MACHINE\SOFTWAR
E\Microsoft\Windows NT\CurrentVersion\Winlogon /v LegalNoticeText /d "I put the
heading text to be displayed here" /f

Error:  Too many command-line parameters

C:\Program Files\Windows Resource Kits\Tools>

2) I created a logonmessage.vbs file 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 = "I put the heading text to be displayed here"
objReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
' Construct the LegalNoticeText and set the value
strValueName = "LegalNoticeText"
strValue = "I put the message to be displayed here"
objReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
' Tidy up and quit
Set objReg = Nothing

I am still new to using VB scripts - so I'm not sure if I am running the above code correctly.  When I run the above vb script I do not see any errors, but when I go into the registry I do not see the LegalNoticeCaption and LegalNoticeText keys updated.  

Any help you can provide would be greatly appreciated.  Thank you in advance.
Question by:drapeaur
  • 2

Accepted Solution

mpeaden2 earned 500 total points
ID: 24367532

Author Comment

ID: 24367586
I got my vbscript to finally work.  Question though...where is the a proper place to store vbscripts on a Windows 2003 server or is it a matter of preference?

Expert Comment

ID: 24367630
preference.. there is no particular "correct" place.. please remember to mark my code as answer if it helped you... thanks,

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now