Exibe uma caixa de diálogo no login solicitando o motivo do login - Windows Server [closed]

2

Eu estou procurando uma maneira de exibir uma caixa de diálogo de entrada após o login em um servidor de produção, pedindo ao usuário para indicar o motivo do login. Eu estava pensando que talvez haja uma maneira de fazer no Windows semelhante à caixa de diálogo Desligar que é exibida sempre que um servidor é reiniciado.

Eu examinei a Política de Grupo, mas não consegui encontrar nada de útil. Eu sei que isso pode ser feito por um script, mas eu estava olhando para ver se há alguma maneira integrada no Windows antes de começar a escrevê-lo.

Obrigado

    
por Hadas 26.07.2013 / 04:14

2 respostas

3

Acabei de escrever o seguinte VBScript e defini-lo para ser executado no logon no GPO

' Display an input dialog asking the reason for a login and writes it to the event viewer with information of the user.

Const EVENT_TYPE = "Information" 'Available Values: Success, Error, Warning, Information
Const EVENT_SOURCE = "LoginAudit" 'Setting the event source requires that the script runs with administrative privileges

firstname = GetUserFirstname()
username = GetUsername()

loginReason = ""
Do While (loginReason = "")
    loginReason = InputBox("Hi " + firstname + ", please describe the reason of your login:", "Login Audit")
Loop

eventDescription = "User '" & username & "' logged in, providing the following reason: " & Chr(13) & Chr(13) & loginReason

Set WshShell = WScript.CreateObject("WScript.Shell")
strCommand = "eventcreate /T " & EVENT_TYPE & " /ID 100 /L Application /SO LoginAudit /D " & _
    Chr(34) & eventDescription & Chr(34)
WshShell.Run strcommand

Function GetUserFirstname()
    Set objSysInfo = CreateObject("ADSystemInfo")
    Set objCurrentUser = GetObject("LDAP://" & objSysInfo.UserName)
    GetUserFirstname = objCurrentUser.givenName
End Function

Function GetUsername()
    Set objNetwork = CreateObject("Wscript.Network")
    GetUsername = objNetwork.UserName
End Function
    
por 26.07.2013 / 17:26
1

I was looking to see if there's any integrated way in Windows before I start writing it.

Não, não há. Você vai ter que escrever você mesmo, estou com medo. Pode haver um aplicativo de terceiros que faz o que você deseja, mas receio que as recomendações de produtos / serviços estejam fora do tópico aqui na Falha do servidor.

    
por 26.07.2013 / 16:50