The Network Manager at Westminster School presents solutions to sticky problems...

Friday, 21 August 2015

Remote Routing Address Woes - A Hybrid Exchange Problem

So you have to have the Hybrid Exchange. You are better off with either all in, or all out, but Hybrid is an option. There are some problems with Hybrid and that's when you get the Remote Routing Address wrong. How do you change it?

You create a user in the On Premises Active Directory, and then you let it sync to the cloud. You set up your licensing and then you run Enable-RemoteMailbox which includes the -RemoteRoutingAddress option. Of course, if you get it wrong...

Exchange Online will not let you change it. Exchange On Premises refuses to recognize the option in Set-RemoteMailbox. So... you now have to delete the RemoteMailbax, which in turn deletes the user account, you have to... 

Well, no. See, the value is stored in AD under the value targetAddress. Change this and your problems are over.

Added a lot of users in one go? Have a lot to change? No fear:

Create a CSV file with two headings: email, remote

Under email add "userprincipalname=username@domain" This is your filter.
Under remote add "SMTP:username@domain.onmicrosoft.com" being the correct remote routing address in the correct format for the targetAddress value. Now, turn to powershell (run as administrator, of course):

Import-Module ActiveDirectory
new-psdrive -PSProvider activedirectory -Name Users -Root "AD:\OU=Users,DC=domain,DC=com"
Set-Location Users:
$users = import-csv c:\temp\users.csv
foreach ($user in $users) {
write-host $user.email
Set-ItemProperty -filter $user.email -path * -Name targetAddress -Value $user.remote
}

The write-host line is for comfort only. The Set-ItemProperty does not report back when run in a script.

Wednesday, 8 April 2015

When does Appendable not mean Appendable?

When you use Append Infinite in Backup Exec 2014...

When a media set is set to Append Infinite the media automatically becomes un-appendable. The work around is to apply a limited append period to the media set and your media becomes writeable for append jobs once more.

Remember also: Only the first tape in a media set can be appendable. If the job runs over to a second tape it will only try to overwrite it, not append to it.

Thursday, 26 March 2015

Displaying C# Dialogs in the 64bit SCCM Task Sequence

Task Sequence Variables are a powerful tool when deploying new Operating Systems with Task Sequences in System Center 2012 R2. With a Task Sequence Variable, stored on a collection, you can reduce the number of Task Sequences you maintain. Each action or group of actions can be executed based on what the content of a Task Sequence Variable is.

The next logical step to using Task Sequence Variables for existing systems is to use them for unknown computers. For that you need a user dialog box to appear at the start of the Task Sequence to allow the person building the new PC to select what options to include in the build. You might want to be very specific about the drivers you install, for example.

For a Task Sequence with a 32bit boot image Psexec.exe is perfect for launching a dialog in Session 0. Without the option to do this the dialog does not appear. The application will run but it cannot display a GUI without having been launched in the same session at the Task Sequence.

However, 32bit is a bit old in the tooth. Most sensible people are now switching to 64bit operating systems. Psexec.exe however is a purely 32bit application that will not run on a 64bit WinPE image because WinPE does not support Windows on Windows (WOW64.) There are instructions on Technet Blogs about how to write your own application, which you then have to go search out each step of the way.

I did this and found the path a bit harrowing. It's not for the feint hearted but it's doable. I managed to write it first time. To make the application specific to Task Sequences (and not exploitable for other uses) it is written in such a way that it is tied to the task sequence process and will otherwise fail. If you like you can download it from here.

To use it, add it and the dialog executable to a package. In the task sequence use a "Run Command Line" option. Specify the package and for the command-line use tslaunch.exe

This was built for .Net 4.5.1 and works with the Window 8.1 64bit WinPE image (6.3.9600.16384)

If you would like the source code, please contact me on Google+ and I'd be happy to oblige.