Link to home
Start Free TrialLog in
Avatar of drapeaur
drapeaur

asked on

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

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
WScript.Quit


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.
ASKER CERTIFIED SOLUTION
Avatar of mpeaden2
mpeaden2
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of drapeaur
drapeaur

ASKER

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?
preference.. there is no particular "correct" place.. please remember to mark my code as answer if it helped you... thanks,