We create PoweShell script to perform specific activity such as Getting mailboxes count , Exchange Database size or Free disk space in the servers.

We used to manually run this script to get output results.

Is it possible to run such script automatically in the schedule time ?

Yes , It is possible , it just need some more steps … .

I will outline here …

Step1 : Create PowerShell with your requirements.

Step 2 : Create Windows Batch file to run this PowerShell script.

  1. Open the Notepad and type the below lines

    Powershell -command “&{<Your powershell script path>}”

    Example :

    Powershell -command “&{C:\Scripts\DB-Report\DB-Report-Automate.ps1}”

  1. Save the Notepad as *.Bat file
  1. Schedule the Batch file to run automatically using windows Task Scheduler.

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