OK all you admins, put in that Change Request, and get installing! For an overview of the new features that are available in Exchange Server 2007 SP2, see “What’s New in Exchange Server 2007 SP2”.
Use Excel to create easy batch jobs
25 08 2009Do you have to run a command on several servers remotely? You can enter each command separately, but every good admin should know how to make life easier for him/her self. For example, I wanted to use the psloggedon.exe tool to find out who was logged in to all the servers I manage (about 150). Naturally, I could log into each server, check the Terminal Server Manager, and go on the next, but who wants to do that?
The PSTool – psloggedon.exe is a nice little utility that I can run from my command prompt, and have it query a remote computer, returning who is logged on to that server. So, starting in Excel (I already had a list of all the servers), I pasted the list of servers in the C column.
Next, in Column A, I entered “psloggedon.exe” – the name of the executable I want to run. in Column B, I put a “ \\” – note the space in front of the \\. In column E, I entered my first switch, “ –l” – and in column F, a second switch “ –x” again, note the spaces before the switches.
Now, to bring the whole thing together. I LOVE the command Concatenate.
In column G, I entered =concatenate(A1,B1,C1,D1,E1)
This will combine all the columns together (now you know why the spaces were above) for your final command.
You can now select column G, and copy and paste it into notepad, and save it as a .bat file. You now have an easily made bat file, using Excel.
Comments : Leave a Comment »
Categories : Scripting
Use Excel to create easy batch jobs
25 08 2009Do you have to run a command on several servers remotely? You can enter each command separately, but every good admin should know how to make life easier for him/her self. For example, I wanted to use the psloggedon.exe tool to find out who was logged in to all the servers I manage (about 150). Naturally, I could log into each server, check the Terminal Server Manager, and go on the next, but who wants to do that?
The PSTool – psloggedon.exe is a nice little utility that I can run from my command prompt, and have it query a remote computer, returning who is logged on to that server. So, starting in Excel (I already had a list of all the servers), I pasted the list of servers in the C column.
Next, in Column A, I entered “psloggedon.exe” – the name of the executable I want to run. in Column B, I put a “ \\” – note the space in front of the \\. In column E, I entered my first switch, “ –l” – and in column F, a second switch “ –x” again, note the spaces before the switches.
Now, to bring the whole thing together. I LOVE the command Concatenate.
In column G, I entered =concatenate(A1,B1,C1,D1,E1)
This will combine all the columns together (now you know why the spaces were above) for your final command.
You can now select column G, and copy and paste it into notepad, and save it as a .bat file. You now have an easily made bat file, using Excel.
Comments : Leave a Comment »
Categories : Script
Export Outlook Contact Pictures
21 08 2009I recently made a mistake, and deleted the folder where I kept all the original headshots of all my contacts. Don’t ask me why I keep them, I just do… I know I have them in Outlook, but I like to have the originals also. Anyway, I wanted a way to export the picture from Outlook, back into the file system. Well, I ran across this script that will do just that. I could not get it to run correctly running Vista or Windows 7, running Office 2007, or Office 2010, but was able to get it to run on XP with Office 2003. Guess the MAPI calls are different or something. If anyone knows how to make this work on Windows Vista/7, using Office 2007/2010 let me know!~
Here’s the script:
Public Const CdoDefaultFolderContacts = 5snServername = wscript.arguments(0)mbMailboxName = wscript.arguments(1)set csCDOSession = CreateObject("MAPI.Session")pfProfile = snServername & vbLf & mbMailboxNamecsCDOSession.Logon "","",False,True,0,True, pfProfileset cfContactsFolder = csCDOSession.getdefaultfolder(CdoDefaultFolderContacts)set cfContactscol = cfContactsFolder.messagesset ofConFilter = cfContactscol.FilterSet cfContFltFld1 = ofConFilter.Fields.Add("0x8015",vbBoolean,true,"0420060000000000C000000000000046")For Each ctContact In cfContactscolSet collAttachments = ctContact.AttachmentsFor Each atAttachment In collAttachmentsIf atAttachment.name = "ContactPicture.jpg" Thenfname = replace(replace(replace(replace(replace((ctContact.subject & "-" & atAttachment.name),":","-"),"\",""),"/",""),"?",""),chr(34),"")fname = replace(replace(replace(replace(replace(replace(fname,"<",""),">",""),chr(11),""),"*",""),"|",""),"(","")fname = replace(replace(replace(fname,")",""),chr(12),""),chr(15),"")atAttachment.WriteToFile("c:\contactpictures\" & fname)wscript.echo "Exported Picture to : " & fnameEnd ifnextNextSave the above code as a .vbs file, and run it from the command line:
exportOutlookPic.vbs mailboxservername exchangeAlias
Make sure that you have created the folder referenced in the script, or you will get an error (c:\contactpictures\). Works like a charm! I know have all my Outlook Contact pictures, in my folder system. 🙂
Comments : Leave a Comment »
Categories : Outlook, Script
Exchange 2010 RC is Available!
18 08 2009Just heard from my friend Scott @ MS that the RC is available for download! It’s been posted on the Exchange Blog here: http://msexchangeteam.com/archive/2009/08/17/451974.aspx
Comments : Leave a Comment »
Categories : Exchange
Exchange 2007 CCR – Move File Share Witness
10 08 2009Sometimes it is necessary to move the Exchange 2007 CCR’s File Share Witness. This is easily done with the command prompt:
cluster CLUSTERNAME resource “Majority Node Set” /priv MNSFileShare=\\server\share
cluster CLUSTERNAME group “Cluster Group” /move
cluster CLUSTERNAME group “Cluster Group” /move
When moving the FSW location, don’t forget to set the correct permissions – for more information on File Share Witness, see Technet: http://technet.microsoft.com/en-us/library/bb124922.aspx
Comments : Leave a Comment »
Categories : Exchange
