Posts Tagged ‘Active Directory’

 

I believe that the best way to improve your skill is to test and push yourself. I am currently on a mission to get a lot more comfortable with PowerShell ( as it lives up to its name, it is very POWERful).

I need to check a few domains up and running and like to keep an eye on my Domain Controllers as they are obviously the base of Active Directory. So, I decided that i needed to brush on my PowerShell skills, the easiest way to do this is to use it. Hence, I created a PowerShell script to do this for me. It has been uploaded to the Microsoft TechNet Gallery.

The real key is that all the information is built automatically by PowerShell and no modification to the script should be required.

Code below, I would recommend you download it though

======================================================

Snap 2012-01-24 at 13.00.13

Snap 2012-01-24 at 13.00.39

Hope this helps,

Follow me

facebook-small3222522 twitter-small3222522

MCC11_Logo_Horizontal_2-color_thumb_

 

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.

MCC_Logo_NEW

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.

ACTIVE DIRECTORY

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

EXCHANGE 

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

VIRTUAL MACHINE MANAGER

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

MCC_Logo_NEW