Exchange 2013 import multiple pst’s

Here is a simple loop with which you can go through you all mailboxes you have and restore/import a pst.

1 `foreach ($i in (Get-Mailbox)) { New-MailboxImportRequest -Mailbox $i -FilePath "\\Server\share\$($i.Name).pst"; -baditemlimit 50 -acceptlargedataloss ;while ((Get-MailboxImportRequest -mailbox $i | ? {$\_.Status -eq "Queued"; -or $\_.Status -eq "InProgress"})) { sleep 120 } }` 

#PST files must be named accordingly - Mailbox name e.g. John.Doe - John.Doe.pst

Monitoring Office 365 Mailbox size

############################################## #### Check Mailbox size Offce 365 ############ ############################################## $MailUser = $args[0] $MailPWD = $args[1] $SecureMailPWD = Convertto-SecureString –String $MailPWD –AsPlainText –force $mailCred = New-object System.Management.Automation.PSCredential $MailUser, $SecureMailPWD $To="your@email" $From="server123" $SMTPServer=$args[2] ############################################# #### Login Details for Office 365 ########### ############################################# $username = $args[3] $pwd = $args[4] $SecurePassword=Convertto-SecureString –String $pwd –AsPlainText –force $MyCredentials=New-object System.Management.Automation.PSCredential $username,$SecurePassword $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $MyCredentials -Authentication Basic -AllowRedirection ############################################# Import-PSSession $Session -DisableNameChecking | Out-Null $query = (Get-Mailbox -ResultSize Unlimited | where {$_. [Read More]

Check for Veeam Endpoint Backup

################################################################################################## ##### Icinga check for Veeam Enedpoint Backup. It does check of the last backup date. ##### ##### Accepted arguments are: BackupJobName and period of days for backup e.g a > b = fail:) ##### ################################################################################################## ################################################################################################## ##### Icinga check for Veeam Enedpoint Backup. It does check of the last backup date. ##### ##### Accepted arguments are: BackupJobName and period of days for backup e.g a > b = fail:) ##### ################################################################################################## asnp VeeamPSSnapin $name = $args[0] $period = $args[1] $job = Get-VBRBackup -Name $name $name = "'" + $name + "'" $status = $job. [Read More]

Nagios check_datastore

Check esxi datastore free space #!/usr/bin/python from pysphere import VIServer, VIProperty import sys ok = 160000 warn_value = 150000 crit_value = 100000 status = { 'OK' : 0 , 'WARNING' : 1, 'CRITICAL' : 2 , 'UNKNOWN' : 3} server = sys.argv[1] user = sys.argv[2] pwd = sys.argv[3] warn = False crit = False lowestFreeSpace = None s = VIServer() s.connect(server, user, pwd) for ds, name in s.get_datastores().items(): props = VIProperty(s, ds) freeSpace = props. [Read More]

Nagios check_esxi_snapshots

This script is using pySphere api for esxi and do loop through all vms and checks for snapshots. #!/usr/bin/python from pysphere import VIServer import sys ok = 0 warn = 1 crit = 2 status = { 'OK' : 0 , 'WARNING' : 1, 'CRITICAL' : 2 , 'UNKNOWN' : 3} server = sys.argv[1] user = sys.argv[2] pwd = sys.argv[3] s = VIServer() s.connect(server, user, pwd) names = "" result = s. [Read More]