Microsoft KMS licensing quick tips

From the cmd line run the following.

View Current Counts
cscript C:\windows\system32\slmgr.vbs /dlv all

Uninstall KMS
slmgr /upk

Convert client from MAK to KMS
slmgr /upk
slmgr /ipk <KMS Client Key>

Set KMS Server
slmgr /skms servername.fqdn.here

Recreate the NTFS change journal

Recently I have found a few machines having issues with their backup software. From the logs the NTFS  journal was missing.

Quick fix is to run this command substituting in your own drive letter.

fsutil usn createjournal m=2147483648 a=536870912 F:

Dynamic lists and mail migration in Exchange 2007

Just a couple of quick tips which have helped me recently. Unlike Exchange 2003, creating dynamic lists based on AD attributes has become a little more complicated. Granted there is a built in wizard which works for some basic queries but doesn’t have the fine grained control that I needed.

For example to create a dynamic mailing list which will contain all users who have been marked as being in say the Perth office. This refers to the office field which you can set through AD users and computers or via the Exchange console. To create this load your Exchange shell as admin and run the following.

New-DynamicDistributionGroup -Name ‘Perth Staff’ -OrganizationalUnit yourdomain.com.au/MyBusiness/Users/Staff’ -Alias ‘PerthStaff’ -RecipientFilter { (Office -eq ‘Perth’) }

To break it down you are limiting your search scope with the –OrganizationalUnit which improves performance by not having to search the entire tree when you don’t need to. The -Alias is self explanitory and the –RecipientFilter is simply what you are filtering on and in this case its the Office field and the fact it equals Perth.

This is just a simple dynamic list, check out the Microsoft page here http://technet.microsoft.com/en-us/library/aa996561(EXCHG.80).aspx for more advanced examples and options.

 

Mail migration between mailboxes has always been a bit of a pain. In the past Exmerge was the tool of choice however this is no longer needed come Exchange 2007. This could be useful for archiving mail out from one mailbox to another on different storage (Exchange 2010 has archiving built in which is much better) or you can even go to PST for maybe permanent archival to tape or optical media.

Make sure you have the latest service and you can simply run the export-mailbox tool via the Exchange shell.

export-mailbox –identity source.mailbox -includefolders "\Inbox" -MaxThreads 4 –TargetMailbox destination.mailbox -TargetFolder Archive

You can filter this further if needed but it’s relatively straight forward and will pull all the mail you specify out and put directly into the target mailbox without having to go to PST in between or use Outlook.

Good luck and have fun.

Howto generate Exchange 2007 certificates

By default Exchange uses a self signed certificate. If you are allowing external access its best practice to use a CA signed certificate either by your own internal CA or an external 3rd party trusted CA.

So to generate yourself a signing request open an Exchange shell as admin and run the following.

New-ExchangeCertificate -GenerateRequest -SubjectName “cn=remote.domain.com.au” -IncludeAcceptedDomains -DomainName additional.domain.com.au,internal.domain.com.au -IncludeAutoDiscover -Path c:\mycert.req

To break this command down, –GenerateRequest and –SubjectName are pretty straight forward and define the primary subject for the certificate. –IncludeAcceptedDomains tells it to add any other accepted domains to the certificate, useful if you accept mail for multiple domains. –DomainName is for additional domains you wish to specify, sometimes you may have a split internal and external domain so this would be used in that instance. And –IncludeAutoDiscover is one that gets forgotten but adds the autodiscover domain name to the certificate. If you do not include your autodiscover domain or the domain of the server it is on then you may get certificate errors when launching Outlook.

So now you have your certificate request, either plug it into your internal CA to get signed or pass this on to a 3rd party to get it signed by them. You should get a certificate file back and once you do simply run the following from your admin Exchange shell.

Import-ExchangeCertificate -Path C:\certnew.cer

Next step is to tell Exchange to use the certificate. Upon importing you should get the thumbprint of the certificate. With this you can enable the certificate by running the following and substituting the thumbprint.

Enable-ExchangeCertificate -Thumbprint THUMBPRINT -Services SMTP,POP,IMAP,IIS

One gotcha that I have seen a couple of times now is that the IIS/SMTP certs don’t stick. This presents itself after a reboot when suddenly its reverted back to the original certificate. In these cases I have found it necessary to re-run the command with just IIS and SMTP like below.

Enable-ExchangeCertificate -Thumbprint THUMBPRINT -Services SMTP,IIS

And that should be it, your certificate will take affect immediately and you should be good to go.

One last note, its worth keeping in mind that your paths may vary in terms of the OWA, OAB and Autodiscover paths and you should check to ensure that these are all correct. Domain name mismatch is pretty common which can create error messages which have the potential confuse users.

Howto remote restart ARD from SSH

If you have ever been working with an Apple server/desktop you will have come across ARD. It’s Apple Remote Desktop and it’s quite neat. But it’s sadly only for Mac. This means if your on another OS you need some other way to connect. Luckily ARD is really just VNC with some Apple Propriety addons so if enabled we can VNC straight to the machine, however it does have a few issues. One major problem is that ARD falls over quite a lot, especially if you use incorrect settings like the new experimental 2mbit mode within UltraVNC etc. So if you manage to crash ARD what you need to do is restart it and that can be a pain if the server is remote. As OSX shares many traits with other UNIX operating systems you can in most cases SSH in and restart the service, to do this simply run the command below and you should then be good to go.

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -stop

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -privs -all -restart -agent

Of course if you login as root you will not need to use the sudo part of the command.
And that’s it. Problem fixed!