4>
5>
6>
7> Create TRIGGER srv_trg_RestrictNewLogins
8> ON ALL SERVER
9> FOR CREATE_LOGIN
10> AS
11> SET NOCOUNT ON
12> PRINT 'Your login creation is being monitored.'
13> GO
1>
2>
3> ALTER TRIGGER srv_trg_RestrictNewLogins
4> ON ALL SERVER
5> FOR CREATE_LOGIN
6> AS
7> SET NOCOUNT ON
8> PRINT 'Your login creation is being monitored.'
9> INSERT YourDatabaseName.dbo.MyAudit
10> (EventData, DBUser)
11> VALUES (EVENTDATA(), USER)
12> GO
1>
2> drop trigger srv_trg_RestrictNewLogins
3> GO
|