none
EASY- Creating Exchange 2010 Mailbox using VBA/Powershell Script from XLSX RRS feed

  • Question

  • I am using a script to create new users from a spreadsheet which has 20-25 columns containing information. I need this script to also create an exchange mailbox with some default settings.

    **See script in below post**


    "Sadly most places want the Porche fastness and reliablity, but only pay for a used 74 pinto, then they are "Shocked" that it wont run, and blame the IT guy"

    Monday, November 14, 2011 2:24 PM

Answers

  • I may be outside of my skill level, I am sort of pasting examples and testing them until they work. If anyone knows of a better way to do what I am trying to do, please let me know. Perhaps invoking a separate instance of EMS to run New-Mailbox from a PS1?
    "Sadly most places want the Porche fastness and reliablity, but only pay for a used 74 pinto, then they are "Shocked" that it wont run, and blame the IT guy"

    If you have the option of using the EMS, that would probably be the easiest route to go. Save the excel file as a CSV and use New-Mailbox to create the users/mailboxes.

    Get-Help New-Mailbox
    
    Import-Csv mailboxes.csv | %{
    New-Mailbox -Parameter1 $_.FirstName -Parameter2 $_.SMTPAddress etc.
    }

    I don't have access to the EMS at the moment, but the Get-Help cmdlet should give you the parameters needed.


    Rich Prescott | Infrastructure Architect, Windows Engineer and PowerShell blogger | MCITP, MCTS, MCP

    Engineering Efficiency
    @Rich_Prescott
    Client System Administration tool
    AD User Creation tool
    Tuesday, November 15, 2011 7:42 PM
    Moderator
  • Hi,

    Sorry, I don't use Excel or Exchange, so I'm not going to be much help with this question. Your last post said, "What about this?" So I am confused: Is this question answered or not?

    Bill

    Wednesday, November 30, 2011 10:15 PM
    Moderator

