External, PowerShell

PowerShell for Beginners (Part 13): PowerShell Remoting — SID-500.COM

I make no secret of it: Now we come to my favorite topic: PowerShell Remoting. I love it. I hope you’ll love it too. If you are a passionate Systems Engineer or Developer you’ll find a lot of tips and tricks in this part to make work life easier and more efficient. But first a […]

via PowerShell for Beginners (Part 13): PowerShell Remoting — SID-500.COM

Advertisements
External, PowerShell

PowerShell: Alert me when Disk Space is running low on my Windows Servers (E-Mail Notification) — SID-500.COM

Without any doubt, you should have an eye on the disk space of your servers. I’ve seen so many servers crashing due to dropping disk space over time, because of saving more and more files and data or because of Windows Updates. They were running Exchange, SQL, AD and all of them were important servers […]

via PowerShell: Alert me when Disk Space is running low on my Windows Servers (E-Mail Notification) — SID-500.COM

External, PowerShell

PowerShell Function: Testing the Default Gateway with Test-Gateway — SID-500.COM

Sometimes it could happen that your computer lost connection to other hosts or the internet. What is the first you should do? For example, you could try to reach other hosts or your default gateway. Sure, you could use the bottom up method by climbing up the ladder of the OSI Model and check your […]

via PowerShell Function: Testing the Default Gateway with Test-Gateway — SID-500.COM

PowerShell

Looping PowerShell Commands

While doing Exchange or Office 365 migration the best way to monitor migration progress is using powershell commands, but in order to do that you might have to keep entering the same commands repeatedly.

To get hands free below script can be used with appropriate time to repeat the command itself in loop.. e.g.

PS C:\WINDOWS\system32> while ($true)
>> {
>> Get-MigrationUser | where {($_.BatchID -eq "migration-users-batch1") -and ($_.Status -eq "Synced")} | measure-object
>> sleep -seconds (60*5)
>> }

..just change the third line with your powershell command and time (60 sec * 5 Minutes) required to repeat the command.. to end press CNTR + C.