Event Log Queries

Ok, so I'm working on querying multiple DC's to look for a specific
event ID (645 in the security logs, for computers recently joined to
the domain).  I thought I had everything figured out, but it's still
not working right.  Running the script, it just somewhat hangs...not
sure if that's just because it's still searching or not and is slow.

Let me know if you guys have any thoughts...thanks!

Dim objDictionary

Set objDictionary = CreateObject("Scripting.Dictionary")

arrComputers = Array("DC02", "DC03")
iReach = 0

For Each strComputer in arrComputers
   Connect strComputer
Next

If (iReach = 0) Then
   WScript.Echo "No Computers were reachable!"
   WScript.Quit
End If

colKeys = objDictionary.Keys

If (colKeys.Count = 0) Then
   WScript.Echo "No events were found!"
   WScript.Quit
End If

For Each strKey in colKeys
   WScript.Echo strKey
Next

WScript.Quit

Sub Connect(sComputer)
   On Error Resume Next
   Set objWMIService = GetObject("winmgmts:" _
       & "{impersonationLevel=impersonate}!\\" & sComputer & "\root
\cimv2")
   If (Err.Number <> 0) Then
      On Error GoTo 0
      WScript.echo "Could not connect to " & sComputer
      Exit Sub
   End If
   On Error GoTo 0

   iReach = iReach + 1

   Set colLoggedEvents = objWMIService.ExecQuery _
      ("Select * From Win32_NTLogEvent Where Logfile = 'Security' AND
(EventCode = 645)")
         ' 645 = Computer joined to domain

   For Each objEvent in colLoggedEvents
       strEventCode = objEvent.EventCode
       srtMessage = Trim( Replace( objEvent.Message, vbCrLf, " "))
          objDictionary.Add strEventCode, strMessage
   Next
End Sub
0
ekrengel
6/9/2010 4:31:58 PM
scripting.vbscript 564 articles. 0 followers. Follow

6 Replies
832 Views

Similar Articles

[PageSpeed] 19

On Jun 9, 12:31=A0pm, ekrengel <erickreng...@gmail.com> wrote:
> Ok, so I'm working on querying multiple DC's to look for a specific
> event ID (645 in the security logs, for computers recently joined to
> the domain). =A0I thought I had everything figured out, but it's still
> not working right. =A0Running the script, it just somewhat hangs...not
> sure if that's just because it's still searching or not and is slow.
>
> Let me know if you guys have any thoughts...thanks!
>
> Dim objDictionary
>
> Set objDictionary =3D CreateObject("Scripting.Dictionary")
>
> arrComputers =3D Array("DC02", "DC03")
> iReach =3D 0
>
> For Each strComputer in arrComputers
> =A0 =A0Connect strComputer
> Next
>
> If (iReach =3D 0) Then
> =A0 =A0WScript.Echo "No Computers were reachable!"
> =A0 =A0WScript.Quit
> End If
>
> colKeys =3D objDictionary.Keys
>
> If (colKeys.Count =3D 0) Then
> =A0 =A0WScript.Echo "No events were found!"
> =A0 =A0WScript.Quit
> End If
>
> For Each strKey in colKeys
> =A0 =A0WScript.Echo strKey
> Next
>
> WScript.Quit
>
> Sub Connect(sComputer)
> =A0 =A0On Error Resume Next
> =A0 =A0Set objWMIService =3D GetObject("winmgmts:" _
> =A0 =A0 =A0 =A0& "{impersonationLevel=3Dimpersonate}!\\" & sComputer & "\=
root
> \cimv2")
> =A0 =A0If (Err.Number <> 0) Then
> =A0 =A0 =A0 On Error GoTo 0
> =A0 =A0 =A0 WScript.echo "Could not connect to " & sComputer
> =A0 =A0 =A0 Exit Sub
> =A0 =A0End If
> =A0 =A0On Error GoTo 0
>
> =A0 =A0iReach =3D iReach + 1
>
> =A0 =A0Set colLoggedEvents =3D objWMIService.ExecQuery _
> =A0 =A0 =A0 ("Select * From Win32_NTLogEvent Where Logfile =3D 'Security'=
 AND
> (EventCode =3D 645)")
> =A0 =A0 =A0 =A0 =A0' 645 =3D Computer joined to domain
>
> =A0 =A0For Each objEvent in colLoggedEvents
> =A0 =A0 =A0 =A0strEventCode =3D objEvent.EventCode
> =A0 =A0 =A0 =A0srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf, " =
"))
> =A0 =A0 =A0 =A0 =A0 objDictionary.Add strEventCode, strMessage
> =A0 =A0Next
> End Sub

The issue is definitely with the "for" statement in the sub.  I went
through some debugging and found the script hangs there.  It doesn't
make it past the first "For Each" line.  I still don't know what's
wrong with this statement though, or what's causing it to hang.

   For Each objEvent in colLoggedEvents

   wscript.echo "got past for statement"
   wscript.quit

       strEventCode =3D objEvent.EventCode
       srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf, " "))
          objDictionary.Add strEventCode, strMessage
   Next
0
ekrengel
6/14/2010 2:52:45 PM
On Jun 14, 10:52=A0am, ekrengel <erickreng...@gmail.com> wrote:
> On Jun 9, 12:31=A0pm, ekrengel <erickreng...@gmail.com> wrote:
>
>
>
> > Ok, so I'm working on querying multiple DC's to look for a specific
> > event ID (645 in the security logs, for computers recently joined to
> > the domain). =A0I thought I had everything figured out, but it's still
> > not working right. =A0Running the script, it just somewhat hangs...not
> > sure if that's just because it's still searching or not and is slow.
>
> > Let me know if you guys have any thoughts...thanks!
>
> > Dim objDictionary
>
> > Set objDictionary =3D CreateObject("Scripting.Dictionary")
>
> > arrComputers =3D Array("DC02", "DC03")
> > iReach =3D 0
>
> > For Each strComputer in arrComputers
> > =A0 =A0Connect strComputer
> > Next
>
> > If (iReach =3D 0) Then
> > =A0 =A0WScript.Echo "No Computers were reachable!"
> > =A0 =A0WScript.Quit
> > End If
>
> > colKeys =3D objDictionary.Keys
>
> > If (colKeys.Count =3D 0) Then
> > =A0 =A0WScript.Echo "No events were found!"
> > =A0 =A0WScript.Quit
> > End If
>
> > For Each strKey in colKeys
> > =A0 =A0WScript.Echo strKey
> > Next
>
> > WScript.Quit
>
> > Sub Connect(sComputer)
> > =A0 =A0On Error Resume Next
> > =A0 =A0Set objWMIService =3D GetObject("winmgmts:" _
> > =A0 =A0 =A0 =A0& "{impersonationLevel=3Dimpersonate}!\\" & sComputer & =
"\root
> > \cimv2")
> > =A0 =A0If (Err.Number <> 0) Then
> > =A0 =A0 =A0 On Error GoTo 0
> > =A0 =A0 =A0 WScript.echo "Could not connect to " & sComputer
> > =A0 =A0 =A0 Exit Sub
> > =A0 =A0End If
> > =A0 =A0On Error GoTo 0
>
> > =A0 =A0iReach =3D iReach + 1
>
> > =A0 =A0Set colLoggedEvents =3D objWMIService.ExecQuery _
> > =A0 =A0 =A0 ("Select * From Win32_NTLogEvent Where Logfile =3D 'Securit=
y' AND
> > (EventCode =3D 645)")
> > =A0 =A0 =A0 =A0 =A0' 645 =3D Computer joined to domain
>
> > =A0 =A0For Each objEvent in colLoggedEvents
> > =A0 =A0 =A0 =A0strEventCode =3D objEvent.EventCode
> > =A0 =A0 =A0 =A0srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf, =
" "))
> > =A0 =A0 =A0 =A0 =A0 objDictionary.Add strEventCode, strMessage
> > =A0 =A0Next
> > End Sub
>
> The issue is definitely with the "for" statement in the sub. =A0I went
> through some debugging and found the script hangs there. =A0It doesn't
> make it past the first "For Each" line. =A0I still don't know what's
> wrong with this statement though, or what's causing it to hang.
>
> =A0 =A0For Each objEvent in colLoggedEvents
>
> =A0 =A0wscript.echo "got past for statement"
> =A0 =A0wscript.quit
>
> =A0 =A0 =A0 =A0strEventCode =3D objEvent.EventCode
> =A0 =A0 =A0 =A0srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf, " =
"))
> =A0 =A0 =A0 =A0 =A0 objDictionary.Add strEventCode, strMessage
> =A0 =A0Next

So I take what I said back =3D)

It's really just a matter of WMI being slow and me being
impatient...it takes a while for it to query the security logs.  I
made some changes to the script where I had errors:

Dim objDictionary

Set objDictionary =3D CreateObject("Scripting.Dictionary")

arrComputers =3D Array("DC02")
iReach =3D 0

For Each strComputer in arrComputers
   Connect strComputer
Next

If (iReach =3D 0) Then
   WScript.Echo "No Computers were reachable!"
   WScript.Quit
End If

strEventCount =3D objDictionary.Count
If (strEventCount =3D 0) Then
   WScript.Echo "No events were found!"
   WScript.Quit
End If

colKeys =3D objDictionary.Keys
For Each strKey in colKeys
   WScript.Echo strKey
Next

WScript.Quit

Sub Connect(sComputer)
   On Error Resume Next
   Set objWMIService =3D GetObject("winmgmts:" _
      & "{impersonationLevel=3Dimpersonate,(Security)}!\\" _
      & sComputer & "\root\cimv2")

   If (Err.Number <> 0) Then
      On Error GoTo 0
      WScript.echo "Could not connect to " & sComputer
      Exit Sub
   End If
   On Error GoTo 0

   iReach =3D iReach + 1

   Set colLoggedEvents =3D objWMIService.ExecQuery _
      ("Select * From Win32_NTLogEvent Where Logfile =3D 'Security' AND
EventCode =3D '645'",,48)

   For Each objEvent in colLoggedEvents
       strEventCode =3D objEvent.EventCode
       srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf, " "))
          objDictionary.Add strEventCode, strMessage
   Next
