Posts Tagged ‘Group Policy’


Hi All,

It has been a really busy time for me. However, I am very happy with life at the moment. Just recently I received a “Microsoft Community Contributor” award from Microsoft.


I know I have been a little quite the last little while. I have been busy doing a job that everyone loves (I wish there was a font for sarcasm). I have been VERY busy documenting my production environment including Hyper-V, Active Directory and Exchange. This is a long and tiresome process, however PowerShell has been a phenomenal help and I thought I would share a few bits of code from PowerShell that have made my life a little easier in this process.


A script to list all GPO in required Domain

Import-Module grouppolicy
#command to get all GPOS
get-gpo -all -Domain domainname

A script to backup all GPOs for said domain

Import-Module grouppolicy
#command to backup all GPOS
Backup-GPO -All -Domain domainname -Path filepath


A script to pull the IP address listed within a Receive Connector

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Support
Get-ReceiveConnector -Server <nameoripofHTServer>
Get-ReceiveConnector -Identity "<name of identity>" | Select-Object -ExpandProperty RemoteIPRanges


A script to pull the VMs being controlled by Virtual Machine manager and sort them by Host Name for easier documentation.

Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager
Get-VMMServer nameofvmmserver
Get-VM -VMMServer nameofvmmserver | Select-Object -Property Name, Owner, Description, HostName, OperatingSystem, CPUCount, Memory | Sort-Object -Property HostName

Really hope this helps some other people as well.

Follow me

facebook-small3222 twitter-small3222