Exchange 2019: How Many CALs/SALs Do You Need?

KB ID 0001703

Problem

At his point I’m going to assume you know that there are Standard Exchange CALs/SALs, and Enterprise Exchange CALs/SALs. And you know the difference! If you’re unsure see my comments here

With older versions of Exchange 2010/2007 etc. You could get this information from the GUI. Now you need to use some PowerShell.

Solution

The two commands you want to use are;

Find Out How Many Exchange Standard CALs / SALs Are Required

[box]

Get-ExchangeServerAccessLicenseUser -LicenseName (Get-ExchangeServerAccessLicense | ? {($_.UnitLabel -eq "CAL") -and ($_.LicenseName -like "*Standard*")}).licenseName | measure | select Count

[/box]

Find Out How Many Exchange Enterprise CALs / SALs Are Required

[box]

Get-ExchangeServerAccessLicenseUser -LicenseName (Get-ExchangeServerAccessLicense | ? {($_.UnitLabel -eq "CAL") -and ($_.LicenseName -like "*Enterprise*")}).licenseName | measure | select Count

[/box]

Sit back, light your pipe, and admire your handiwork!

What About CALS for Exchange 2010?

That you can get from the EMC (if it says Unknown click the option to refresh at the bottom).

Related Articles, References, Credits, or External Links

NA

Add The ‘Group Policy Management Console’

KB ID 0001615

Problem

On a Domain Controller you will get Group Policy Management, (by default) listed under administrative tools. But if you have a ‘Management Server‘ of a ‘Jump Box‘, that you want to install the tool onto, (without making it a domain controller!) Then do the following;

Option 1: Install GPMC with Powershell

This is the quickest and simplest option! Open a PowerShell Windows and execute the following command;

[box]

Install-WindowsFeature –Name GPMC

[/box]

 

Note: For older, (Windows Server 2012 and older) servers use the following commands instead.

[box]

Import-Module servermanager
Add-WindowsFeature –Name GPMC

[/box]

Option 2: Install GPMC with Add Roles and Features

From Server Manager > Manage > Add Roles And Features > Proceed to ‘Features‘ > Select Group Policy Management > Next > Finish.

Related Articles, References, Credits, or External Links

NA

Windows Server: Stop Programs Auto Starting / Auto Running

KB ID 0001600

Problem

I like to learn the keyboard shortcuts for these sort of things, (because developers will change the way things are done in the GUI). So in the good old days I simply ran msconfig, and located the offending software on the startup list and disabled it. Then that got removed and put in ‘Task Manager’, then that got removed. So I’m pulling a frowny face at Microsoft Developers for their lack of continuity 🙁 (It’s not just them Cisco and VMware are just as bad!) 

I’ve got an administration server I use, (Server 2016,) and it’s got a load of software on there that usually would not be on a server, Skype Client, Citrix Client etc. So how do I stop them autoloading?

Solution

Well I could start digging around in the registry manually, but a much simpler option is to download and run AutoRuns;

Either untick the offender or right click and go to the source and manually disable it yourself.

Related Articles, References, Credits, or External Links

Massive thanks to Syinternals and Mark Russinovich, who has been bailing me out of the mire for many years!

HP Intelligent Provisioning Cant See USB Media?

KB ID 0001555

Problem

Life was simpler when we had DVD Drives and a wallet full of CD/DVDs! I was building an HP DL360 This morning and needed to install Windows. I created a bootable USB with Unetbootin and selected a Windows Server ISO, it wouldn’t boot. So I thought ‘Fine I’ll play the game” I pressed F10 for Intelligent Provisioning.

After selecting USB media – the system could not see my USB Drive? 

After a couple of seconds head scrathing the penny dropped, it wants the iso not a bootable drive, (doofus!) So I used a FAT formatted USB and that didn’t work either?

Option 1: Use iLO

Before you all start emailing me, you can install an operating system from virtual media WITHOUT and advanced iLO licence! Annoyingly I was building the server on the bench, so I had to connect my laptop into the iLO with a crossover cable but, here’s me proving it works.

Option 2: Use ExFAT

Format your USB drive using ExFAT, luckily I use macOS and Disk Utility will format a drive using ExFAT for me.

Note: Windows will also format as ExFAT 🙂

Then simply put your install .iSO file(s) on the media.

Now you can see your install media.

Option 3: Use the HP Media Creator

I didn’t try this option, but feel free to download it and give it a try, comment below to let me know how you get on.

HP USB Key Utility for Windows v3.0.0

Related Articles, References, Credits, or External Links

NA

ADFS Test Page Error

KB ID 0001545

Problem

I was setting up ADFS in Server 2019 today, and once I have all the basics setup, I like to got to, https://{server-fqdn}/adfs/ls/IdpInitiatedSignon to test, but this happened;

The resource you are trying to access is not available. Contact your administrator for more information.

Error details
.Activity ID: 3c53140c-cff3-4b59-0900-0080010000d4
.Error details: MSIS7012: An error occurred while processing the request. Contact your administrator for details.
.Node name: 8d53ee58-2a75-42c1-ac37-88c7bc00ce97
.Error time: Thu, 02 May 2019 12:35:56 GMT
.Cookie: enabled
.User agent string: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko

Solution

At first I though I’d broken something or forgotten to tick a tick box! But it seems this was turned off in Server 2016. You need to enable it on the ADFS server.

Execure the following command;

[box]

Set-AdfsProperties -EnableIdpInitiatedSignonpage $True

[/box]

 

Then retry, and it should look a bit healthier

 

Related Articles, References, Credits, or External Links

NA

PowerShell: Bulk Enable / Disable Users

KB ID 0001469

Problem