End Sub
0
ekrengel
6/14/2010 4:06:41 PM
On Jun 14, 11:06=A0am, ekrengel <erickreng...@gmail.com> wrote:
> On Jun 14, 10:52=A0am, ekrengel <erickreng...@gmail.com> wrote:
>
>
>
>
>
> > On Jun 9, 12:31=A0pm, ekrengel <erickreng...@gmail.com> wrote:
>
> > > Ok, so I'm working on querying multiple DC's to look for a specific
> > > event ID (645 in the security logs, for computers recently joined to
> > > the domain). =A0I thought I had everything figured out, but it's stil=
l
> > > not working right. =A0Running the script, it just somewhat hangs...no=
t
> > > sure if that's just because it's still searching or not and is slow.
>
> > > Let me know if you guys have any thoughts...thanks!
>
> > > Dim objDictionary
>
> > > Set objDictionary =3D CreateObject("Scripting.Dictionary")
>
> > > arrComputers =3D Array("DC02", "DC03")
> > > iReach =3D 0
>
> > > For Each strComputer in arrComputers
> > > =A0 =A0Connect strComputer
> > > Next
>
> > > If (iReach =3D 0) Then
> > > =A0 =A0WScript.Echo "No Computers were reachable!"
> > > =A0 =A0WScript.Quit
> > > End If
>
> > > colKeys =3D objDictionary.Keys
>
> > > If (colKeys.Count =3D 0) Then
> > > =A0 =A0WScript.Echo "No events were found!"
> > > =A0 =A0WScript.Quit
> > > End If
>
> > > For Each strKey in colKeys
> > > =A0 =A0WScript.Echo strKey
> > > Next
>
> > > WScript.Quit
>
> > > Sub Connect(sComputer)
> > > =A0 =A0On Error Resume Next
> > > =A0 =A0Set objWMIService =3D GetObject("winmgmts:" _
> > > =A0 =A0 =A0 =A0& "{impersonationLevel=3Dimpersonate}!\\" & sComputer =
& "\root
> > > \cimv2")
> > > =A0 =A0If (Err.Number <> 0) Then
> > > =A0 =A0 =A0 On Error GoTo 0
> > > =A0 =A0 =A0 WScript.echo "Could not connect to " & sComputer
> > > =A0 =A0 =A0 Exit Sub
> > > =A0 =A0End If
> > > =A0 =A0On Error GoTo 0
>
> > > =A0 =A0iReach =3D iReach + 1
>
> > > =A0 =A0Set colLoggedEvents =3D objWMIService.ExecQuery _
> > > =A0 =A0 =A0 ("Select * From Win32_NTLogEvent Where Logfile =3D 'Secur=
ity' AND
> > > (EventCode =3D 645)")
> > > =A0 =A0 =A0 =A0 =A0' 645 =3D Computer joined to domain
>
> > > =A0 =A0For Each objEvent in colLoggedEvents
> > > =A0 =A0 =A0 =A0strEventCode =3D objEvent.EventCode
> > > =A0 =A0 =A0 =A0srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf=
, " "))
> > > =A0 =A0 =A0 =A0 =A0 objDictionary.Add strEventCode, strMessage
> > > =A0 =A0Next
> > > End Sub
>
> > The issue is definitely with the "for" statement in the sub. =A0I went
> > through some debugging and found the script hangs there. =A0It doesn't
> > make it past the first "For Each" line. =A0I still don't know what's
> > wrong with this statement though, or what's causing it to hang.
>
> > =A0 =A0For Each objEvent in colLoggedEvents
>
> > =A0 =A0wscript.echo "got past for statement"
> > =A0 =A0wscript.quit
>
> > =A0 =A0 =A0 =A0strEventCode =3D objEvent.EventCode
> > =A0 =A0 =A0 =A0srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf, =
" "))
> > =A0 =A0 =A0 =A0 =A0 objDictionary.Add strEventCode, strMessage
> > =A0 =A0Next
>
> So I take what I said back =3D)
>
> It's really just a matter of WMI being slow and me being
> impatient...it takes a while for it to query the security logs. =A0I
> made some changes to the script where I had errors:
>
> Dim objDictionary
>
> Set objDictionary =3D CreateObject("Scripting.Dictionary")
>
> arrComputers =3D Array("DC02")
> iReach =3D 0
>
> For Each strComputer in arrComputers
> =A0 =A0Connect strComputer
> Next
>
> If (iReach =3D 0) Then
> =A0 =A0WScript.Echo "No Computers were reachable!"
> =A0 =A0WScript.Quit
> End If
>
> strEventCount =3D objDictionary.Count
> If (strEventCount =3D 0) Then
> =A0 =A0WScript.Echo "No events were found!"
> =A0 =A0WScript.Quit
> End If
>
> colKeys =3D objDictionary.Keys
> For Each strKey in colKeys
> =A0 =A0WScript.Echo strKey
> Next
>
> WScript.Quit
>
> Sub Connect(sComputer)
> =A0 =A0On Error Resume Next
> =A0 =A0Set objWMIService =3D GetObject("winmgmts:" _
> =A0 =A0 =A0 & "{impersonationLevel=3Dimpersonate,(Security)}!\\" _
> =A0 =A0 =A0 & sComputer & "\root\cimv2")
>
> =A0 =A0If (Err.Number <> 0) Then
> =A0 =A0 =A0 On Error GoTo 0
> =A0 =A0 =A0 WScript.echo "Could not connect to " & sComputer
> =A0 =A0 =A0 Exit Sub
> =A0 =A0End If
> =A0 =A0On Error GoTo 0
>
> =A0 =A0iReach =3D iReach + 1
>
> =A0 =A0Set colLoggedEvents =3D objWMIService.ExecQuery _
> =A0 =A0 =A0 ("Select * From Win32_NTLogEvent Where Logfile =3D 'Security'=
 AND
> EventCode =3D '645'",,48)
>
> =A0 =A0For Each objEvent in colLoggedEvents
> =A0 =A0 =A0 =A0strEventCode =3D objEvent.EventCode
> =A0 =A0 =A0 =A0srtMessage =3D Trim( Replace( objEvent.Message, vbCrLf, " =
"))
> =A0 =A0 =A0 =A0 =A0 objDictionary.Add strEventCode, strMessage
> =A0 =A0Next
> End Sub- Hide quoted text -
>
> - Show quoted text -

How about a "On error resume next" at the top?  Couldn't hurt to try
for purposes of diagnosis.

Jim
0
BigDaddyJim
6/15/2010 11:43:46 AM
On Jun 15, 7:43=A0am, BigDaddyJim <hungerfo...@gmail.com> wrote:
>
> How about a "On error resume next" at the top? =A0Couldn't hurt to try
> for purposes of diagnosis.
>
> Jim

I think that's a decidedly LOUSY idea.  It can and does hurt to
blanket a script with On Error Resume Next (though lots of sample
scripts do it).  Because it makes troubleshooting HARDER.  With it in
place, the true source of the problem is generally hidden.  Rather,
the script tries to 'soldier on', with incorrect intermediate results,
often with disastrous results - like corrupting data.  It leaves the
user to wonder what happened, with likely misleading symptoms of the
real problem.

The only time it is justified, IMHO, is when a specific bit of code is
targeted and specific error handling code is added to test the
Err.Number and act accordingly.  In that way, the programmer
anticipates errors and provides logical workarounds to keep the
program on track (or asks the user to make the decision).
_____________________
Tom Lavedas
0
Tom
6/15/2010 12:32:15 PM
On Jun 15, 8:32=A0am, Tom Lavedas <tglba...@verizon.net> wrote:
> On Jun 15, 7:43=A0am, BigDaddyJim <hungerfo...@gmail.com> wrote:
>
>
>
> > How about a "On error resume next" at the top? =A0Couldn't hurt to try
> > for purposes of diagnosis.
>
> > Jim
>
> I think that's a decidedly LOUSY idea. =A0It can and does hurt to
> blanket a script with On Error Resume Next (though lots of sample
> scripts do it). =A0Because it makes troubleshooting HARDER. =A0With it in
> place, the true source of the problem is generally hidden. =A0Rather,
> the script tries to 'soldier on', with incorrect intermediate results,
> often with disastrous results - like corrupting data. =A0It leaves the
> user to wonder what happened, with likely misleading symptoms of the
> real problem.
>
> The only time it is justified, IMHO, is when a specific bit of code is
> targeted and specific error handling code is added to test the
> Err.Number and act accordingly. =A0In that way, the programmer
> anticipates errors and provides logical workarounds to keep the
> program on track (or asks the user to make the decision).
> _____________________
> Tom Lavedas

Yes exactly.  I do use "On Error Resume Next" at some parts of the
script, but that is because of exactly what Tom just explained.  If
you do use it, the error should always be cleared after the error has
been caught (that's if you want to continue with the script and catch
other errors in the same way).

Anyway, there really isn't anything wrong with the script as far as I
can see now...I was just being impatient.  Unless someone can think of
a way to speed it up?  =3D)
0
ekrengel
6/15/2010 3:17:19 PM
On Jun 15, 11:17=A0am, ekrengel <erickreng...@gmail.com> wrote:
> On Jun 15, 8:32=A0am, Tom Lavedas <tglba...@verizon.net> wrote:
>
>
>
> > On Jun 15, 7:43=A0am, BigDaddyJim <hungerfo...@gmail.com> wrote:
>
> > > How about a "On error resume next" at the top? =A0Couldn't hurt to tr=
y
> > > for purposes of diagnosis.
>
> > > Jim
>
> > I think that's a decidedly LOUSY idea. =A0It can and does hurt to
> > blanket a script with On Error Resume Next (though lots of sample
> > scripts do it). =A0Because it makes troubleshooting HARDER. =A0With it =
in
> > place, the true source of the problem is generally hidden. =A0Rather,
> > the script tries to 'soldier on', with incorrect intermediate results,
> > often with disastrous results - like corrupting data. =A0It leaves the
> > user to wonder what happened, with likely misleading symptoms of the
> > real problem.
>
> > The only time it is justified, IMHO, is when a specific bit of code is
> > targeted and specific error handling code is added to test the
> > Err.Number and act accordingly. =A0In that way, the programmer
> > anticipates errors and provides logical workarounds to keep the
> > program on track (or asks the user to make the decision).
> > _____________________
> > Tom Lavedas
>
> Yes exactly. =A0I do use "On Error Resume Next" at some parts of the
> script, but that is because of exactly what Tom just explained. =A0If
> you do use it, the error should always be cleared after the error has
> been caught (that's if you want to continue with the script and catch
> other errors in the same way).
>
> Anyway, there really isn't anything wrong with the script as far as I
> can see now...I was just being impatient. =A0Unless someone can think of
> a way to speed it up? =A0=3D)

Just an update...I found another method using "ExecQueryAsync", and it
was faster...but only by about 10 seconds =3D)  Not enough to make a
difference.
0
ekrengel
6/16/2010 4:30:52 PM
Reply:

