Quick PowerShell Stuff

Today’s post is on some quick Powershell commands I’ve used in various Exchange 2010 environments. 

Let’s say you need to verify what IPs you are allowing to relay through your server. First, get a list all your connectors and pick one that you want to verify the settings for:

get-receiveconnector

Identity Bindings Enabled
——– ——– ——-
Server01\Default Server01 0.0.0.0:2525, 0.0.0.0:25} TRUE
Server01\Client Server01 {:::587, 0.0.0.0:587} TRUE
Server01\Application {0.0.0.0:25} TRUE

Once you have the connectors listed, copy the name into the below command.

$ReceiveConnector = get-receiveconnector Server01\Application; $ReceiveConnector.remoteipranges |ft lowerbound,upperbound,netmask -autosize

LowerBound UpperBound Netmask
——– ——– ——–
192.168.1.217 192.168.1.217  
192.168.1.150 192.168.1.150  
192.168.1.1 192.168.1.1  
192.168.1.111 192.168.1.111  
192.168.1.251 192.168.1.251  
192.168.1.24 192.168.1.24  
192.168.1.218 192.168.1.218  
192.168.1.210 192.168.1.210  
192.168.1.202 192.168.1.202  

Now you have a list of your allowed IPs.

Another sample script I have used is to check the status of various services on a server.  This is a small example from an Exchange server I recently ran it on:

get-service msexchan*,w3s*,iis* |ft Displayname,status -auto
 

DisplayName Status
————— ‘—————
IIS Admin Service Running
Microsoft Exchange Address Book Running
Microsoft Exchange Active Directory Topology Running
Microsoft Exchange Anti-spam Update Running
Microsoft Exchange EdgeSync Running
Microsoft Exchange Forms-Based Authentication service Running
Microsoft Exchange File Distribution Running
Microsoft Exchange IMAP4 Running
Microsoft Exchange Information Store Running
Microsoft Exchange Mailbox Assistants Running
Microsoft Exchange Mailbox Replication Running
Microsoft Exchange Mail Submission Running
Microsoft Exchange Monitoring Stopped
Microsoft Exchange POP3 Running
Microsoft Exchange Protected Service Host Running
Microsoft Exchange Replication Running
Microsoft Exchange RPC Client Access Running
Microsoft Exchange System Attendant Running
Microsoft Exchange Search Indexer Running
Microsoft Exchange Service Host Running
Microsoft Exchange Throttling Running
Microsoft Exchange Transport Running
Microsoft Exchange Transport Log Search Running
World Wide Web Publishing Service Running

You can add as many services as you want to this list.  Good for quick glances without have to look at the Services list in Computer Management.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s