“Object reference not set to an instance of an object” error when running Microsoft Online Powershell Commands
This error has stumped me for the past couple weeks so I had to write a post when I finally figured it out. Here’s the basic scenario. You install the Microsoft Online Migration Tools on a server and when someone logs into the server and issues any of the Microsoft Online PowerShell commands, they get an error which states:
Object reference not set to an instance of an object
After much trial and error I was able to figure out this error is caused by the Internet Explorer settings. It appears you have to configure Internet Explorer before you can run the Microsoft Online PowerShell commands. In my cases, the users that couldn’t run the commands were users who had logged into the server for the time, and thus IE was not configured. The fix was to open IE and run through the configuration wizard.
If simply opening IE and configuring the settings doesn’t work for you, you can try these steps to reset the IE configuration:
To use the Reset Internet Explorer Settings feature from Control Panel, follow these steps:
1. Exit all programs, including Internet Explorer (if it is running).
2. If you use Windows XP, click Start, and then click Run. Type the following command in the Open box, and then press ENTER:
The Internet Options dialog box appears.
3. Click the Advanced tab.
4. Under Reset Internet Explorer settings, click Reset. Then click Reset again.
5. When Internet Explorer finishes resetting the settings, click Close in the Reset Internet Explorer Settings dialog box.
6. Start Internet Explorer again.
Then, if it’s still not working:
1. Right Click on the Command Prompt Shortcut on the Start Menu and Choose Run As Administrator.
2. In the Command Prompt window, enter this text and press Enter:
3. Restart your computer.