Similar Artilces:

OnLoad event criteria
If have the code below in the OnLoad event which is working fine for the most part. The second line is causing a problem for cases where there is no matching record. The code is setting the value - I'd like to have it check the value first, and if it matches the value for the related field in the current form recordset, set the value, otherwise just open the form without setting the value. If CurrentProject.AllForms("AllOpen").IsLoaded Then Me.Combo1 = Forms!AllOpen!ID ' Find the record that matches the control. Dim rs As Object Set rs ...

Printing Private events/appts. on Calendars
A while ago I asked about how to stop Outlook printing private appointments or events in the calendars. Someone said to check "don't print private events" in the print screen which I did. Anyway, the calendar that gets printed, in the day that there is a private event it says "Private Event". How do I stop it from printing them altogether? I want it to appear on the calendar as nothing. ie. if there is only that event then the calendar should appear with no events for that day. Thanks ...

Error in Event Viewer event id 1023 pop3 connector, 1029, 1036, 10
Hello Exchange Administrators, I am getting these Error in Event Viewer "event id 1023 pop3 connector, 1029, 1036, 1015, 1019, 1015" on regular basis after every 15 min for every user. I need yours help to fix these errors. Also tell me why these error are logged in event viewer or cause of these errors We are using WIndoes 2003 SBS, Exchange Server 2003. Thanks you for yours help in advance. On Fri, 1 Sep 2006 11:11:01 -0700, Guri <Guri@discussions.microsoft.com> wrote: >Hello Exchange Administrators, > >I am getting these Error in Event Viewer "event id 1...

