23-10-23 01:03 PM
Hi,
How do I format my script that I have to run within the Powershell object?
I have one data item I wish to use [User Logon Name] and this needs to be used in the script to generate the Remote Mailbox, and set a locale.
I'm not sure how to format the code to ensure that it works and what needs to wrap around the [User Logon Name].
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://EXCH-01/PowerShell/
Import-PSSession $Session -AllowClobber -DisableNameChecking | Out-Null
Set-ADServerSettings -ViewEntireForest $true
cls
Enable-RemoteMailbox -Identity [User Logon Name] -Alias [User Logon Name] -RemoteRoutingAddress "[User Logon Name]@domain.mail.onmicrosoft.com"
Set-ADUser -identity [User Logon Name] -replace @{ 'preferredlanguage' = 'en-GB'}
Remove-PSSession $Session
Thanks, Chris
26-10-23 03:48 PM
Hello @Chris Brown!
How are you getting on with this? I'm going to move your question over to the Digital Exchange Community as the Powershell VBO is supported primarily through that space. I'll also bump it to the top for you to see if we can get some of our code pros on the case.
Good question!
27-10-23 01:39 PM
Find and replace your variables before you run the script?
Simple Example