0

I remember reading about how it's possible to add scripts or commandlets to Exchange 2010... in a way that as soon as Powershell imports the remote commands, your custom command is available as well.

My thought is that I'll use Exchange's roles to allow constrained / elevated access to certain functionality thought this technique.

Does anyone know the name of the thing Im thinking of?

makerofthings7
  • 8,821
  • 28
  • 115
  • 196

3 Answers3

2

What you want to do is create a custom Powershell module. Start here for the official MS documentation, but there are plenty of other tutorials available online. There is also a book called Professional Windows Powershell Programming that covers development of custom cmdlets and modules. It dives deep into the .NET level. Haven't read it myself so can't make a recommendation.

Matt
  • 1,883
  • 5
  • 26
  • 39
  • hmm... that isn't exactly what I was thinking of. There is integration with Exchange "Roles" feature, and powershell that I'm still trying to find. – makerofthings7 Feb 12 '12 at 20:52
1

Sounds more like you wan't to load the Exchange module into your PowerShell Profile, as covered by Mike Pfeiffer right here. Then you would also be able to load in your own custom functions/cmdlets, modules, aliases and so on when the PowerShell Console starts up

I'm not sure I quite understand what you mean by Exchange "Roles", but if you are thinking about the management access control features introduced in Exchange Server 2010, read the official documentation on RBAC in Exchange 2010

This is not something you configure in the PowerShell console itself, you just use the EMS cmdlets to configure which management Roles specific users have and what privileges they have.

Mathias R. Jessen
  • 24,907
  • 4
  • 62
  • 95
1

This Technet article describes the process of making a PS1 script available to every computer that loads the Exchange runspace, even if the PS1 isn't installed on that PC.

Here are the general steps needed to publish your custom PS1 to the company:

  • On the Exchange server, move the script into C:\Program Files\Microsoft\Exchange Server\V14\Scripts

  • Then, create an unscoped top-level role

  • Add a management role entry to that role such as:

    Add-ManagementRoleEntry "IT Scripts\BulkProvisionUsers.ps1" -Parameters Name, Location -Type Script -UnscopedTopLevel

  • Finally You need to ensure that the cmdlet is available on all exchange servers the powershell instance may connect to.

makerofthings7
  • 8,821
  • 28
  • 115
  • 196