Refactor query
I need a query to find the MDF, NDF, and LDF used on my systems and I have written this query and it pretty much does what I need but I got a feeling is not written in the best way possible, for example if I have a database that has a two data files the value in the LDF column will be repeted for the second row like this: Database ---- MDF ---------------- LDF my_db ------ c:\my_db1.mdf ------- c:\my_db.ldf my_db ------ c:\my_db2.ndf -------- c:\my_db.ldf Is it possible to rewrite it so that in the second row the value of LDF is not repeated? Here is teh T-SQL SELECT DI...

Query behaving differently in VBA than when running as regular Que
Hello, I have been struggeling with this problem the whole day, and I hope some one can give me some insight. I have an INSERT query that I want to run from VBA, but when I do that, I get the errormessage : "This Recordset is not updatable. (Error 3326)" The strange part is that when I run it as a regular query, I have no problems. The query is based on tables that are linked to a postgrSQL. I don't know if it is relevant or not, but just so you know. Here are the two statements. First the VBA one: Dim nlhe_largest As String nlhe_largest = "I...

deleting events in calender
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel Email Client: pop I have inadvertently imported a weekly event into my calender. Each event seems to be logged as an individual event rather than a repeat event. I do not know how to delete it. Am trying, unsuccessfully, to show all events in one window so that I can easily select this irrelevant event, but cant display that window. Can you help me, either showing that elusive window, or how to otherwise delete MANY events. In article <59bb30c6.-1@webcrossing.JaKIaxP2ac0>, <leaest@officeformac.com> w...

