Thursday, October 06, 2011

Part I – Using VBA to create an Active Directory/Exch Email Account

This pre-install process is for Server/RDP (Windows Server 2003/2008 x64 bit) based
access where the IS/IT component is a generic Domain Admin account (“Admin”) for a
2003 Exchange Server connection. This is a necessity when creating the "bridge" to talk to an Exchange Server that also hosts Active Directory.

  • Requires the CDOEXM for Microsoft Exchange Server. If you are running Exchange 2003, download file from this website (it’s OK that it says for Vista – we can get around that)

Exchange 2010 users – there is a new download available here:

  • Unzip and move the ESMVISTA.EXE and ESMVISTA.MSI files to your
C:\Documents and Settings\Login_Name\My Documents folder

  • At a command line on the server, type the following to get past the Vista detection warning which comes with this .MSI package:
msiexec /i esmvista.msi /q

  • The files will install in the C:\Program Files(x86)\exchsrvr\bin folder. If running a 32-bit server – you are done.

  • For 64-bit server – Copy all DLLs from C:\Program Files(x86)\exchsrvr\bin to C:\Windows\syswow64\ DO NOT overwrite existing libraries!


  • Hand register your libraries at a command line
  • Regsvr32 c:\windows\syswow64\cdoexm.dll
  • Regsvr32 c:\windows\syswow64\exadmin.dl

Tuesday, October 04, 2011

Talking Server to Server in Powershell – Remote Scripting


First – let me say this is not just Server to Server but also Desktop/Laptop to Server –
wherever you have PS capabilities.

A couple of things have to be considered before you attempt to force script to run on a
remote machine:

1. You have permissions on the remote machine to run script

2. You have security permissions on the remote machine to make the changes
After that, it’s a simple line of code from the Powershell command line:

Invoke-Command –ComputerName MyComputerName –FilePath C:\FileLocation\MyFile.ps1


MyComputerName = Name of remote machine

C:\FileLocation\MyFile.ps1 = The local path of the PS file from the machine you a

Monday, October 03, 2011

Running Powershell Script without the Headache of Signing Scripts

Powershell can have a direct effect on Windows and therefore has some built in security.

This security can be a real PAIN IN THE BUTT when it comes to just wanting your
script to run.

You will see a warning :
File C:\scripts\test.ps1 cannot be loaded because the execution of
scripts is disabled on this system. Please see "gethelp about_signing" for more details.


Now, to create your own signature certificate is a headache all unto itself.

This is how you can get around it:

At a Powershell command line type: Get-ExecutionPolicy

Possible return values are: Restricted, Unrestricted, RemoteSigned, AllSigned, Bypass

To run Powershell script without a signature requirement, the Execution Policy must be
set to Bypass.

You could type Set-ExecutionPolicy bypass, but chances are it will squawk at that and
tell you that changes could not be made to the registry.

1. Login to the machine where your script will run. (If on a server, you may want to
use a domain account)

2. Open Powershell (Start/Accessories/WindowsPowershell)

3. Type at the command line:
Set-ExecutionPolicy –scope CurrentUser –executionpolicy bypass –force

This command allows you to force the Execution Policy to Bypass for any code the User wants to run.