I needed to work out how to bulk disable some domain users from a .CSV file this week, so I thought I’d write it up.

Disable Domain Users in Bulk from CSV

Well firstly, you need to have your users in a CSV file. For the live job I just exported all the SamAccountNames to a CSV, but here for testing I just loaded a few in manually;

Then execute the following two commands;

[box]

Import-Module ActiveDirectory 

Import-Csv -Path "C:\Temp\Users-To-Disable.csv" | ForEach-Object {Set-ADUser -Identity $_.’User-Name’ -Enabled $false}

[/box]

Let’s have a quick check, and sure enough they are disabled.

Enable Domain Users in Bulk from CSV

To re-enable them, we just need to change one word in the command, (from false to true).

[box]

Import-Module ActiveDirectory 

Import-Csv -Path "C:\Temp\Users-To-Enable.csv" | ForEach-Object {Set-ADUser -Identity $_.’User-Name’ -Enabled $true}

[/box]

A quick refresh and our users are enabled again!

Related Articles, References, Credits, or External Links

NA

Scheduled Task Error 0x1

KB ID 0001457

Problem

While replacing a server, I copied over some scripts, (batch files) the client was using to back up some data. I scheduled them on the new server, but noticed they were finishing with a status of 0x1. (and not actually backing anything up!)

Solution

Edit the properties of the job > General Tab > Tick “Run with the highest privileges”.

Note: You can also tick “Do not store password. This task will only have access to local computer resources” if the process is only running on this machine.

Actions > Select the Action and edit it > Change the ‘Start In‘ section, so that it points to the folder the script is in > OK >Apply > OK.

Rerun the job and it should complete with a 0x0 status (successful).

Related Articles, References, Credits, or External Links

NA

Exchange: PowerShell Commands

KB ID 0001405

Problem

This might seem like an odd title for an article here at PNL? But I’m going to use this page as a place to put all the commands I’m sick of Googling for, and/or working out every time I do an Exchange job.

So as with all the posts here, it’s here for my benefit, and if anyone else gets something from it great!

Exchange General

Change Exchange Licence Code

[box]Set-ExchangeServer -Identity Server-Name -ProductKey 12345-12345-12345-12345-12345[/box]

Exchange Mailboxes

How Many Mailboxes Per Database?

[box]Get-Mailbox | Group-Object -Property:Database | Select-Object Name,Count | Sort-Object Name | Format-Table -Auto[/box]

 

Exchange Mailbox Migrations

Migrate a Single Mailbox

[box]New-MoveRequest -Identity “Fred Bloggs” -TargetDatabase “Destination-DB” -BatchName “Fred Bloggs” -BadItemLimit “200” -AcceptLargeDataLoss[/box]

Migrate ALL Mailboxes in one Database to Another

[box]Get-Mailbox -Database “Source-DB” ” -ResultSize Unlimited | New-MoveRequest -TargetDatabase “Destination-DB”[/box]

Display Mailbox Migration Progress

[box]Get-moverequest | get-moverequeststatistics

OR

Get-moverequest -MoveStatus InProgress

Get-moverequest -MoveStatus Failed

Get-moverequest -MoveStatus Queued

[/box]

Remove Mailbox Move Requests

[box]Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest[/box]

Exchange Databases

List All Mailboxes in a Database

[box]Get-Mailbox -Database “Database Name“[/box]

Create a Mailbox Database 

[box]New-MailboxDatabase -Name Database-Name -EdbFilePath X:\Folder\Database\Database-Name.edb -LogFolderPath X:\Folder\Log-Folder\[/box]

Show Database (and Log File) Locations

[box]Get-MailboxDatabase -Status | select EdbFilePath
Get-MailboxDatabase -Status | select LogFolderPath[/box]

Move a Database (and Log Files)

[box]Move-DatabasePath -Identity Database-Name -EdbFilePath X:\Folder\Database\Database-Name.edb
Move-DatabasePath -Identity Database-Name -LogFolderPath X:\Folder\Log-Folder\[/box]

Show Mailbox Database ‘Whitespace’

[box]Get-MailboxDatabase -Status | select Name,DatabaseSize,AvailableNewMailboxSpace[/box]

Users and Groups

Exchange Create a Distribution Group

[box]New-DistributionGroup -Name “DG-All-Users” -Type “Security”[/box]

Exchange Add All Users (In an OU) to a Distribution Group

[box]Get-Mailbox -OrganizationalUnit “cn=users,dc=petenetlive,dc=com” -resultsize unlimited|ForEach-Object { Add-DistributionGroupMember -Identity “DG-All-Users” -Member $_ }[/box]

 

Related Articles, References, Credits, or External Links

NA

Hyper-V Creating a NAT Network and vSwitch

KB ID 0001384

Problem

I’m without access to all my test equipment at the moment, so when I needed to do some testing, I thought I’d use Hyper-V on my new work laptop. I needed to ‘knock up’ a quick vSwitch that would NAT my test machines, to my laptops connected NIC.

Solution

Open an administrative PowerShell window, and execute the following three commands. Note: You can change the values in RED to suit your own requirements, or leave them as they are to copy my network setup.

[box]

New-VMSwitch -SwitchName "NAT-Switch" -SwitchType Internal

New-NetIPAddress -IPAddress 192.168.200.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NAT-Switch)"

New-NetNAT -Name "NAT-Network" -InternalIPInterfaceAddressPrefix 192.168.200.0/24

[/box]

As far as Hyper-V is concerned that’s it! Now simply connect your virtual machines to the new switch.

Remember you have a NAT switch, it’s not doing DHCP, you will need to assign your virtual machines static IP addresses, though you can of course configure a DHCP server on one of your virtual machines.

 

Related Articles, References, Credits, or External Links

NA