Catch click event button
Hi all, I was wondering... Is it possible to "catch" a click-event on a BuildIn Offie Button? In order to execute your own VBA-code? e.g. I want to be able to catch the "Undo" button in order to execute a piece of macro code in stead of just "Undoing" only the last action. Greetz, Bert -- Neron It is possible to catch ("intercept") most built-in Word commands, as described at http://www.word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm. In this case, the macro you need to write is named EditUndo, as in Public Sub E...

LDAP Query #4
im sorry if this post is in the wrong group how can i create an ldap query to get all the users with exchange boxes inside a specific OU this OU might also have OUs indise it with users that hafve mailboxes i want this to be able to create customized address lists Thank you Address Lists cannot be targeted at particular OUs. You need to use some user attribute that's common for users in that OU - like department, location, company name, etc. -- Bharat Suneja MCSE, MCT www.zenprise.com blog: www.suneja.com/blog ----------------------------------------- "Nazgyl" <naz...

query on View vs. Table
In a Sql Server DB, we have a large Table, and we also created a View of that table - the View contains more 'user-friendly' column names than the underling Table. Question: Is there a performance cost to running a query on the View rather than directly on the underlying Table? Thanks in advance for your input ... Will WCM (WCM@discussions.microsoft.com) writes: > In a Sql Server DB, we have a large Table, and we also created a View of > that table - the View contains more 'user-friendly' column names than > the underling Table. > > Q...

