Friday, June 6, 2008

New PowerShell Scriptomatic


For those of you who are familiar with the the WMI Scriptomatic tool (and those of you who aren't), check out this awesome new version for Windows PowerShell -- The PowerShell Scriptomatic!

This tool will have you writing PowerShell scripts like a pro with absolutely NO experience. Imagine the fun you'll have deleting all the user accounts in the domain without having to write a single line of code yourself! Well, errr, maybe that was a bad example.

Actually, this really is a great tool to use to create PowerShell scripts without having to know the classes and objects necessary to access. Just select the WMI namespace and WMI class to access, and the PowerShell Scriptomatic will generate the correct PowerShell code. Then use this code to experiment with or add to other snippets. Brilliant!
It's great for those new to PowerShell and seasoned veterans who are just plain lazy.

Labels: , , ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email

Tuesday, May 20, 2008

PowerShell on Windows Server 2008 Server Core!

Yes, it is possible.

No, it is not supported. Don't even ask...

Labels: ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email

Thursday, March 27, 2008

How to Change the Outgoing SMTP Port in Exchange 2007

By default, Exchange Server 2007 uses port 25 to send SMTP email using Send Connectors. On occasion you may be required to configure an Exchange Send Connector to use a different port - For example, TCP port 465 is commonly used for SMTP over SSL for secure SMTP communication using the SSL protocol. Configuring the port is not expoosed through the Exchange Management Console (EMC), it must be configured from the Exchange Management Shell (EMS).

To get a list of the Send Connector names configured in your organization, run:
Get-SendConnector

Here's the one-liner that configures a Send Connector to use port 465:
Set-SendConnector "Your SMTP Send Connector" -Port 465
If you're using a Microsoft Edge server, you will need to configure this from any server that is not running the Edge role. You will also need to wait for an EdgeSync operation or force it manually:
Start-EdgeSynchronization
No services need to be restarted for this change to go into effect.

Labels: , ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email

Friday, February 15, 2008

The Games have begun!

The Microsoft 2008 Scripting Games begin today!
Be sure to log in and download your Competitor’s Pack, review the events, take a look at the challenges and prizes.
Good luck!

Labels: , ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email

Wednesday, December 12, 2007

How to Tell Which Users Have an ActiveSync Partnership

It's always good to know who is using the technology we support. I have a customer who needed to know which users were utilizing Windows Mobile devices to access their Exchange servers.


Here's a one-liner PowerShell command that reports which users have ActiveSync partnerships configured in Exchange 2007:

Get-CASMailbox WHERE {$_.HasActiveSyncDevicePartnership} SELECT identity
In Exchange 2003, it's not quite that simple. The ActiveSync partnership is stored in a hidden folder within the user's Exchange mailbox. This folder can be exposed using mfcmapi (the Microsoft Exchange Server MAPI Editor).

Mailboxes do not have the hidden Microsoft-Server-ActiveSync folder by default. Once an ActiveSync partnership has been configured from the user's Windows Mobile device, the following folder structure is created under the Root Container:


Note that PocketPC may show as SmartPhone, depending on the device used.

While mfcmapi can view the Root Container structure for an individual maibox, this is not feasible for a multi-user enterprise. I contacted Microsoft PSS for a solution, but they said there was no way to do this programmatically. Fortunately, I found this excellent vbscript written by Glen Scales that does exactly what I was looking for.

Here's an example of the output that the script produces:

Viola! Just what the doctor ordered!

Labels: , , , ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email

Friday, September 7, 2007

Search results may take a long time to appear because Microsoft Search is unavailable


A colleague of mine ran into a problem during an Exchange 2003 / migration. When some of the users tried to search their mailboxes, they receive a message saying, "Search results may take a long time to appear because Microsoft Search is unavailable. Results will not include matches in the e-mail body." (See the example above, from OWA)
This will happen to all mailboxes on the same server if the Microsoft Exchange Search Indexer service is stopped, but in this case only some of the mailboxes on the same server were affected.

I tested the same thing on my home server and found the same results. I had migrated all my accounts from my Exchange 2003 server months ago. When I ran the Get-Mailbox Test-ExchangeSearch PowerShell command I found that all my mailboxes except one (a service account) came back as True (enabled).

The bad news is that there's no way to enable Exchange Search for an individual mailbox. However, the following PowerShell command worked for me to correct the problem:
ResetSearchIndex -Force -All
This command will stop the MSExchangeSearch service, remove the entire search database and restart the MSExchangeSearch service. The MSExchangeSearch will immediately begin crawling the database(s) and rebuild the index(s). It took about 3 minutes on my 550MB database in a VM. You can use Perfmon to watch the Full Crawl Mode Status counter in the MSExchange Search Indices performance object to monitor when it's done. The counter value will be 1 while it's rebuilding, 0 when it's done.

Usage for the ResetSearchIndex PowerShell command:

ResetSearchIndex.ps1 [-force] [] ...
-OR-
ResetSearchIndex.ps1 [-force] -all
-OR-
get-mailboxdatabase ResetSearchIndex.ps1 [-force]

Labels: , , ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email

Friday, June 22, 2007

Granting Full Mailbox Access in E2K7

Sometimes administrators need access to another user's mailbox (for example, resource mailboxes). The PowerShell one-liner for this is:
Add-MailboxPermission SF-Conference -AccessRights FullAccess -user admin1234
(where SF-Conference is the mailbox to assign rights to, and admin1234 is the user who gets the rights)

And here's a one-liner that will do the same to all users in the Exchange organization:

Get-Mailbox | Add-MailboxPermission -AccessRights FullAccess -user admin1234

Labels: ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email

Tuesday, April 17, 2007

Log into OWA 2007 with a Default Domain

Customers with Exchange in a single domain usually ask how to change OWA so users can log in using just a username instead of domain\username. This was problematic in Exchange 2003 because of the DS2MB background process, but simple to do in Exchange 2007.
  • Open Exchange Management Console
  • Expand Server Configuration
  • Select Client Access and click the Outlook Web Access tab
  • Select owa (Default Web Site) and click the Properties action
  • Click the Authentication tab
  • Under Use forms-based authentication, select User name only
  • Click Browse and select the domain name
  • Click OK
  • Run IISRESET /NOFORCE to restart IIS and enforce the change

Or, even easier using PowerShell:

Set-OWAVirtualDirectory -Identity "owa (default web site)" -LogonFormat username -DefaultDomain companyabc.com

Then run IISRESET /NOFORCE to restart IIS and enforce the change.

Note that this will automatically change the logon page to display the new logon requirements.

Labels: , ,


Subscribe to my feed   StumbleUpon Toolbar

Subscribe to The EXPTA {blog} by Email