3 replies
by davis Accepted solution
by wizard-09 Accepted solution
On your server...
Open 'Active Directory Users & Computers'
Right-click the domain | Click 'Properties'
Click on the 'Group Policy' tab
Highlight the 'Default Domain Policy' | Click 'Edit'
Drill down to:
Computer Configuration | Windows Settings | Security Settings | Local Policies | Security Options
The 2 items you are looking for are:
'Interactive Logon: Message Title...'
'Interactive Logon: Message Text...'
Change these to whatever you want.
Do this for every OU you want.
by 1bn0 Accepted solution
Great way to creeate custom scripts. It inlcudes a displayed message as well as displaying many other user attributes such as days since lst logon, # of days till password expires , ......
http://www.primalscript.com/Free_Tools/index.asp
I don't use most of those options but tit does generate code you can use or customize for your purposes.
XXXX
strWelcomeMsg="This is a secure network. Authorized Access Only."
XXXXX
************Sample Generated Script*********
'Created: 11/19/2008 10:21:32 AM
'Author:
'Created by SAPIEN Technologies, Inc. Logon Script Generator
'**********************
On Error Resume Next
Dim objFSO,objFILE,objShell,objNetwork
set objFSO=CreateObject("Scripting.FileSystemObject")
set objShell=CreateObject("Wscript.Shell")
set objNetwork=CreateObject("Wscript.Network")
strWelcomeMsg="This is a secure network. Authorized Access Only."
strHelpMsg="Contact the Help Desk for further assistance."
iErrorTimeout=10
blnShowError=True
'additional commands, if any
objShell.Exec "Execute this command at logon script processing time"
'build summary message
iDisplayTimeout=10
strMsg=""
strMsg=strMsg & strWelcomeMsg & VbCrLf
strMsg=strMsg & vbcrlf
strMsg=strMsg & PasswordExpires(objNetwork.Userdomain,objNetwork.Username) & VbCrLf
strMsg=strMsg & vbcrlf
'enumerate drives
Set objDrives = objNetwork.EnumNetworkDrives
strMsg=strMsg & "Network drive mappings:" & vbcrlf
For i = 0 to objDrives.Count - 1 Step 2
strMsg=strMsg & "Drive " & objDrives.Item(i) & "=" & objDrives.Item(i+1) & vbcrlf
Next
strMsg=strMsg & vbcrlf
'enumerate printers
Set objPrinters = objNetwork.EnumPrinterConnections
strMsg=strMsg & vbcrlf &"Printer mappings:" & vbcrlf
For i = 0 to objPrinters.Count - 1 Step 2
strMsg=strMsg & objPrinters.Item(i) &" = "& objPrinters.Item(i+1) & vbcrlf
Next
strMsg=strMsg & vbcrlf
'display summary message
If strMsg<>"" Then objShell.Popup strMsg,iDisplayTimeout,"Logon Summary",vbOKOnly+vbInformation
'End of main script
'//////////////////////////////////////////////////
Function PasswordExpires(strDomain,strUser)
On Error Resume Next
Dim objUser
Set objUser=GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
PassExp=INT(objUser.MaxPasswordAge/86400)-INT(objUser.PasswordAge/86400)
If PassExp<0 Then
strPassMsg="Your password never expires."
Else
strPassMsg="Your password expires in " & PassExp & " day(s)"
end If
PasswordExpires=strPassMsg
End Function
Function IsAMemberOf(strDomain,strUser,strGroup)
On Error Resume Next
Set objUser=GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Set objGrp=GetObject("WinNT://" & strDomain & "/" & strGroup & ",group")
If objGrp.IsMember(objUser.ADsPath) Then
IsAMemberOf=True
Else
IsAMemberOf=False
End If
End Function
Sub MapIt(strDrive,strMap)
On Error Resume Next
If objFSO.DriveExists(strDrive) Then objNetwork.RemoveNetworkDrive(strDrive)
objNetwork.MapNetworkDrive strDrive,strMap
If Err.Number<>0 And blnShowError Then
strMsg="There was a problem mapping drive " & UCase(strDrive) & " to " &_
strMap & VbCrLf & strHelpMsg & VbCrLf & "Error#:" & Hex(err.Number) &_
VbCrLf & Err.Description
objShell.Popup strMsg,iErrorTimeOut,"Error",vbOKOnly+vbExclamation
Err.Clear
End If
End Sub
Sub AddPrinterConnection(strPrinterUNC)
On Error Resume Next
objNetwork.AddWindowsPrinterConnection strPrinterUNC
If Err.Number<>0 And blnShowError Then
strMsg="There was a problem mapping " & UCase(strPrinterUNC) & ". " &_
vbcrlf & VbCrLf & strHelpMsg & VbCrLf & "Error#:" & Hex(err.Number) &_
VbCrLf & Err.Description
objShell.Popup strMsg,iErrorTimeOut,"Error",vbOKOnly+vbExclamation
Err.Clear
End If
end sub
Sub AddPrinterPortConnection(strPort,strPrinterUNC)
On Error Resume Next
objNetwork.AddPrinterConnection strPort,strPrinterUNC
If Err.Number<>0 And blnShowError Then
strMsg="There was a problem mapping " & UCase(strPrinterUNC) & " to " &_
strPort & vbcrlf & VbCrLf & strHelpMsg & VbCrLf & "Error#:" & Hex(err.Number) &_
VbCrLf & Err.Description
objShell.Popup strMsg,iErrorTimeOut,"Error",vbOKOnly+vbExclamation
Err.Clear
End If
end sub
************Sample Generated Script*********
This discussion is closed to new replies.
Trending Desktop posts
Sort by Trending