4117 Event ID Error
Starting 1-29-04 we started getting 4117 error messages just like those discussed in Micrisoft's Knowledge Base Article 190084. The only thing that arcticle suggests is to update to SP 4 which is already installed on the machine. I have never seen this message before and now we are getting one every few minutes. Any help would be appreciated. Thanks Sean Seems like you have something else going on then, check out the following articles and see if these help: 126497 XADM: Limiting the Number of Recipients of a Message http://support.microsoft.com/?id=126497 230250 XFOR: Internet ...

Query Assistance (Last or Most Recent)
I am trying to create two reports from an Access database that relate to a field called placement type. In the first report, I want to run a report listing the most recent placement type for clients (a single client may have multiple placement types in the database). The query criteria that I am using is: Last("Date of Placement") When I execute the query I get an error message indicating that I cannot have aggregate function in WHERE clause (tbl_Placements.[Date of Placement]=Last("Date of Placement")). My second report/query that I want is to compar...

Event
I have recorded a macro that I need to automatically run at 6:45am daily. How do I specify this in the code? Everything you need to know about OnTime procedures (but were afraid to ask): http://www.cpearson.com/excel/ontime.htm You'll need to have excel running for this to work. ===== Some versions of windows have scheduler programs. (Or you can get a freeware/shareware version on the web (www.shareware.com is where I look first.) Then you could have that scheduling program start an excel workbook. If you name the macro Auto_Open, then it'll run when the workbook opens. (But ...

