Tuesday, June 19, 2007

Export All DL's in a Domain

The following command can be used to export all Distribution List's.

csvde -f c:\DistributionLists.csv -s GCNAME -d ",dc=rishi,dc=com" -p subtree -l name,managedBy -r "((&(objectCategory=Group)(objectClass=Group)((groupType=8)(groupType=4)(groupType=2)))(objectCategory=ms-Exch-Dynamic-Distribution-List)(objectClass=msExchDynamicDistributionList))"

If you remove -l it will give the dump of all the attributes.

Monday, June 11, 2007

Drive Safely

Last weekend I got a car for my sister .. Today while reading my mails .. I came across a junk mail .. But it was really good .. So I want you all to read it .. We all have loved ones whom we want to be there always ..
This is really touchin ..............
Sanjay, a rich guy, loved fast cars and he did have a few in his possession. He loved to speed and could not be bothered about breaking speed limits. Many a times he was caught by the cops and speed radars, fined, but still he never bothered until.
One day as he was driving at a very high speed as usual, he saw a cop following him. The cop overtook him finally and asked him to stop and checked his license. He then took out his pad and started Writing, and then handed over the sheet of paper to Sanjay.
How much was this one going to cost?!!!
Wait a minute.
What was this????
Some kind of joke? Certainly not a ticket.
Sanjay began to read:
"Dear Sanjay,
Once upon a time I had a lovely daughter. She was six when killed by a car.You guessed it - a speeding driver's car.A fine and three months in jail, and the man was free. Free to hug his three daughters. I only had one, and I'm going to have to wait until Heaven, before I can ever hug her again.
A thousand times I've tried to forgive that man. A thousand times I thought I had. Maybe I did, but I need to do it again. Even now. Pray for me.. And be careful, Sanjay, my son is all I have left."
Sanjay turned around in time to see the cop's car pull away and head down the road. He watched until it disappeared. A full 15 minutes later, he too, pulled away and drove slowly home, praying for forgiveness and hugging a surprised wife and kids when he arrived.
Life is precious. Handle it with care.

Thursday, June 7, 2007

Shortcut to Command Prompt

We go to the command prompt via Start > Run > Cmd and then do Ipconfig or nslookup .. and so on .. There is a shorter way to do it ..

Start > Run
Type : cmd /k ipconfig or cmd /k nslookup

The above commands can be used as batch file as well. Create few batch files and keep them on the desktop so that you dont have to type .. You know .. I want to make it easy for you guys.

Monday, June 4, 2007

Move the Offline Address Book to another drive

A situation can occur where we have less space on the drive, So we can move the address book to a different drive.

The address book can take upto 700 MB.

1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersionWindows Messaging Subsystem\Profiles\Profile_name\13dbb0c8aa05101a9bb000aa002fc45a
3. On the Edit menu, point to New, and then click String Value.
4. Type 001e660e, and then press ENTER.
5. Right-click 001e660e, and then click Modify.
6. In the Value data box, type the path of the folder where you want to store the Offline Address Book files, and then click OK.
7. Quit Registry Editor.

NDR : 5.1.4

MS definition : Two objects have the same (proxy) address, and mail is sent to that address. This issue can also occur if the recipient does not exist on the remote server.

Normal search in ADUC does not give the result that we want. So go to the command prompt and make use of LDIFDE

ldifde -f c:\duplicate.txt -s DC_name -t 3268 -d "dc=abc,dc=com" -p subtree -r "(proxyAddresses=smtp:duplicate.smtp@abc.com)"

Macro to warn you if attachment is missed

I have made such mistakes many a times .. I used to write to my Boss .. Please find the attached file .. But there was no attachment .. hehehehe..

I thought .. better i find a way .. before my Boss finds a way to improve me .. So I went to my best friend google .. and found a Macro .. I have edited it as per my requirement ..

Steps in detail :

In Outlook, go to Tools -> Macros -> Security and select Medium. You'll be prompted if you want to run macros when you start Outlook.

Go to Tools -> Macros -> Visual Basic Editor.

Double-click on 'This Outlook Session' in the left-hand panel.

