Question : Script that checks the created computer objects and logs/. Need a way to run as scheduled task and email using outlook.

Hi,

Script that checks the created computer objects and logs/. Need a way to run as scheduled task and email using outlook.
I want the script when run and logged to email the log as attachment or on the body of the email.

Can anyone help.

Regards
Sharath
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
dtmDate = Now
 
strYear = Right(Year(dtmDate), 2)
strMonth = Month(dtmDate)
If Len(strMonth) < 2 Then strMonth = "0" & strMonth
strDay = Day(dtmDate)
If Len(strDay) < 2 Then strDay = "0" & strDay
 
strStartDate = strYear & strMonth & strDay & "000000Z"
strEndDate = strYear & strMonth & strDay & "235959Z"
 
strFilter = "(&(createTimeStamp>=" & strStartDate & ")(createTimeStamp<=" & strEndDate & ")(objectCategory=computer))"

Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
 
Set objRootDSE = GetObject("LDAP://RootDSE")
Set objRecordSet = objConnection.Execute( _
  "<LDAP://" & objRootDSE.Get("defaultNamingContext") & ">;" & _
  strFilter & ";distinguishedName,name,createTimeStamp;subtree")
Set objRootDSE = Nothing
 
While Not objRecordSet.EOF
  dtmCreateTimeStamp = CDate(objRecordSet.Fields("createTimeStamp").Value)
  strMessage = objRecordSet.Fields("distinguishedName").Value & VbCrLf & _
    objRecordSet.Fields("name") & VbCrLf & _
    objRecordSet.Fields("createTimeStamp")
 
  WScript.Echo strMessage
  objRecordSet.MoveNext
WEnd

Answer : Script that checks the created computer objects and logs/. Need a way to run as scheduled task and email using outlook.

You should really read up on the specifics of each isolation level, especially in regards to the type of database you are using.

But in general, the different isolation level allow you to specify how to trade off's in terms of concurrent data access. For example, read_uncommitted may allow your process to read data from the database that hasn't yet been committed but the advantage being that any number of concurrent processes can perform that read. On the other side, serializable means that you are guaranteed that another concurrent data read/write won't interfere with your access but at the preformance expense that only you are allowed to perform that read/write.

Basically, in the following order...

1. Transaction_read_uncommited
2. Transaction_read_commited
3. Transaction_repeatable_read
4. Transaction_serializable

you should use a the lowest numbered isolation level that will still ensure that your data requirements are met. This will ensure that you application can support concurrent users/accesses in the best performing way that it can. This is also why you should really read up on the details and side effects of each level so that you can appropriately pick the level that will meet you requirements.

Hope that helps...
Random Solutions  
 
programming4us programming4us