Category Archives: Microsoft

All Microsoft Products (Exchange, SQL, Windows, Server)

Exchange 2010 Remove Mobile Device Error

Exchange 2010 environment fully patched. One user hit the 10 device threshold on Exchange activesync devices and IT was tasked with removing the association from that device.

Right-click on the user and manage mobile device. Attempt to remove the partnership (not remote wipe) and had an error:
The ActiveSyncDevice Cannot be Found.

Awesome.

Powershell to the rescue:
List all devices for an account
get-activesyncdevice -mailbox USERNAME | select DeviceID, Identity

List all details for those devices
get-activesyncdevicestatistics -mailbox USERNAME

Remove that activesync
Remove-ActiveSyncDevice -Identity $(Get-ActiveSyncDevice -Mailbox USERNAME | where {$_.DeviceId -like "DEVICEID"} | select Identity).identity

Apparently what happens is that when we decided to move all OU groups around (and memberships) Exchange doesn’t like that very much and forgets to update itself.
http://exchangeblog.pl/en/2013/01/exchange-2010-remove-mobile-device-error-the-activesyncdevice-cannot-be-found/

Add User Pictures to Active Directory, Exchange

Running Active Directory in 2003 mode (with 2x 2003 and 2x 2008 servers) and Exchange 2010 in DAG.

http://www.codetwo.com/blog/codetwo-active-directory-photos-1-1-2-new-fields-in-filters/

Ran through and installed the above executable, ran with my domain admin credentials, but I could not get the pictures to show up in Outlook no matter what I did.

Finally figured out it is an issue with the offline address book – rebuilt on the Exchange side and no dice. But deleted the cached folders on my local machine and it worked fine. There’s also a registry key to help out:

Close Outlook
Delete everything in C:\users\yourusername\appdata\microsoft\outlook\ofline address books\
Open Outlook
Profit

Registry key:
[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Cached Mode]
“DownloadOAB”=dword:00000000
Either create the key “Cached Mode” and then the 32bit dword “DownloadOAB” as 0 or save the above as a .reg file and then run that.

Clear MSSQL Log Files

So first of all I’m not a SQL expert. Secondly I don’t recommend performing this on a production system. Third, this actually won’t happen on a production system as long as you’re performing backups – and your backup solution supports MSSQL – and I hope if it *is* a production system that you are actually backing it up.

Open the SQL Management Studio
Connect using the windows authentication piece, OR your SA password

Run the following in the query window
DBCC sqlperf(logspace)

This will show you the name of the database and associated size of log files.

Assuming that the INSERTNAMEHERE database is the one eating through the space
USE INSERTNAMEHERE;
GO
ALTER DATABASE INSERTNAMEHERE
SET RECOVERY SIMPLE;
GO
DBCC SHRINKFILE (INSERTNAMEHERE, 1);
GO
ALTER DATABASE INSERTNAMEHERE
SET RECOVERY FULL;
GO

You can then run the logspace again and verify
DBCC sqlperf(logspace)

This all worked nicely on my development system that doesn’t require/have backups in place.

Delete Exchange Users Old Mail

I was tasked with deleting a service account users old mail. Our CRM Mailbox user had 29.5GB of old mail floating around that needed to be purged. Adding access to the account was a no-no (and would probably crash out Outlook for a while) due to company policies. Powershell to the rescue?

I should probably mention that this is on Exchange 2010 in a DAG (2 servers) with SP3 hotfix 4 applied. Yes, I also know hotfix 5 is available.

I attempted to run the following script:
Search-Mailbox -Identity SOMEUSERNAME -SearchQuery '(Received:01/01/2012..12/31/2012)' -Deletecontent -Force

And I was told that the “search-mailbox” command was not found. Great. Verified that I was using the Exchange Management Powershell instead of just Windows PS. True story.

After a lot of searching I realized that our former Exchange Admin wasn’t very good at PowerShell. The Admin Tasks Management Powershell add-in was not available.

Check Available PowerShell Snap-ins
Get-PSSnapin
Notice Exchange Server Admin Tasks is not available.

Verify that the plugin is available
Get-PSSnapin -registered

Add the snap-in
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

I ended up closing the powershell window and then re-opening it. My search mailbox and delete content commands now work!

Other commands I did:
Added my user to the Discovery Management role in the ECP (https://yourmailserver.tld/ecp)
Created two new groups to allow the import and export of mailboxes, and then the exchange support and diagnostics:
New-RoleGroup -Name "Exchange Mailbox Import Export" -Roles "Mailbox Import Export" -Members "domain\username" -DisplayName "Exchange Mailbox Import Export" -Description "This group handles permissions to the import and export commands in powershell."
New-RoleGroup -Name "Exchange Support and Diagnostics" -Roles "Support Diagnostics" -Members "domain\username" -DisplayName "Exchange Support Diagnostics" -Description "This group handles permissions to the support diagnostics cmdlets in exchange."

Windows 8 Startup Folder

Windows 8, well now 8.1, has a lot of changes to it. Took me a while to get used to it – on dual monitors or with a touch screen it’s pretty decent.

Anyway, I couldn’t find my startup folder easily. Windows 7/Vista you could hit start, then type in “startup” and away you go. Before that you could explore all users by right-clicking on start and then drill down to find your startup folder.

BTW, I know that the startup folder resides in the c:\users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ directory, but who wants to type out all that?

Win + R, “shell:startup”, enter

Install .NET 3.5 on Windows 8

We recently rolled out an image for Windows 8.1 for corporate use. Unfortunately some of the products that I use require .net 2.0+ to be installed. I remember from my Win7 days that I can simply go to Programs and Features, and then turn Windows features on or off, then select .net framework 3.5 (includes 2.0 and 3.0).

Unfortunately I was receiving the following error:

0x800f0906: “Windows couldn’t connect to the Internet to download necessary files. Make sure that you’re connected to the Internet, and click Retry to try again.”
0x800F081F: “The changes could not be completed. Please reboot your computer and try again.”

Dang. Work around (Thanks J3 and http://msdn.microsoft.com/en-us/library/hh506443(v=vs.110).aspx)

Mount the Windows Installation Image
Either pop in your windows 8.1 CD or double click on the ISO (running Windows 8+ allows you to mount ISO by double clicking, win7- needs some sort of ISO mounting kit)

Command Line Install
Open a command prompt with Admin credentials (run as admin if necessary)
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs

Explanation Of Arguments

/Online targets the operating system you’re running (instead of an offline Windows image).
/Enable-Feature /FeatureName:NetFx3 specifies that you want to enable the .NET Framework 3.5.
/All enables all parent features of the .NET Framework 3.5.
/LimitAccess prevents DISM from contacting Windows Update.
/Source specifies the location of the files needed to restore the feature (in this example, the D:\sources\sxs directory).

Chrome Resolving Host Slow Loading

Running Windows 7 Ent x64 fully patched. I noticed that chrome would take a while to open pages – even pages that I had already visited during the day – and I figured there was a problem with my system.

Windows updates had recently patched the system
McCrappy had been removed in favor of Kaspersky
Chrome had been updated to the latest version
Java/Flash/etc were already all up to date

Long story short, I disabled the Built-in Asynchronous DNS functionality of Chrome and noticed a substantial speed difference (gain).

Open a chrome window
navigate to chrome://flags
Find Built-in Asynchronous DNS (about halfway down the page)
Change to disable, and then restart the browser