Event After the sale
Hi to all Is any way to bypass the event that after you complete the sale you get a window with the change in it, in order to go to the next sale you have either hit OK or enter because if you scan an item from that point it does not scan in and it appears to me that you can miss an item from been scanned in any way to fix this issue. Also if you have scan several items into the system and you go to del one item in the middle of the page RMS is loosing its focus and starts to scan into the next line down which deletes the items that have been scanned.I think it should go to the next ...

What event when I click the record selector
I have some labels on the form would like to populate its value (they are calculated values) when I select the record selector, next, previous or last or first. What event should I write the code into? On Tue, 22 May 2007 11:01:23 +1000, "Alan T" <alanpltseNOSPAM@yahoo.com.au> wrote: >I have some labels on the form would like to populate its value (they are >calculated values) when I select the record selector, next, previous or last >or first. > >What event should I write the code into? > Well, don't use Labels for this purpose; use textboxes ...

Recurring event
Is there a way to set a meeting date and have it recurring each month, but not on a certain week or certain date of each month. My meeting happens on a Thursday in each month but not every 2nd, 3rd or 4th Thursday. Some months it is the 3rd Thursday and some it is the 4th Thursday. ...

SupplierID Query Help
I found this query in an old post. SELECT SupplierID FROM Item WHERE ItemLookupCode'RDB8020301' When I run it, I receive this error message: An error occurred while executing query: Line 1: Incorrect syntax near 'RDB8020301'. Can anyone throw me a bone and let me know how to correct. Thanks Steve SELECT SupplierID FROM Item WHERE ItemLookupCode='RDB8020301' - Evan Culver New West Technologies "Steve" <Steve@discussions.microsoft.com> wrote in message news:E2ADBC85-AE2B-4C53-AF33-76720451F31C@microsoft.com... >I found this query in an old p...

Events, dear boy, events #3
Aha I pasted: Application.EnableEvents = true into the immediate window and now the code is working. I don't have an code that would have turned it off in the first place, however. Coul this be a default setting somewhere, or is just one of those thing that can happen now and then? Anyway, thanks for the solution, Bo -- Gromi ----------------------------------------------------------------------- Gromit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=92 View this thread: http://www.excelforum.com/showthread.php?threadid=27721 Just a guess. If you turn...

