Browsed by
Category: Windows PowerShell

Connecting to Azure with PowerShell and controlling your VMs

Connecting to Azure with PowerShell and controlling your VMs

I have a small lab setup within Azure and over the past week I have been working quite a bit within that lab perfecting a couple of PowerShell scripts.  As I have limited credits available to me within Azure I am always careful to ensure that my Virtual Machines (VMs) are only running when I need them and de-allocated when I am not using them.  Having to sign in to the Azure Portal to start the VMs and then do…

Read More Read More

Windows Server 2012 R2 Cluster Node issues

Windows Server 2012 R2 Cluster Node issues

I recently came across an error where nodes within a Windows Server 2012 R2 Cluster who stopped being active nodes within the cluster and continually cycled round trying to join again. We were seeing errors: Event 1070: Failover cluster nodes must have the ability to start the Cluster service, form a cluster (when a given node starts but no other nodes are up) and join a cluster (when a given node starts and discovers that one or more nodes are…

Read More Read More

Retention Policy Powershell Commands

Retention Policy Powershell Commands

I’ve recently been working on applying retention policies to mailboxes and we’ve been doing a granular roll-out to the users.  I’ve been using some Powershell commands to track who has the policy applied and who hasn’t. The following command will list all users who have a retention policy applied to their mailbox: Get-Mailbox -filter ‘RetentionPolicy -like “*”‘ | Select-Object Name, RetentionPolicy You can export that to a CSV if need be by using:  Get-Mailbox -filter ‘RetentionPolicy -like “*”‘ | Select-Object…

Read More Read More

Clearing out move requests

Clearing out move requests

When you perform a successful mailbox migration, either from another version of Exchange or from another mailbox database the move request is “left” behind as such and should be cleared out as part of good housekeeping. My favourite command for doing this is: Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

Unable to sync phone to Exchange

Unable to sync phone to Exchange

If you’ve been following my blog for the last few weeks you’ll have heard me talk about the Exchange 2013 migration project I’ve been working on.  Well we hit another snag in the migration the other day around the users mobile phones not syncing to the new mailbox server after moving to Exchange 2013. At first we thought it was just one or two users but it transpired that over 80 users were affected!! After investigating whether or not ActiveSync…

Read More Read More

Get Mailbox Move Progress

Get Mailbox Move Progress

I’ve recently been involved in an email migration from Exchange 2007 to Exchange 2013 and in order to monitor the progress of the mailbox moves I’ve been using Powershell commands, the two I’ve used are: Get-MoveRequestStatistics -MoveRequestQueue “Mailbox Database 1″| Sort PercentComplete This results in giving the Display Name, StatusDetail, TotalMailboxSize, TotalArchiveSize and PercentComplete of each mailbox move to that Exchange 2013 database. The other one that I’ve found useful is: Get-MoveRequestStatistics -MoveRequestQueue “Mailbox Database 1″| Where-Object {$_.StatusDetail -eq “Copying…

Read More Read More

Powershell Query to Analyze your Mailbox Movement

Powershell Query to Analyze your Mailbox Movement

I’ve recently been doing an Exchange 2007 to Exchange 2013 migration and wanted to find out the kind of speed the mailbox moves were taking.  I used the below Powershell script to pull out the MB transfer speed per minute: Get-MoveRequest | Where { $_.Status -eq “Completed” } | Get-MoveRequestStatistics | Select DisplayName,TotalMailboxSize,TotalMailboxItemCount,@{n=”Speed MB/min”; e={ [int]($_.BytesTransferred.ToMB() / $_.TotalInProgressDuration.TotalMinutes) }}

How to resolve the error ‘550 5.7.1 Unable to Relay’?

How to resolve the error ‘550 5.7.1 Unable to Relay’?

I recently came across an issue at work where one of our servers wasn’t able to send any email alerts out. On troubleshooting the issue we were receiving a ‘550 5.7.1 Unable to relay’ error message. Duly checked the receive connectors within the Exchange Management GUI and everything looked okay but still the server wasn’t able to relay. On launching the Exchange Management Powershell console we ran the command: Get-ReceiveConnector “Receive Connector” | Get-ADPermission -User “NT AUTHORITYANONYMOUS LOGON” And noticed…

Read More Read More

Powershell Tip: Search for users with an Active Sync device

Powershell Tip: Search for users with an Active Sync device

The script below will search through a mailbox database and list the users that have Active Sync devices attached and list the type of device. ForEach ($mb in (Get-Mailbox -database DATABASENAME)) { Get-ActiveSyncDeviceStatistics -Mailbox $mb | Select @{Label=”Name”;Expression={$mb.Name}},DeviceType,DeviceOS,LastSuccessSync} Replace DATABASENAME with the name of the database you wish to query This script has been test on Exchange 2010 SP1 and Exchange 2010 SP3.

Powershell Tip: How many DIMMs are in a machine and utilised

Powershell Tip: How many DIMMs are in a machine and utilised

The following Powershell command will tell you the total amount of DIMM slots within a machine and what is currently installed within those slots, if anything. Just save it as a .PS1 file and when you run it you will be asked for the name of the machine you wish to query. If you wish to query your own PC just enter “localhost” as the name. $strComputer = Read-Host “Enter Computer Name”$colSlots = Get-WmiObject -Class “win32_PhysicalMemoryArray” -namespace “rootCIMV2” `-computerName $strComputer$colRAM…

Read More Read More

This website stores some user agent data. This data is used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to opt-out of any future tracking, a cookie will be set up in your browser to remember this choice for one year. I Agree, Deny
574