I have created a simple script to run experfwiz remotely on all the exchange servers. Below steps can be done to accomplish this task.
First get all the servers and store them in a text file. Ensure that are no spaces between them.
Note: We need to download the experfwiz and have them on the remote machine from where we are executing this script.
Lets say if we are running this script on all the exchange servers remotely from one machine we will be prompted to answer yes or no after it enables the counters on each servers. So each and every time it would ask us an input before it starts collecting the data for all the counters.
In-order to avoid this input each and every-time for all the servers probably we can bypass this confirm switch parameter to yes so that no manual confirmation of (YES or NO) is not required from the admin side. We need to do small modification in the experfwiz script to avoid this input.
Follow the below steps to avoid this manual confirmation.
First download the experfwiz from the below technet link
https://experfwiz.codeplex.com/releases/view/135743
Open the ps1 file in notepad
Look for the value $answer = confirmAnswer
Change the above value from
$answer = confirmAnswer
to
$answer = “yes” as shown below
save the PS1 file in the computer where we are going to run experfwiz
Now copy the below script in notepad , save them in a ps1 file on the computer where we are going to run the experfwiz
*********************************************************************************
$server = Get-Content c:\servers.txt
foreach ($s in $server)
{.\experfwiz.ps1 -Server $s -duration 08:00:00 -interval 5 -filepath \\$s\c$\Logs}
**********************************************************************************
In my example i’m storing it as experfwiz.ps1
Then navigate to the drive and run this command and it will start to run experfwiz on all exchange servers
The above script will query all the servers we have in text file and will run experfwiz . After that it will store these perfmon logs in respective servers in the path c$ in a folder called logs.
To directly download the file as PS1 go to – https://gallery.technet.microsoft.com/Steps-to-run-Experfwiz-73f3d662
Thanks
Sathish Veerapandian
MVP – Exchange Server
Tagged: Exchange Servers
Leave a Reply