<#

Import-Module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'
New-PSDrive -Name SCCM-Drive -PSProvider "AdminUI.PS.Provider\CMSite" -Root "PNCRASCCM001.ccx.carecentrix.com" -Description "SCCM Site"

#>
$Current_Location = Get-Location
CD sccm-drive:

$All_Collections = @()
$Collection_Names = 
                    "_6PM - Production Patching",
                    "_9PM - Production Patching",
                    "_11PM - Production Patching - File Servers",
                    "_11PM - Production Patching",
                    "__6PM - Production Patching - Domain Controllers 1",
                    "__9PM - Production Patching - Domain Controllers 2",
                    "__11PM - Production Patching - Domain Controllers 3"

$Collection_Names | % { $All_Collections += Get-CMCollection -Name $_ }

$All_Collections.name | % { $Maint = Get-CMMaintenanceWindow -CollectionName $_
                            $Obj = New-Object -TypeName PSObject
                            $obj | Add-Member -MemberType NoteProperty -Name Collection -Value $_
                            $Obj | Add-Member -MemberType NoteProperty -Name MaintenanceWindowName -Value $Maint.Name
                            $Obj | Add-Member -MemberType NoteProperty -Name Description -Value $Maint.Description
                            $Obj | Add-Member -MemberType NoteProperty -Name StartTime -Value $Maint.StartTime
                            $Obj | Add-Member -MemberType NoteProperty -Name RecurrenceType -Value $Maint.RecurrenceType
                                                                                   
                            $Obj
                            
                           }#end%

#Set-Location $Current_Location