Meaning of "last logged on by", Exch 2003 ?
On Exchange 2003, under "Mailbox Store", "Mailboxes", I see Mailbox:Smith, Joe Last Logged on By:"MyDomain\MyManager" I see a number of mailboxes in which "MyDomain\MyManager" appears as "last logon time" and last "logoff" time is the same, 8:00AM. Can someone explain why this happens ? What does that "last logged on by " really means ? the last user that accessed that particular mailbox will show up there. Philip Nunn "Marlon Brown" <marlon_brown@hotmail.com> wrote in message news:uv$x1tHCFHA.1524@...

reference is not valid message for pivot tables based on Access query
I've looked around but can't find an answer to this. I have a workbook - an xlt - that has 6 worksheets that pull data from different queries in the same Access database. I have several worksheets with on pivot table each. The pivot tables are based on dynamic named ranges in the external data worksheets. I use dynamic ranges because I have some adjacent calculated columns in the worksheets. The workbook has only 6 pivot caches - the same as the number of worksheets that pull data. I copied pivot tables from sheet to sheet so that they'd use the same cache, where approp...

Posting events to the event viewer.
I've been using a particular method to post program events to the event viewer. It works, but there is an issue that is driving me crazy. Perhaps there is a better way or different way to accomplish what I am doing. 1) My events are listed in a file I call EventLog.mc. The events are in this file using a particular syntax. 2) Right after creating the file for the first time, or if I change the file, I run the event log compiler. by doing "mc.exe EventLog -d". This process creates a file called "EventLog.rc". 3) I directly edit my program's main .rc file. Nea...

remove action query message
When I run an append query or make table query the system tells me that I will add records and so on... is there any way to suppress these messages? There are a few posts on line but they don't seem to apply to Access 2007. Can anyone help? On Tue, 16 Mar 2010 17:20:01 -0700, Waxman <Waxman@discussions.microsoft.com> wrote: Programmatically: DoCmd.SetWarnings False. Interactively: Office Button > Access Options > Advanced > Confirm > Action Queries -Tom. Microsoft Access MVP >When I run an append query or make table query the system tells me that ...

reading win 7 event logs
Thanks in advance for your help. I have an app that reads my xp logs and posts them to a central database using WMI. I understand that has changed in win 7. Can anyone out there steer me in the right direction to read the win 7 logs? Thanks. hi Lance, On 06.05.2010 22:29, Lance McGonigal wrote: > I have an app that reads my xp logs and posts them to a central database > using WMI. > I understand that has changed in win 7. Can anyone out there steer me in > the right direction to read the win 7 logs? Not that I know. Neither WMI http://msdn.microsoft....

Call Event from Subform
I've figured out how to execute a sub on a subform initiated on the form. [Forms]![Contacts]![ContactsAddresses].Form.btnSave_Click I can't for the life of me figure out how to do the opposite. To execute a sub on the form called from the subform. When I do a search it always talks about controls, not subroutines. Can someone please help! On Wed, 10 Feb 2010 17:50:01 -0800, PeterM <PeterM@discussions.microsoft.com> wrote: Me.Parent.myPublicProcedure Note that the procedure must be public. Click events are Private by default, but you can simply...

Event 9582
We are using Exchange 2000 with SP3 on Windows 2000 Server Std. We had to upgrade the memory in the server from 2GB to 4GB for another application. We have the following error every hour in the Application log: Event type: Warning Event source: Microsoft Exchange IS Event category: Performance Event ID: 9582 Description: The virtual memory necessary to run your Exchange server is fragmented in such a way that performance may be affected. It is highly recommended that you restart all Exchange services to correct this issue. These events keep appearing once every hour in my Event viewer log. D...

Code to Query SQL Server with a parameter value (entered into an Input Box), and have that value also display in a selected cell on a worksheet
I'm wondering how BEST to accomplish this. I have a EXCEL workbook which populates data to, and retrieves data from SQL Server. I currently have VBA code which effectively sends the data from the EXCEL worksheet to SQL Server tables -- no problem with this. I currently have VBA code which effectively retrieves data from SQL Server and displays that data back into the worksheet -- no problem with this either. I'm currently using a Command Button (on-click event) and the code below to query SQL Server to determine the Max Version Number and add 1 to that value. This value is t...