How to check free disk size on remote computers using Windows Powershell

Heres the command:

Get-WmiObject -Computer Comp1 -Query “Select * from win32_logicaldisk” | ForEach-Object {$_.deviceid, [math]::truncate($_.freespace / 1MB)}

-Eric

How to Enable Anti-Spam Functionality on a Hub Transport Server

Let’s say your company is small or midsize business and you don’t have enough resources to set up the secondary Exchange 2007 server with Edge Transport role. There is a way how to enable anti-spam options on a server that has Hub Transport role installed. To do this, first you need to check that your account has proper permissions. Now if you got the permissions, here’s the script you need to run Install-AntispamAgents.ps1. This script is located here:
%system drive%/Program Files\Microsoft\Exchange Server\Scripts, and you must run it from that folder. To run this script use the following command:

./Install-AntispamAgents.ps1

After the script has run restart the MS Exchange Transport service. You can do it with this command:

Restart-Service MSExchangeTransport

One more thing, All the commands mentioned above are meant to be run in Exchange Management Shell. So if you got MS Exchange 2007 installed on Windows Server 2008 and both Windows Powershell and Exchange Management Shell then use the last one to run these commands.

If you want to read more about it then here’s the link from technet.

-Eric

Installing Exchange 2007 SP1 Prerequisites on Windows Server 2008 and Windows Vista

If you plan to deploy Microsoft Exchange 2007 to your company’s infrastructure and you plan to use Windows Server 2008 as operating system, then there are some prerequisites you need to sort out. First you need to install Active Directory Domain Services remote management tools. That’s before preparing the schema or Active Directory. You can use this command to do it:

ServerManagerCmd -i RSAT-ADDS

The information how to prepare Active Directory or Domains you can get from here. Now it depends what kind of roles do you plan to install on your Exchange 2007 server, but if you are doing a fresh install and you don’t have any Exchange Servers deployed previously then here’s what you need to install. It applies to all roles except Edge Transport server which you can’t deploy together with other roles. So the prerequisites you need to install on the computer that will host the Hub Transport, Client Access, Unified Messaging, Mailbox Server and Exchange Management tools roles:

1. First you need to install Windows PowerShell: ServerManagerCmd -i PowerShell
2. Second you need to install IIS: ServerManagerCmd -i Web-Server
ServerManagerCmd -i Web-ISAPI-Ext
ServerManagerCmd -i Web-Metabase
ServerManagerCMd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Basic-Auth
ServerManagerCmd -i Web-Digest-Auth
ServerManagerCmd -i Web-Windows-Auth
ServerManagerCmd -i Web-Dyn-Compression

And for unified messaging the desktop experience:
ServerManagerCmd -i Desktop-Experience
3. If the mailbox server fill be clustered then you need to install Failover Clustering with this command: ServerManagerCmd -i Failover-Clustering. But then bare in mind that you cannot install any other roles.
4. If you plan to use this server as a host for Outlook Anywhere then you need install the RPC over HTTP proxy feature: ServerManagerCmd -i RPC-over-HTTP-proxy
5. Don’t worry about Exchange Managemnt tools, previous requisites will apply on it as well. Though you will need only 3 things to run Management tools, which are Windows Powershell plus a couple of IIS features. I will list them here:
First Powershell install command: ServerManagerCmd -i PowerShell
Second IIS install commands: ServerManagerCmd -i Web-Metabase; ServerManagerCmd -i Lgcy-Mgmt-Console.

Now to install Edge Transport role on the server, here is the prerequisites you need to install:

1. Install Powershell with this command: ServerManagerCmd -i PowerShell
2. And install Active Directory Lightweight Directory Services with this Command: ServerManagerCmd -i ADLDS

And to install Exchange Management Tools on Windows Vista here’s what you need to do first:

1. Download and install Windows Powershell. You can get it from here.
2. Then go to Control Panel and open Programs and Features.
3. From the Tasks area click on Turn Windows Features on or off.
4. Find Internet Information Services -> Web Management Tools -> IIS 6 Management Compatibility and select IIS 6 Management Console, IIS 6 Metabase and IIS 6 configuration compatibility and click ok.

PS! All the server manager commands are run in Command Prompt.

-Eric

Follow

Get every new post delivered to your Inbox.