Office 365 power shell.

avatar

Not sure if anybody can help here but.

to add full mailbox and send as permissions for Exchange in O365 you need to use PowerShell.
the commands are.

This logs you on to the O365 server
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$LiveCred = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
Import-PSSession $Session
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Then these commands ad the permissions.
Add-MailboxPermission sam@vaughandata.co.uk -User joe@vaughandata.co.uk -AccessRights FullAccess

Add-MailboxPermission sam@vaughandata.co.uk -User joe@vaughandata.co.uk -AccessRights sendas
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
can I make a set of commands available in rdm???

Thanks James.

All Comments (6)

avatar

I'm not sure I understand. What do you want from RDM?

David Hervieux

avatar

I'm not sure I understand. What do you want from RDM?

David Hervieux

avatar

I need to be able to run the commands from RDM. I cannot link to a ps1 as most pc block running scripts.

im sure its simple but not sure how to do it.

avatar

Have you tried to create a Macro/Script/Tool and select PowerShell?

David Hervieux

avatar

yes I have played about but I need to run the lines separate. eg.
$LiveCred = Get-Credential
then asked for credentials

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
Import-PSSession $Session

then I need to type the commands I want.

but I want the two above commands to run as the user clicks the connector in RDM :)

avatar

I think that you can write one power shell and maybe prompt for parameters:

http://stackoverflow.com/questions/8184167/how-to-prompt-for-input-in-powershell

David Hervieux