Windows Server 2012 IPAM Error: Unblock IPAM Access

Received the following error when attempting to provision a server to be managed by IPAM:

Unblock IPAM Access


Firewall? Nope
Network Connectivity? Yep

Since IPAM is applied through Group Policy I thought to run “gpresult /r” and lo-and-behold the policies were not being applied to the server due to security filtering. Somehow the automated provisioning task failed to add this server to policies security filter. Added the computer object to the filter and now IPAM is working.

Powershell Web Access Authorization error

Received this error on my initial attempt after setup of Powershell Web Access (pswa).

An authorization failure occurred. Verify that you are authorized to connect to the destination computer.pswaerror


The documentation is clear that there are no authorization rules on the “out-of-the-box” install of PSWA and so you have to use the Add-PswaAuthorizationRule cmdlet. Which I did and it still wasn’t working.

Small gotcha that isn’t so clear from the documentation:

You must set the -configuration name parameter as microsoft.powershell. You can’t just use any name you want.

Add-PswaAuthorizationRule -UserName "domain\john.doe" `
-ComputerName * -ConfigurationName microsoft.powershell

Well technically you can use any configuration name you want, you just have to specify that name when you try to log in to PSWA to replace the pre-filled value in the form. So just set the configuration name to microsoft.powershell and save yourself the headache.




Powershell Remove Non-Routable proxyaddresses for mailbox migration to Exchange Online

When doing a migration from onrem to Exchange Online / Office 365, the proxy addresses on the mail object must all be internet routable. If you have aliases like @domain.local, these need to be removed before the mailbox can be moved.

I used this powershell script to accomplish this in my environment:


Remove nonroutable smtp aliases in preparation for mailbox migration
Long description
remove-nonRoutableSmtpAddresses -Searchbase "OU=OrgUnit,DC=Domain,DC=com" -smtpsuffix "nonroutable.domain" -Verbose
function remove-nonRoutableSmtpAddresses
# Search base of users to search for

# SMTP suffix to find and remove

$smtpsuffix = ("*" + $smtpsuffix + "*")
$users = get-aduser -Filter {proxyaddresses -like $smtpsuffix} -Properties proxyaddresses -SearchBase $Searchbase
foreach ($u in $users){
Get-ADUser $u -Properties proxyaddresses `
| foreach {$pr = $_.proxyaddresses -like $smtpsuffix}
set-aduser $u -Remove @{proxyaddresses=$pr} -verbose

Powershell Get List of Domain Contollers

Simple is better. And this is by far the simplest way I have found to get a cleanly formatted list of domain controllers in a domain:

Encase the get-addomain cmdlet in parentheses and call the property replicadirectoryservers.


PS C:\DEV> (Get-ADDomain domain.local).ReplicaDirectoryServers


Powershell Monitor Job Status

This is the framework for a basic monitoring of a PowerShell job.

The basic steps are to store the current jobs in to a variable named $jobs. Loop through the variable and increment $jobcount if the state of the job does not equal “Completed”. The script keeps looping until $jobcount is 0.

Lines 11 and 12 are merely demonstrative. You could put anything here you want…

   $jobcount = 0
   $jobs = Get-Job
   foreach ($job in $jobs)
    if ($job.state -ne &quot;Completed&quot;){
   Write-Verbose "Active jobs: $jobcount"
   Start-Sleep -Seconds 5
until ($jobcount -lt 1)

New-ManagementRole in Exchange Online Powershell

Try as I could, I could not get the powershell command in this technet article to work in Exchange online:

The article cleverly suggests that to create a custom management role, you create a new role and then just strip out the commands you don’t want by filtering out certain commands and removing the rest. This worked fine in my on premise Exchange 2013 environment, but try as I could, it would not work in EOP.

Get-ManagementRoleEntry "Redmond Journaling View-Only\*" | `
Where { $_.Name -NotLike "Get*" } | `

Attempting this command in Exchange Online you get the following:

PS C:\> Get-ManagementRoleEntry "Redmond Journaling View-Only\*" | `
Where { $_.Name -NotLike "Get*" } | `
Remove-ManagementRoleEntry -WhatIf

Cannot process argument transformation on parameter 'Identity'. Cannot convert value "Redmond Journaling View-Only" to type

get-managementroleentry error

The problem seems to be with the identity parameter.

Long story short, I was able to use a foreach loop to do the same thing in Exchange Online.

$rolename = “Delegated Admin Transport Hygiene”
$excludeterm = "*quarantine*"

New-ManagementRole -Name $rolename -Parent “Transport Hygiene”

$role = Get-ManagementRoleEntry ($rolename + “\*”) | `
Where { $_.Name -NotLike $excludeterm `
-and $ -notlike "*SenderAddress*"}

foreach ($r in $role){
Remove-ManagementRoleEntry ($rolename + "\" + $r.Name) `