Paste the following code into the code window:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim lngres As Long
If InStr(1, UCase(Item.Body), "ATTACH") <> 0 Then
If Item.Attachments.Count = 0 Then
lngres = MsgBox("'Attach' in body, but no attachment - send anyway?", _vbYesNo + vbDefaultButton2 + vbQuestion, "Boss wont like it ... You did it again")
If lngres = vbNo Then Cancel = True
End If
End If
End Sub

Press F5 to check the code and make sure it's properly compiled.

Close the code editor and restart Outlook. You should be asked on startup if you want to run macros; select Enable Macros.

Send a test message with "attach" somewhere in the body and no attachment to make sure the script works.

Range of MX Record

The values that we can assign to MX records are in the range of 0 to 65535. That makes 65536 values. It is 2^16 = 65536.

Sunday, June 3, 2007

Myth of /3GB

3GB switch only needs 1GB or more physical memory.

It's simple to explain what it does, but people often misunderstand.
The /3GB switch changes the way the 4GB virtual address space is split up. Instead of splitting it as 2GB of user mode virtual address space and 2GB of kernel mode virtual address space, the split is 3GB of user mode virtual address space and 1GB of kernel mode virtual address space.
That's all.
And yet people think it does more than that.
I think the problem is that people think that "virtual address space" means something other than just "virtual address space".
The term "address space" refers to how a numerical value (known as an "address") is interpreted when it is used to access some type of resource. There is a physical address space; each address in the physical address space refers to a byte in a memory chip somewhere. (Note for pedants: Yes, it's actually spread out over several memory chips, but that's not important here.) There is an I/O address space; each address in the I/O address space allows the CPU to communicate with a hardware device.
And then there is the virtual address space. When people say "address space", they usually mean "virtual address space".
The virtual address space is the set of possible pointer values (addresses) that can be used at a single moment by the processor. In other words, if you have an address like 0x12345678, the virtual address space determines what you get if you try to access that memory. The contents of the virtual address space changes over time, for example, as you allocate and free memory. It also varies based on context: each process has its own virtual address space.
Saying that 2GB (or 3GB) of virtual address space is available to user mode means that at any given moment in time, out of the 4 billion virtual addresses available in a 32-bit value, 2 billion (or 3 billion) of them are potentially usable by user-mode code.

User Info w/o using Adsiedit

' On Error Resume Next
' Define variables
dim firstName
dim lastName
' Prompts to enter first name and loops till users does not enter a first name
Do while firstname=""
' msgbox("Please type your first name")
firstName=inputbox("Enter your first name:","First Name")
' If user presses cancel then move forward
If IsEmpty(firstname) Then
exit do
End If
Loop
' Prompts to enter last nameDo while lastname=""
' msgbox("Please type your last name")
lastName=inputbox("Enter your last name") ' If user presses cancel, then move forward
If IsEmpty(lastname) Then
exit do
End If
Loop
' Display AD properties only if a name has been entered
if firstname<>"" Or lastname<>"" then
Set objUser = GetObject("ldap://cn=&" "&lastname&",dc=abc,dc=com")
Set WMIUser = GetObject("winmgmts:{impersonationlevel=impersonate}!" &"/root/cimv2:Win32_UserAccount.Domain='ASIA'" & ",Name='" & objUser.sAMAccountName & "'")
WScript.Echo "Display Name: " & objUser.displayName
WScript.Echo "Office: " & objUser.physicalDeliveryOfficeName
WScript.Echo "Telephone Number: " & objUser.telephoneNumber
WScript.Echo "Home Phone: " & objUser.homephone
WScript.Echo "Login ID: " & objUser.sAMAccountName
WScript.Echo "Account Last Accessed on: " & objUser.whenChanged
WScript.Echo "Account Created on: " & objUser.whenCreated
WScript.Echo "User SID: " & WMIUser.SID
' Add more properties if needed

End If

Script to send email from a server which has SMTP service running.

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "Rishi.Bhardwaj@abc.com"
objEmail.To = "myself@abc.com"
objEmail.Subject = "Automated Email"
objEmail.Textbody = "Server is running SMTP."
objEmail.AddAttachment "abc.txt"
objEmail.Send