All replies

  • I may be outside of my skill level, I am sort of pasting examples and testing them until they work. If anyone knows of a better way to do what I am trying to do, please let me know. Perhaps invoking a separate instance of EMS to run New-Mailbox from a PS1?
    "Sadly most places want the Porche fastness and reliablity, but only pay for a used 74 pinto, then they are "Shocked" that it wont run, and blame the IT guy"

    If you have the option of using the EMS, that would probably be the easiest route to go. Save the excel file as a CSV and use New-Mailbox to create the users/mailboxes.

    Get-Help New-Mailbox
    
    Import-Csv mailboxes.csv | %{
    New-Mailbox -Parameter1 $_.FirstName -Parameter2 $_.SMTPAddress etc.
    }

    I don't have access to the EMS at the moment, but the Get-Help cmdlet should give you the parameters needed.


    Rich Prescott | Infrastructure Architect, Windows Engineer and PowerShell blogger | MCITP, MCTS, MCP

    Engineering Efficiency
    @Rich_Prescott
    Client System Administration tool
    AD User Creation tool
    Tuesday, November 15, 2011 7:42 PM
    Moderator
  • The only issue I see with this is that my Excel file is xlsx and will be filled out by Human Resources, which can't do anything besides fill in the blanks. I have my Excel spreadsheet set up with lookup lists so that a lot of the options such as CN's, groups, managers, job titles, etc are option based. Then HR fills in 5 columns with name, email, etc.

    I then run this script, which creates my AD accounts, and then applies all of my attributes- which runs perfectly. If I were to invoke an EMC script, where would I pull the information to make the mailbox, since it is in an xlsx?

    Is there a way to create a default based mailbox without using a CSV by reading AD attributes?

    Something like

    New-Mailbox -DisplayName $_.givenName & "." & $_.sn -TargetAddress "SMTP:" & $_.mail

    Where the bold items are AD User attributes already in existance?


    "Sadly most places want the Porche fastness and reliablity, but only pay for a used 74 pinto, then they are "Shocked" that it wont run, and blame the IT guy"
    Tuesday, November 15, 2011 7:50 PM
  • In order to keep the thread readable, I deleted my other posts. Here is my script, and here is my problem. This script executes beautifully, and creates a user weith extended attributes based on a XLSX file. It creates Exchange attributes such as homeMDB and homeMTA. The only thing it does NOT do, is assign a mailboxGUID to the newly created user, which means the new user cant use his mail. One way around this is to run a command in EMS:

    Set-Mailbox user.name -applymandatoryupdates

    I cant figure out how to pipe this command into the script.

    For the user.name above, I need it to pull a variable from the top of the script, which is strMailNickname. I am posting the whole script, with the command I am TRYING to use commented out and bolded right near the bottom. If anyone else knows a way to accomplish this using other means I am all years, but getting it to work from this script alone is possible and would be awesomely helpful.

    ' Copyright (c) 2003-2010 Richard L. Mueller
    ' Hilltop Lab web site - http://www.rlmueller.net
    ' Modifications by Christopher M. Dill
    ' Version 1.0 - September 8, 2003
    ' Version 1.1 - January 25, 2004 - Modify error trapping.
    ' Version 1.2 - March 18, 2004 - Modify NameTranslate constants.
    ' Version 2.0 - October 7, 2007 - Specify container for each user object
    '                             in spreadsheet. Accept NT names of groups.
    ' Version 2.1 - November 6, 2010 - No need to set objects to Nothing.
    '
    ' You have a royalty-free right to use, modify, reproduce, and
    ' distribute this script file in any way you find useful, provided that
    ' you agree that the copyright owner above has no warranty, obligations,
    ' or liability for such use.
    
    Option Explicit
    
    Dim objExcel, strExcelPath, objSheet
    Dim strLast, strFirst, strMiddle, strPW, intRow, intCol
    Dim strGroupDN, objUser, objGroup, objContainer
    Dim strCN, strNTName, strContainerDN, strDescription, strTitle, strMobile, strInfo, strDisplayName
    Dim strHomeFolder, strHomeDrive, objFSO, objShell, strDepartment, strCompany, strManager, strTelephoneNumber
    Dim intRunError, strNetBIOSDomain, strDNSDomain, strMail, strTargetAddress
    Dim objRootDSE, objTrans, strLogonScript, strUPN, strMailNickname, strmsExchHomeServerName, strmDBUseDefaults
    Dim strPreviousDN, blnBound, strAccountName, strHomeMDB, strHomeMTA
    Dim strmsExchRecipientDisplayType, strmsExchRecipientTypeDetails, strmsExchELCMailboxFlags, strLegacyExchangeDN
    Dim strProxyAddress, strProxyAddress2, strProxyAddress3, strmsExchMobileMailboxFlags, strmsExchVersion, oShell
    
    'strmsRTCSIPPrimaryUserAddress, strmsRTCSIPPrimaryHomeServer
    
    ' Constants for the NameTranslate object.
    Const ADS_NAME_INITTYPE_GC = 3
    Const ADS_NAME_TYPE_NT4 = 3
    Const ADS_NAME_TYPE_1779 = 1
    
    ' Specify spreadsheet.
    strExcelPath = "E:\Network Share\NewUser.xlsx"
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Wscript.Shell")
    
    ' Determine DNS domain name from RootDSE object.
    Set objRootDSE = GetObject("LDAP://RootDSE")
    strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    
    ' Use the NameTranslate object to find the NetBIOS domain name
    ' from the DNS domain name.
    Set objTrans = CreateObject("NameTranslate")
    objTrans.Init ADS_NAME_INITTYPE_GC, ""
    objTrans.Set ADS_NAME_TYPE_1779, strDNSDomain
    strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
    ' Remove trailing backslash.
    strNetBIOSdomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
    
    ' Open spreadsheet.
    Set objExcel = CreateObject("Excel.Application")
    
    On Error Resume Next
    objExcel.Workbooks.Open strExcelPath
    If (Err.Number <> 0) Then
        On Error GoTo 0
        Wscript.Echo "Unable to open spreadsheet " & strExcelPath
        Wscript.Quit
    End If
    On Error GoTo 0
    Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
    
    ' Start with row 4 of spreadsheet.
    ' Assume first row has explanation.
    ' Assume second row has column headings.
    ' Assume third row has example.
    intRow = 4
    
    ' Read each row of spreadsheet until a blank value
    ' encountered in column 8 (the column for cn).
    ' For each row, create user and set attribute values.
        strPreviousDN = ""
        Do While objSheet.Cells(intRow, 8).Value <> ""
    
        strContainerDN = Trim(objSheet.Cells(intRow, 1).Value)
    
    ' HR fill in information.
    
        strFirst = Trim(objSheet.Cells(intRow, 2).Value)
        strLast = Trim(objSheet.Cells(intRow, 3).Value)
        strTitle = Trim(objsheet.Cells(intRow, 4).Value)
        strMobile = Trim(objsheet.Cells(intRow, 5).Value)
        strInfo = Trim(objsheet.Cells(intRow, 6).Value)
    
    ' Other information.
    
        strPW = Trim(objSheet.Cells(intRow, 7).Value)
        strCN = Trim(objSheet.Cells(intRow, 8).Value)
        strDisplayName = Trim(objSheet.Cells(intRow, 8 ).Value)
        strTelephoneNumber = Trim(objSheet.Cells(intRow, 5).Value)
        strNTName = Trim(objSheet.Cells(intRow, 9).Value)
        strUPN = Trim(objSheet.Cells(intRow, 10).Value)
        strDescription = Trim(objSheet.Cells(intRow, 11).Value)
        strDepartment = Trim(objSheet.Cells(intRow, 12).Value)
        strCompany = Trim(objSheet.Cells(intRow, 13).Value)
        strManager = Trim(objSheet.Cells(intRow, 14).Value)
        strMail = Trim(objSheet.Cells(intRow, 15).Value)
    	
    ' Exchange Specific Information	
    	
        strHomeMDB = "CN=Mailbox Database 0975437429,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=solace,DC=local"
        strHomeMTA = "CN=Microsoft MTA,CN=WGES,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=solace,DC=local"
    	strLegacyExchangeDN = "/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=" & strFirst & "." & strLast
    	strmsExchHomeServerName = "/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=WGES"
        strmsExchRecipientDisplayType = "1073741824"
    	strmsExchRecipientTypeDetails = "1"
    	strmsExchELCMailboxFlags = "2"
    	strMailNickname = strFirst & "." & strLast
    	strmDBUseDefaults = TRUE
    	strTargetAddress =  Trim(objSheet.Cells(intRow, 16).Value) '"SMTP:" & strFirst &"." & strLast &"@" &"wellness-group.org" 'Trim(objSheet.Cells(intRow, 15).Value) ' Maybe use this?  strFirst &"." & strLast &"@" &"wellness-group.org"
        
    ' Email Address creation
    	
    	strProxyAddress = Trim(objSheet.Cells(intRow, 16).Value)
    	'strProxyAddress2 =	"sip:" & strFirst & "." & strLast & "@wellness-group.org"
    	'strProxyAddress3 =	"smtp:" & strFirst & "." & strLast & "@solacehealthcare.org"
    	strmsExchMobileMailboxFlags = "1"
    	strmsExchVersion = "44220983382016"
    	'strmsRTCSIPPrimaryUserAddress = "sip:" & strFirst & "." & strLast & "@wellness-group.org"
    	'strmsRTCSIPPrimaryHomeServer = "CN=Lc Services,CN=Microsoft,CN=1:1,CN=Pools,CN=RTC Service,CN=Services,CN=Configuration,DC=solace,DC=local"
    	' If this container is different from the previous, bind to
        ' the container the user object will be created in.
        If (strContainerDN <> strPreviousDN) Then
            On Error Resume Next
            Set objContainer = GetObject("LDAP://" & strContainerDN)
            If (Err.Number <> 0) Then
                On Error GoTo 0
                Wscript.Echo "Unable to bind to container: " & strContainerDN
                Wscript.Echo "Unable to create user with NT name: " & strNTName
                ' Flag that container not bound.
                strPreviousDN = ""
            Else
                On Error GoTo 0
                strPreviousDN = strContainerDN
            End If
        End If
        ' Proceed if parent container bound.
        If (strPreviousDN <> "") Then
            ' Create user object.
            On Error Resume Next
            Set objUser = objContainer.Create("user", "cn=" & strCN)
            If (Err.Number <> 0) Then
                On Error GoTo 0
                Wscript.Echo "Unable to create user with cn: " & strCN
            Else
                On Error GoTo 0
                ' Assign mandatory attributes and save user object.
            If (strNTName = "") Then
                    strNTName = strCN
                End If
                objUser.sAMAccountName = strNTName
                On Error Resume Next
                objUser.SetInfo
            If (Err.Number <> 0) Then
                    On Error GoTo 0
                    Wscript.Echo "Unable to create user with NT name: " & strNTName
                Else
                    ' Set password for user.
                    objUser.SetPassword strPW
            If (Err.Number <> 0) Then
                        On Error GoTo 0
                        Wscript.Echo "Unable to set password for user " & strNTName
                    End If
                    On Error GoTo 0
                    ' Enable the user account.
                    objUser.AccountDisabled = False
            If (strFirst <> "") Then
                        objUser.givenName = strFirst
                    End If
                    ' Assign values to remaining attributes.
            If (strLast <> "") Then
                        objUser.sn = strLast
                    End If
    				' Job Description
    		If (strDescription <> "") Then
                        objUser.description = strDescription
                    End If
    				' Display or common name
    		If (strDisplayName <> "") Then
                        objUser.displayName = strDisplayName
                    End If
    				' Job title
    		If (strTitle <> "") Then
                        objUser.title = strTitle
                    End If
    				' Personal Cell #
    		If (strMobile <> "") Then
                       objUser.mobile = strMobile
                    End If
    				' Personal Cell #
    		If (strTelephoneNumber <> "") Then
                       objUser.telephoneNumber = strTelephoneNumber
                    End If
    				' PERSONAL email address
    		If (strInfo <> "") Then
                       objUser.info = strInfo
    				End If
    				' LOGIN name
    		If (strUPN <> "") Then
                        objUser.userPrincipalName = strUPN
    				End If
    				' Department
    		If (strDepartment <> "") Then
                        objUser.department = strDepartment
                    End If
    				' Company name
     		If (strCompany <> "") Then
                        objUser.company = strCompany
                    End If
    				' AD string for managers account. Example : CN=Bob Johnson,OU=TeamOU,DC=domain,DC=local
    		If (strManager <> "") Then
                        objUser.manager = strManager
                    End If
    				' AD attribute mail
    		If (strMail <> "") Then
                        objUser.mail = strMail
                    End If
    				' Begin EXCHANGE programming
    		If (strHomeMDB <> "") Then
    		   objUser.homemdb = strHomeMDB
    				End If
    				' Home MTA??
    		If (strHomeMTA <> "") Then
    		   objUser.homeMTA = strHomeMTA
    				End If
    				' Assign primary and secondary email addresses.
    		If (strProxyAddress <> "") Then
    		   objUser.proxyAddresses = strProxyAddress '& ";" & strProxyAddress2 & ";" & strProxyAddress3
    				End If
    		If (strmsExchMobileMailboxFlags <> "") Then
    		   objUser.msExchMobileMailboxFlags = strmsExchMobileMailboxFlags
    				End If
    		If (strmsExchVersion <> "") Then
    		   objUser.msExchVersion = strmsExchVersion
    				End If		
    				
    				' SIP info
    		'If (strmsRTCSIPPrimaryUserAddress <> "") Then
    		'   objUser.msRTCSIP-PrimaryUserAddress = strmsRTCSIPPrimaryUserAddress
    		'		End If
    		'If (strmsRTCSIPPrimaryHomeServer <> "") Then
    		'   objUser.msRTCSIP-PrimaryHomeServer = strmsRTCSIPPrimaryHomeServer
    		'		End If		
    		If (strLegacyExchangeDN	 <> "") Then
    		   objUser.legacyExchangeDN = strLegacyExchangeDN	
    				End If
    		If (strmsExchRecipientDisplayType	 <> "") Then
    		   objUser.msExchRecipientDisplayType = strmsExchRecipientDisplayType	
    				End If
    		If (strmsExchRecipientTypeDetails	 <> "") Then
    		   objUser.msExchRecipientTypeDetails = strmsExchRecipientTypeDetails	
    				End If
    		If (strmsExchELCMailboxFlags	 <> "") Then
    		   objUser.msExchELCMailboxFlags = strmsExchELCMailboxFlags	
    				End If						
    		If (strmsExchHomeServerName <> "") Then
    		    objUser.msExchHomeServerName = strmsExchHomeServerName
    				End If
    					If (Err.Number <> 0) Then
    						On Error GoTo 0
    							Wscript.Echo "Unable to set attribute: " _
    							& strmsExchHomeServerName
    						End If
    					On Error GoTo 0
    		If (strMailNickname <> "") Then
    		    objUser.mailnickname = strMailNickname
    				End If
    					If (Err.Number <> 0) Then
    						On Error GoTo 0
    							Wscript.Echo "Unable to set attribute: " _
    							& strMailNickname
    						End If
    					On Error GoTo 0
    		If (strmDBUseDefaults <> "") Then
                        objUser.mdbusedefaults = strmDBUseDefaults
                    End If
    					If (Err.Number <> 0) Then
    						On Error GoTo 0
    							Wscript.Echo "Unable to set attribute: " _
    							& strmDBUseDefaults
    						End If
    					On Error GoTo 0
    				' Primary SMTP address
            If (strTargetAddress <> "") Then
    		    objUser.targetAddress = strTargetAddress
    				End If
    					If (Err.Number <> 0) Then
    						On Error GoTo 0
    							Wscript.Echo "Unable to set attribute: " _
    							& strTargetAddress
    						End If
    					On Error GoTo 0
                    ' Set password expired. Must be changed on next logon.
                    objUser.pwdLastSet = 0
                    ' Save changes.
                    On Error Resume Next
                    objUser.SetInfo
                    If (Err.Number <> 0) Then
                        On Error GoTo 0
                        Wscript.Echo "Unable to set PASSWORD EXP. for user with NT name: " _
                            & strNTName
                    End If
                    On Error GoTo 0
                    ' Create home folder. We don't use home folders in our domain.
                    'If (strHomeFolder <> "") Then
                    '    If (objFSO.FolderExists(strHomeFolder) = False) Then
                    '        On Error Resume Next
                    '        objFSO.CreateFolder strHomeFolder
                    '        If (Err.Number <> 0) Then
                    '           On Error GoTo 0
                    '          Wscript.Echo "Unable to create home folder: " & strHomeFolder
                    '     End If
                    '    On Error GoTo 0
                    'End If
                    'If (objFSO.FolderExists(strHomeFolder) = True) Then
                    ' Assign user permission to home folder.
                    '        intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " _
                    '           & strHomeFolder & " /T /E /C /G " & strNetBIOSDomain _
                    '          & "\" & strNTName & ":F", 2, True)
                    '     If (intRunError <> 0) Then
                    '        Wscript.Echo "Error assigning permissions for user " _
                    '           & strNTName & " to home folder " & strHomeFolder
                    '  End If
                    'End If
                    'End If
                    ' Group DN's start in column 17.
                    intCol = 17
                    Do While objSheet.Cells(intRow, intCol).Value <> ""
                        strGroupDN = Trim(objSheet.Cells(intRow, intCol).Value)
                        ' Attempt to bind to group object DN.
                        blnBound = False
                        On Error Resume Next
                        Set objGroup = GetObject("LDAP://" & strGroupDN)
                        If (Err.Number <> 0) Then
                            On Error GoTo 0
                            ' Try  again converting NT Name to DN.
                            On Error Resume Next
                            objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain _
                                & "\" & strGroupDN
                            If (Err.Number <> 0) Then
                                On Error GoTo 0
                                Wscript.Echo "Unable to bind to group " & strGroupDN
                            Else
                                On Error GoTo 0
                                strGroupDN = objTrans.Get(ADS_NAME_TYPE_1779)
                                Set objGroup = GetObject("LDAP://" & strGroupDN)
                                blnBound = True
                            End If
                        Else
                            On Error GoTo 0
                            blnBound = True
                        End If
                        If (blnBound = True) Then
                            objGroup.Add objUser.AdsPath
                            If (Err.Number <> 0) Then
                                On Error GoTo 0
                                Wscript.Echo "Unable to add user " & strNTName _
                                    & " to group " & strGroupDN
                            End If
                        End If
                        On Error GoTo 0
                        ' Increment to next group DN.
                        intCol = intCol + 1
                    Loop
                End If
            End If
        End If
    <strong>'objShell.Run("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile 'D:\Exchange Server Management\Bin\exshell.psc1' -noexit -command 'Set-Mailbox strMailNickname -applymandatoryupdates 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'")</strong>
        ' Increment to next user.
        intRow = intRow + 1
    Loop
    	
    
    Wscript.Echo "Success! Check ADUC and EMC!"
    
    ' Clean up.
    objExcel.ActiveWorkbook.Close
    objExcel.Application.Quit
    


    "Sadly most places want the Porche fastness and reliablity, but only pay for a used 74 pinto, then they are "Shocked" that it wont run, and blame the IT guy"
    Wednesday, November 16, 2011 3:09 PM
  • What about something like this?

    Function GetParameter(ByVal strName, ByRef Request)
        On Error Resume Next
        GetParameter = Request.Parameter(strName)
        On Error GoTo 0
    End Function ' GetParameter
    
    Function ExecutePowerShellCmdlet(ByVal strShellCommand)
        Dim objShell, strFullShellCommand, numReturnCode 
     
        '--- needed objects
        Set objShell = CreateObject("WScript.Shell")
     
        '--- construct a full command for shell
        strFullShellCommand = """" & strPowerShellFileName & """" & _
            " -PSConsoleFile """ & strExchangeSnapinFileName & """" & _
            " -NoLogo -NonInteractive" & _
            " -Command """ & strShellCommand & """"
     
        '--- execute a command and get a return code
        numReturnCode = objShell.Run(strFullShellCommand, 0, True)
     
        '--- numReturnCode = 0 means that the command was executed successfully
        '--- otherwise, it was failed
        ExecutePowerShellCmdlet = numReturnCode 
    End Function
    Sub onPostCreate(Request)
        '--- handle user object only ---
        If (IsObjectClassRequested("user", Request)) Then Exit Sub
     
        Dim strArgument1, strArgument2
     
        '--- get values from virtual attributes ---
        strArgument1 = GetAttribute("strMailNickname", Request)
        strArgument2 = GetAttribute("-applymanualupdates", Request)
     
        'Dim objOctetString
        Dim strObjectGUID, strDomainControllerFQDN
        Dim strShellCommand, numReturnCode
     
        '--- helping objects ---
        Set objOctetString = CreateObject("AelitaEDM.EDMOctetString")
     
        '--- get object GUID as string value ---
        Call objOctetString.Set(DirObj.GUID)
        strObjectGUID = objOctetString.GetGuidString()
     
        '--- get domain controller fully-qualified domain name ---
        strDomainControllerFQDN = GetParameter("LdapServer", Request)
     
        '--- Excahnge 2007 commandlet name ---
        strShellCommand = "Set-Mailbox"
     
        '--- add the first argument ---
        If (Not IsEmpty(strArgument1)) Then
           strShellCommand = strShellCommand & " -Argument1 " & strArgument1
        End If
     
        '--- add the second argument ---
        If (Not IsEmpty(strArgument2)) Then
           strShellCommand = strShellCommand & " -Argument2 " & strArgument2
        End If
     
        '--- add the rest arguments ---
        strShellCommand = strShellCommand & _
            " -Identity " & strObjectGUID & _
            " -DomainController " & strDomainControllerFQDN
     
        '--- execute a command and get a return code --- 
        numReturnCode = ExecutePowerShellCmdlet(strShellCommand)
     
        '--- numReturnCode = 0 means that the command was executed successfully ---
        '--- otherwise, it was failed ---
    End Sub	
    


    "Sadly most places want the Porche fastness and reliablity, but only pay for a used 74 pinto, then they are "Shocked" that it wont run, and blame the IT guy"
    Wednesday, November 16, 2011 4:33 PM
  • Hi,

    Sorry, I don't use Excel or Exchange, so I'm not going to be much help with this question. Your last post said, "What about this?" So I am confused: Is this question answered or not?

    Bill

    Wednesday, November 30, 2011 10:15 PM
    Moderator