diff --git a/M365DSC/Create-M365DSC_ServicePrincipal b/Microsoft365/M365DSC/Create-M365DSC_ServicePrincipal similarity index 100% rename from M365DSC/Create-M365DSC_ServicePrincipal rename to Microsoft365/M365DSC/Create-M365DSC_ServicePrincipal diff --git a/M365DSC/Export-M365DSC-Cred.ps1 b/Microsoft365/M365DSC/Export-M365DSC-Cred.ps1 similarity index 100% rename from M365DSC/Export-M365DSC-Cred.ps1 rename to Microsoft365/M365DSC/Export-M365DSC-Cred.ps1 diff --git a/M365DSC/Export-M365DSCConfig.ps1 b/Microsoft365/M365DSC/Export-M365DSCConfig.ps1 similarity index 100% rename from M365DSC/Export-M365DSCConfig.ps1 rename to Microsoft365/M365DSC/Export-M365DSCConfig.ps1 diff --git a/Restart-SyncCycle.ps1 b/Restart-SyncCycle.ps1 deleted file mode 100644 index ef30872..0000000 --- a/Restart-SyncCycle.ps1 +++ /dev/null @@ -1,120 +0,0 @@ -Function Restart-SCCMSyncCycle { - <# - .Synopsis - Remotely restarts sccm service cycles. - - - .DESCRIPTION - This function restarts all sccm policies on a remote client so that the client can immediately get any pending software updates or inventory. - - - .NOTES - Name: Restart-SCCMSyncCycle - Author: theSysadminChannel - Version: 1 - DateCreated: 2017-02-09 - - - .LINK - https://thesysadminchannel.com/remotely-restart-sccmsynccycle-using-powershell - - - - .PARAMETER ComputerName - The computer to which connectivity will be checked - - - .EXAMPLE - Restart-SCCMSyncCycle -Computername Pactest-1 - - Description: - Will restart all sccm services on a remote machine. - - .EXAMPLE - Restart-SCCMSyncCycle -ComputerName pactest-1, pactest-2, pactest-3 - - Description: - Will generate a list of installed programs on pactest-1, pactest-2 and pactest-3 - - #> - - - [CmdletBinding()] - param( - [Parameter( - ValueFromPipeline=$true, - ValueFromPipelineByPropertyName=$true, - Position=0)] - [string[]] $ComputerName = $env:COMPUTERNAME - - ) - - Foreach ($Computer in $ComputerName ) { - try { - - Write-Host "=====================================================================" - Write-Output "$Computer : Machine Policy Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000022}" -ErrorAction Stop | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Application Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000121}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Discovery Data Collection Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000003}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : File Collection Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000010}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Hardware Inventory Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000001}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Machine Policy Retrieval Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000021}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Inventory Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000002}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Metering Usage Report Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000031}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Update Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000114}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : Software Update Scan Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000113}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : State Message Refresh" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000111}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Retrieval Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000026}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Evaluation Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000027}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Windows Installers Source List Update Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000032}" | select -ExpandProperty PSComputerName | Out-Null - - sleep 1 - } - - catch { - Write-Host $Computer.toUpper() "is not online" -ForegroundColor:Red - Write-Host - Write-Host - - } - } - } \ No newline at end of file diff --git a/diagrams/Autopilot WorkFlow.vsdx b/diagrams/Autopilot WorkFlow.vsdx new file mode 100644 index 0000000..958290c Binary files /dev/null and b/diagrams/Autopilot WorkFlow.vsdx differ diff --git a/dump/6PM - unknown.txt b/dump/6PM - unknown.txt deleted file mode 100644 index c62d48d..0000000 Binary files a/dump/6PM - unknown.txt and /dev/null differ diff --git a/dump/9pm-Error.txt b/dump/9pm-Error.txt deleted file mode 100644 index 9a2dda2..0000000 Binary files a/dump/9pm-Error.txt and /dev/null differ diff --git a/dump/Add-to-Local-Admins-Group.ps1 b/dump/Add-to-Local-Admins-Group.ps1 deleted file mode 100644 index e253b80..0000000 --- a/dump/Add-to-Local-Admins-Group.ps1 +++ /dev/null @@ -1,5 +0,0 @@ -$Acct = "ccx/sccm" -$Ws = "l201131" - -Invoke-Command $Ws { Param($Acct,$Ws) ([ADSI]"WinNT://$Ws/administrators,group").psbase.Invoke("Add",([ADSI]"WinNT://$Acct").path)} -ArgumentList $Acct,$Ws - diff --git a/dump/CCXQ - Shared.txt b/dump/CCXQ - Shared.txt deleted file mode 100644 index 630d0f6..0000000 --- a/dump/CCXQ - Shared.txt +++ /dev/null @@ -1,73 +0,0 @@ -Q1NCRAFILE001 -QRSH111 -QIIS005 -QRDS002 -QMHB003 -QMHB004 -QRDS001 -QPGP001 -QMHB001 -QMFT001 -QRSH101 -QSCH012 -QDRF001 -QFNP008 -Q2NCRAFILE001 -Q3NCRAFILE001 -QMHB002 -QSIS001 -QSRS001 -QSRS004 -QFNP007 -QSQL029 -QSQL030 -Q5NCRAFILE001 -QSQL006 -QADF001 -QTABL001 -Q4NCRAFILE001 -QFNP009 -QSCH011 -QSQL028 -QAPP021 -QSCH014 -QFNP001 -QSCH013 -PQRSH001 -QVST012 -QVST011 -QSIS003 -QSQL001 -QBTS001 -QWTS004 -QWTS005 -QWTS006 -QWTS001 -QAPP005 -QIIS002 -QDWH001 -QIIS004 -QAPP001 -QSIS002 -QWTS010 -QIIS001 -QBIZ121 -QBIZ131 -QBIZ132 -QBIZ122 -PQRDS001 -QFNP003 -Q4SQL024 -QVST021 -QVST022 -QAPP003 -QEDI113 -QEDI112 -QEDI111 -QRSH112 -QEDI152 -QEDI153 -QEDI151 -QUTL012 -QCMX001 -QNCRASPOWA01 \ No newline at end of file diff --git a/dump/CMClient.psm1 b/dump/CMClient.psm1 deleted file mode 100644 index 4d34838..0000000 --- a/dump/CMClient.psm1 +++ /dev/null @@ -1,644 +0,0 @@ -<# - =========================================================================== - Created with: SAPIEN Technologies, Inc., PowerShell Studio 2014 v4.1.58 - Created on: 6/9/2014 1:57 PM - Created by: Adam Bertram - Filename: CMClient.psm1 - ------------------------------------------------------------------------- - Module Name: CMClient - =========================================================================== -#> -#region Invoke-CMClientAction -<# -.SYNOPSIS - This is a helper function that initiates many ConfigMgr client actions. -.DESCRIPTION - -.PARAMETER Computername - The system you'd like to initate the action on. -.PARAMETER AsJob - A switch parameter that initates a job in the background -.PARAMETER ClientAction - The client action to initiate. -.EXAMPLE - PS C:\> Invoke-CMClientAction -Computername 'Value1' -AsJob - This example shows how to call the Invoke-CMClientAction function with named parameters. -.NOTES -#> -function Invoke-CMClientAction { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [string]$Computername, - [Parameter(Mandatory = $true)] - [ValidateSet('MachinePolicy', - 'DiscoveryData', - 'ComplianceEvaluation', - 'AppDeployment', - 'HardwareInventory', - 'UpdateDeployment', - 'UpdateScan', - 'SoftwareInventory')] - [string]$ClientAction, - [Parameter()] - [switch]$AsJob - ) - - Begin { - try { - $ScheduleIDMappings = @{ - 'MachinePolicy' = '{00000000-0000-0000-0000-000000000021}'; - 'DiscoveryData' = '{00000000-0000-0000-0000-000000000003}'; - 'ComplianceEvaluation' = '{00000000-0000-0000-0000-000000000071}'; - 'AppDeployment' = '{00000000-0000-0000-0000-000000000121}'; - 'HardwareInventory' = '{00000000-0000-0000-0000-000000000001}'; - 'UpdateDeployment' = '{00000000-0000-0000-0000-000000000108}'; - 'UpdateScan' = '{00000000-0000-0000-0000-000000000113}'; - 'SoftwareInventory' = '{00000000-0000-0000-0000-000000000002}'; - } - $ScheduleID = $ScheduleIDMappings[$ClientAction] - } catch { - Write-Error $_.Exception.Message - } - - } - Process { - try { - ## Args1 represents the computername and $args[1] represents the scheduleID - $ActionScriptBlock = { - [void] ([wmiclass] "\\$($args[0])\root\ccm:SMS_Client").TriggerSchedule($args[1]); - if (!$?) { - throw "Failed to initiate a $ClientAction on $($args[0])" - } - } - - if ($AsJob.IsPresent) { - $Params = @{ - 'Computername' = $Computername; - 'OriginatingFunction' = $ClientAction; - 'ScriptBlock' = $ActionScriptBlock; - 'ScheduleID' = $ScheduleID - } - Initialize-CMClientJob @Params - } else { - Invoke-Command -ScriptBlock $ActionScriptBlock -ArgumentList $Computername,$ScheduleID - } - } catch { - Write-Error $_.Exception.Message - } - - } - End { - - } -} -#endregion - -#region Initialize-CMClientJob -<# -.SYNOPSIS - This is a helper function that starts and manages background jobs for the all - functions in this module. -.DESCRIPTION - -.PARAMETER OriginatingFunction - The function where the job request came from. This is used to keep track of - which background jobs were started by which function. -.PARAMETER ScriptBlock - This is the scriptblock that is passed to the system. -.PARAMETER Computername - The computer name that the function is connecting to. This is used to keep track - of the functions initiated on computers. -.PARAMETER ScheduleID - This is the schedule ID to designate which client action to initiate. This is needed - because it has to be sent to the background job scriptblock. -.EXAMPLE - -.NOTES -#> -function Initialize-CMClientJob { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [string]$OriginatingFunction, - [Parameter(Mandatory = $true)] - [scriptblock]$ScriptBlock, - [Parameter(Mandatory = $true)] - [string]$Computername, - [Parameter(Mandatory = $true)] - [string]$ScheduleID - ) - - Begin { - ## The total number of jobs that can be concurrently running - $MaxJobThreads = 75 - ## How long to wait when the max job threads has been met to start another job - $JobWaitSecs = 1 - } - Process { - try { - Write-Verbose "Starting job `"$ComputerName - $OriginatingFunction`"..." - Start-Job -ScriptBlock $ScriptBlock -Name "$ComputerName - $OriginatingFunction" -ArgumentList $Computername, $ScheduleID | Out-Null - While ((Get-Job -state running).count -ge $MaxJobThreads) { - Write-Verbose "Maximum job threshold has been met. Waiting $JobWaitSecs second(s) to try again..."; - Start-Sleep -Seconds $JobWaitSecs - } - } catch { - Write-Error $_.Exception.Message - } - } - End { - - } -} -#endregion - -#region Invoke-CMClientMachinePolicyDownload -<# -.SYNOPSIS - This function invokes a machine policy download on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the machine policy download on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientMachinePolicyDownload -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientMachinePolicyDownload { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [alias('Name')] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'MachinePolicy'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -#region Invoke-CMClientDiscoveryDataCycle -<# -.SYNOPSIS - This function invokes a DDR cycle on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the action on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientDiscoveryDataCycle -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientDiscoveryDataCycle { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'DiscoveryData'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -#region Invoke-CMClientComplianceEvaluation -<# -.SYNOPSIS - This function invokes a compliance evaluation on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the action on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientComplianceEvaluation -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientComplianceEvaluation { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'ComplianceEvaluation'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -#region Invoke-CMClientApplicationDeploymentEvaluation -<# -.SYNOPSIS - This function invokes an application deployment eval on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the action on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientApplicationDeploymentEvaluation -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientApplicationDeploymentEvaluation { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'AppDeployment'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -#region Invoke-CMClientHardwareInventory -<# -.SYNOPSIS - This function invokes a hardware inventory cycle on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the action on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientHardwareInventory -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientHardwareInventory { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'HardwareInventory'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -#region Invoke-CMClientUpdateDeploymentEvaluation -<# -.SYNOPSIS - This function invokes an update deployment eval on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the action on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientUpdateDeploymentEvaluation -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientUpdateDeploymentEvaluation { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'UpdateDeployment'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -#region Invoke-CMClientUpdateScan -<# -.SYNOPSIS - This function invokes an update scan eval on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the action on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientUpdateScan -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientUpdateScan { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'UpdateScan'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -#region Invoke-CMClientSoftwareInventory -<# -.SYNOPSIS - This function invokes a software inventory scan on a ConfigMgr client -.DESCRIPTION - -.PARAMETER Computername - The name of the system you'd like to invoke the action on -.PARAMETER AsJob - Specify this parameter if you'd like to run this as a background job. -.EXAMPLE - PS C:\> Invoke-CMClientSoftwareInventory -Computername 'Value1' -AsJob -.NOTES - -#> -function Invoke-CMClientSoftwareInventory { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true, - ValueFromPipeline = $true, - ValueFromPipelineByPropertyName = $true)] - [string]$Computername, - [Parameter()] - [switch]$AsJob - ) - - Begin { - - } - Process { - $Params = @{ - 'Computername' = $Computername; - 'ClientAction' = 'SoftwareInventory'; - 'AsJob' = $AsJob.IsPresent - } - Invoke-CMClientAction @Params - } - End { - - } -} -#endregion - -## Modify these function as advanced functions -<# -Function Set-CMClientBusinessHours ($ComputerName, $StartTime = 3, $EndTime = 7, $WorkingDays) { - ## The first digit is the start time (7am), the second digit is the end time (7pm) and the third digit is the days of the week. - ## The days of the week are calculated using the table below, so Monday – Friday is calculated as 2+4+8+16+32 = 62. - ## Sunday - 1, Monday - 2, Tuesday - 4, Wednesday - 8, Thursday - 16, Friday - 32, Saturday - 64 - - try { - Write-Debug "Initiating the $($MyInvocation.MyCommand.Name) function..."; - - $cmClientUserSettings = [WmiClass]"\\$ComputerName\ROOT\ccm\ClientSDK:CCM_ClientUXSettings" - $businessHours = $cmClientUserSettings.PSBase.GetMethodParameters("SetBusinessHours") - $businessHours.StartTime = $StartTime - $businessHours.EndTime = $EndTime - $businessHours.WorkingDays = $WorkingDays - - $result = $cmClientUserSettings.PSBase.InvokeMethod("SetBusinessHours", $businessHours, $Null) - - if ($result.ReturnValue -eq 0) { - $mResult = $true - } else { - $mResult = $false; - } - - return $mResult - - } catch [System.Exception] { - Write-Error $_.Exception.Message; - }##endtry -}##endfunction - -Function Get-CMClientBusinessHours ($ComputerName) { - ## The first digit is the start time (7am), the second digit is the end time (7pm) and the third digit is the days of the week. - ## The days of the week are calculated using the table below, so Monday – Friday is calculated as 2+4+8+16+32 = 62. - ## Sunday - 1, Monday - 2, Tuesday - 4, Wednesday - 8, Thursday - 16, Friday - 32, Saturday - 64 - - try { - Write-Debug "Initiating the $($MyInvocation.MyCommand.Name) function..."; - - $cmClientUserSettings = [WmiClass]"\\$ComputerName\ROOT\ccm\ClientSDK:CCM_ClientUXSettings" - $businessHours = $cmClientUserSettings.GetBusinessHours() - $businessHoursCI = [string]$businessHours.StartTime + "," + [string]$businessHours.EndTime + "," + [string]$businessHours.WorkingDays - - return $businessHoursCI - - } catch [System.Exception] { - Write-Error $_.Exception.Message; - }##endtry -}##endfunction - -Function Disable-CMClientBusinessHours ($ComputerName) { - try { - ## Change the "automatic install or uninstall required software and restart the computer only outside of the specified business hours - - return $mResult - - } catch [System.Exception] { - Write-Error $_.Exception.Message; - }##endtry -}##endfunction - -Function Get-SccmApplicationState ($ComputerName,$Name = $null,[switch]$IncludeDetails) { - try { - Write-Debug "Initiating the $($MyInvocation.MyCommand.Name) function..."; - - $eval_states = @{0 = 'No state information is available'; - 1 = 'Application is enforced to desired/resolved state'; - 2 = 'Application is not required on the client'; - 3 = 'Application is available for enforcement (install or uninstall based on resolved state). Content may/may not have been downloaded'; - 4 = 'Application last failed to enforce (install/uninstall)'; - 5 = 'Application is currently waiting for content download to complete'; - 6 = 'Application is currently waiting for content download to complete'; - 7 = 'Application is currently waiting for its dependencies to download'; - 8 = 'Application is currently waiting for a service (maintenance) window'; - 9 = 'Application is currently waiting for a previously pending reboot'; - 10 = 'Application is currently waiting for serialized enforcement'; - 11 = 'Application is currently enforcing dependencies'; - 12 = 'Application is currently enforcing'; - 13 = 'Application install/uninstall enforced and soft reboot is pending'; - 14 = 'Application installed/uninstalled and hard reboot is pending'; - 15 = 'Update is available but pending installation'; - 16 = 'Application failed to evaluate'; - 17 = 'Application is currently waiting for an active user session to enforce'; - 18 = 'Application is currently waiting for all users to logoff'; - 19 = 'Application is currently waiting for a user logon'; - 20 = 'Application in progress, waiting for retry'; - 21 = 'Application is waiting for presentation mode to be switched off'; - 22 = 'Application is pre-downloading content (downloading outside of install job)'; - 23 = 'Application is pre-downloading dependent content (downloading outside of install job)'; - 24 = 'Application download failed (downloading during install job)'; - 25 = 'Application pre-downloading failed (downloading outside of install job)'; - 26 = 'Download success (downloading during install job)'; - 27 = 'Post-enforce evaluation'; - 28 = 'Waiting for network connectivity'; - } - - if ($Name -and $IncludeDetails.IsPresent) { - $aApps = Request-Wmi -ComputerName $ComputerName -Namespace 'root\ccm\clientsdk' -Query "SELECT * FROM CCM_Application WHERE FullName = '$Name'" - } elseif ($Name -and !$IncludeDetails.IsPresent) { - $aApps = Request-Wmi -ComputerName $ComputerName -Namespace 'root\ccm\clientsdk' -Query "SELECT * FROM CCM_Application WHERE FullName = '$Name'" | Select-Object PSComputerName,FullName,InstallState,ErrorCode,EvaluationState,@{label='StartTime';expression={$_.ConvertToDateTime($_.StartTime)}} - } elseif (!$Name -and $IncludeDetails.IsPresent) { - $aApps = Request-Wmi -ComputerName $ComputerName -Namespace 'root\ccm\clientsdk' -Query "SELECT * FROM CCM_Application" - } elseif (!$Name -and !$IncludeDetails.IsPresent) { - $aApps = Request-Wmi -ComputerName $ComputerName -Namespace 'root\ccm\clientsdk' -Query "SELECT * FROM CCM_Application" | Select-Object PSComputerName,FullName,InstallState,ErrorCode,EvaluationState,@{label='StartTime';expression={$_.ConvertToDateTime($_.StartTime)}} - } - - if (!$aApps) { - $mResult = "$($MyInvocation.MyCommand.Name): WMI query failed"; - } else { - $mResult = $aApps | Sort-Object FullName; - }##endif - - return $mResult; - - } catch [System.Exception] { - Write-Error $_.Exception.Message; - }##endtry -}##endfunction - -Function Get-CMClientUpdateDeploymentState() { - -} -#> - -Export-ModuleMember Invoke-CMClientUpdateScan # -Export-ModuleMember Invoke-CMClientUpdateDeploymentEvaluation # -Export-ModuleMember Invoke-CMClientHardwareInventory -Export-ModuleMember Invoke-CMClientApplicationDeploymentEvaluation -Export-ModuleMember Invoke-CMClientComplianceEvaluation -Export-ModuleMember Invoke-CMClientDiscoveryDataCycle -Export-ModuleMember Invoke-CMClientMachinePolicyDownload # - - - diff --git a/dump/CMClientDeviceCollectionMembership.ps1 b/dump/CMClientDeviceCollectionMembership.ps1 deleted file mode 100644 index ebef369..0000000 --- a/dump/CMClientDeviceCollectionMembership.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -<# -2 .SYNOPSIS -3 Get the collection membership of a configuration manager client device or computer. -4 -5 .DESCRIPTION -6 Get the collection membership of a configuration manager client device or computer. -7 This function will query System Center Configuration manager for a given computer name -8 and return the collections for which it is a member. -9 -10 .PARAMETER ComputerName -11 Provide a computer name. -12 -13 .PARAMETER SiteServer -14 Specify the name or FQDN of your SCCM site server. By default it gathers the site server -15 from the computer from which the function is called. -16 -17 .PARAMETER SiteCode -18 Specify the site code of your SCCM environment. By default it gathers the site code -19 from the computer from which the function is called. -20 -21 .PARAMETER Credential -22 Provide a credential object for accessing the site server. -23 -24 .EXAMPLE -25 Get-CMClientDeviceCollectionMembership -26 -27 Gets the collection membership of the local host. -28 -29 .EXAMPLE -30 Get-CMClientDeviceCollectionMembership -Computer DESKTOP01 -31 -32 Gets the collection membership of DESKTOP01 -33 -34 .EXAMPLE -35 Get-CMClientDeviceCollectionMembership -Computer DESKTOP01 -Summary -36 -37 Gets the collection membership of DESKTOP01 in a summary format. -38 -39 .NOTES -40 Created by: Jason Wasser @wasserja -41 Modified: 6/8/2017 10:49:50 AM -42 #> -function Get-CMClientDeviceCollectionMembership { - [CmdletBinding()] - param ( - [string]$ComputerName = $env:COMPUTERNAME, - [string]$SiteServer = (Get-WmiObject -Namespace root\ccm -ClassName SMS_Authority).CurrentManagementPoint, - [string]$SiteCode = (Get-WmiObject -Namespace root\ccm -ClassName SMS_Authority).Name.Split(':')[1], - [switch]$Summary, - [System.Management.Automation.PSCredential]$Credential = [System.Management.Automation.PSCredential]::Empty - ) - - - begin {} - process { - Write-Verbose -Message "Gathering collection membership of $ComputerName from Site Server $SiteServer using Site Code $SiteCode." - $Collections = Get-WmiObject -ComputerName $SiteServer -Namespace root/SMS/site_$SiteCode -Credential $Credential -Query "SELECT SMS_Collection.* FROM SMS_FullCollectionMembership, SMS_Collection where name = '$ComputerName' and SMS_FullCollectionMembership.CollectionID = SMS_Collection.CollectionID" - if ($Summary) { - $Collections | Select-Object -Property Name,CollectionID - } - else { - $Collections - } - - } - end {} - } - - # Get-CMClientDeviceCollectionMembership -ComputerName w2012a | Select name,LimitToCollectionName - diff --git a/dump/CMUpdateReset.exe b/dump/CMUpdateReset.exe deleted file mode 100644 index fd44c13..0000000 Binary files a/dump/CMUpdateReset.exe and /dev/null differ diff --git a/dump/Clean Software Update Packages in ConfigMgr with PowerShell System Center ConfigMgr.website b/dump/Clean Software Update Packages in ConfigMgr with PowerShell System Center ConfigMgr.website deleted file mode 100644 index 4a99254..0000000 --- a/dump/Clean Software Update Packages in ConfigMgr with PowerShell System Center ConfigMgr.website +++ /dev/null @@ -1,14 +0,0 @@ -[{000214A0-0000-0000-C000-000000000046}] -Prop3=19,11 -Prop4=31,Clean Software Update Packages in ConfigMgr with PowerShell | | System Center ConfigMgr -[InternetShortcut] -IDList= -URL=https://www.scconfigmgr.com/2017/08/17/clean-software-update-packages-in-configmgr-with-powershell/ -IconFile=https://i0.wp.com/www.scconfigmgr.com/wp-content/uploads/2017/03/cropped-SCConfigMgrLOGO_Symbol_Transparent.png?fit=32%2C32&ssl=1 -IconIndex=1 -[{A7AF692E-098D-4C08-A225-D433CA835ED0}] -Prop5=3,0 -Prop9=19,0 -Prop2=65,2C0000000000000001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1D0100003D000000CD050000AF030000FC -[{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}] -Prop5=8,Microsoft.Website.F65A605E.1C4ACA4F diff --git a/dump/Collection-Members.ps1 b/dump/Collection-Members.ps1 deleted file mode 100644 index 4ffe1cc..0000000 --- a/dump/Collection-Members.ps1 +++ /dev/null @@ -1,97 +0,0 @@ -<# - -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" - -#> - - - - -# $DeviceCollection_Name = "Nabil - Test Collection" - - -<# - - - $DeviceCollection_Name = "All - Inventory - Supporting Infrastructure" - - $DeviceCollection_Name = "Stage 2. ADR - QA Servers" - - $DeviceCollection_Name = "Stage 3. ADR - PRD Servers - Set 2" - $DeviceCollection_Name = "Stage 3. ADR - PRD Servers - Set 1" - - $DeviceCollection_Name = "Stage 1. ADR - DEV Servers - Set 1" - -#### $DeviceCollection_Name_ALL = "All - Inventory - Infrastructure Servers", - "All - Inventory - Supporting Infrastructure", - "All - Inventory - Database", - "All - Inventory - Application Servers" - - - - - - -#> -<# - CD sccm-drive: - - $DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $DeviceCollection_Name | select Name,MemberCount - $DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $DeviceCollection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$DeviceCollection_Name.csv" -NoTypeInformation - $ServerName = $DeviceCollection_ServerNames.Name - $ServerName.count - - Set-Location c: - -#> - #$DeviceCollection_Name = "" - - CD sccm-drive: - - $DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $DeviceCollection_Name | select Name,MemberCount - $DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $DeviceCollection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$DeviceCollection_Name.csv" -NoTypeInformation - $ServerName = $DeviceCollection_ServerNames.Name - $ServerName.count - - Set-Location c: - - - - #$No_Client = $DeviceCollection_ServerNames | ? { $_.IsClient -eq $false } - #$No_Client.count - - # Test-Connection -ComputerName $No_Client.name -Count 1 - - - $Script:ALL_Patch_Servers = @() - $Script:Temp = @() - - Function ALL_Patching_Servers { - Param($Coll_Name) - CD sccm-drive: - - - $Script:Temp = Get-CMCollectionMember -CollectionName $Coll_Name #| select Name,IsClient - - $Temp | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Coll_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Coll_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - }#end% - - }#endFunction - - #$DeviceCollection_Name_ALL | % { ALL_Patching_Servers -Coll_Name $_ } - - $DeviceCollection_Name | % { ALL_Patching_Servers -Coll_Name $_ | sort Server} - -Set-Location c: - - - diff --git a/dump/ConfigMgr Client Action Module.URL b/dump/ConfigMgr Client Action Module.URL deleted file mode 100644 index f720218..0000000 --- a/dump/ConfigMgr Client Action Module.URL +++ /dev/null @@ -1,6 +0,0 @@ -[InternetShortcut] -URL=https://gallery.technet.microsoft.com/systemcenter/ConfigMgr-Client-Action-16a364a5 -IDList= -HotKey=0 -IconFile=C:\Users\nnazmat\AppData\Local\Mozilla\Firefox\Profiles\20v5hisb.default-release\shortcutCache\nnqCGd961WQk9_zngRurQg==.ico -IconIndex=0 diff --git a/dump/Decline-SupersededUpdatesWithExclusionPeriod.ps1.ps1 b/dump/Decline-SupersededUpdatesWithExclusionPeriod.ps1.ps1 deleted file mode 100644 index fa88dd7..0000000 --- a/dump/Decline-SupersededUpdatesWithExclusionPeriod.ps1.ps1 +++ /dev/null @@ -1,235 +0,0 @@ -# =============================================== -# Script to decline superseeded updates in WSUS. -# =============================================== -# It's recommended to run the script with the -SkipDecline switch to see how many superseded updates are in WSUS and to TAKE A BACKUP OF THE SUSDB before declining the updates. -# Parameters: - -# $UpdateServer = Specify WSUS Server Name -# $UseSSL = Specify whether WSUS Server is configured to use SSL -# $Port = Specify WSUS Server Port -# $SkipDecline = Specify this to do a test run and get a summary of how many superseded updates we have -# $DeclineLastLevelOnly = Specify whether to decline all superseded updates or only last level superseded updates -# $ExclusionPeriod = Specify the number of days between today and the release date for which the superseded updates must not be declined. Eg, if you want to keep superseded updates published within the last 2 months, specify a value of 60 (days) - - -# Supersedence chain could have multiple updates. -# For example, Update1 supersedes Update2. Update2 supersedes Update3. In this scenario, the Last Level in the supersedence chain is Update3. -# To decline only the last level updates in the supersedence chain, specify the DeclineLastLevelOnly switch - -# Usage: -# ======= - -# To do a test run against WSUS Server without SSL -# Decline-SupersededUpdates.ps1 -UpdateServer SERVERNAME -Port 8530 -SkipDecline - -# To do a test run against WSUS Server using SSL -# Decline-SupersededUpdates.ps1 -UpdateServer SERVERNAME -UseSSL -Port 8531 -SkipDecline - -# To decline all superseded updates on the WSUS Server using SSL -# Decline-SupersededUpdates.ps1 -UpdateServer SERVERNAME -UseSSL -Port 8531 - -# To decline only Last Level superseded updates on the WSUS Server using SSL -# Decline-SupersededUpdates.ps1 -UpdateServer SERVERNAME -UseSSL -Port 8531 -DeclineLastLevelOnly - -# To decline all superseded updates on the WSUS Server using SSL but keep superseded updates published within the last 2 months (60 days) -# Decline-SupersededUpdates.ps1 -UpdateServer SERVERNAME -UseSSL -Port 8531 -ExclusionPeriod 60 - - - -[CmdletBinding()] -Param( - [Parameter(Mandatory=$True,Position=1)] - [string] $UpdateServer, - - [Parameter(Mandatory=$False)] - [switch] $UseSSL, - - [Parameter(Mandatory=$True, Position=2)] - $Port, - - [switch] $SkipDecline, - - [switch] $DeclineLastLevelOnly, - - [Parameter(Mandatory=$False)] - [int] $ExclusionPeriod = 0 -) - -Write-Host "" - -if ($SkipDecline -and $DeclineLastLevelOnly) { - Write-Host "Using SkipDecline and DeclineLastLevelOnly switches together is not allowed." - Write-Host "" - return -} - -$outPath = Split-Path $script:MyInvocation.MyCommand.Path -$outSupersededList = Join-Path $outPath "SupersededUpdates.csv" -$outSupersededListBackup = Join-Path $outPath "SupersededUpdatesBackup.csv" -"UpdateID, RevisionNumber, Title, KBArticle, SecurityBulletin, LastLevel" | Out-File $outSupersededList - -try { - - if ($UseSSL) { - Write-Host "Connecting to WSUS server $UpdateServer on Port $Port using SSL... " -NoNewLine - } Else { - Write-Host "Connecting to WSUS server $UpdateServer on Port $Port... " -NoNewLine - } - - [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null - $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer($UpdateServer, $UseSSL, $Port); -} -catch [System.Exception] -{ - Write-Host "Failed to connect." - Write-Host "Error:" $_.Exception.Message - Write-Host "Please make sure that WSUS Admin Console is installed on this machine" - Write-Host "" - $wsus = $null -} - -if ($wsus -eq $null) { return } - -Write-Host "Connected." - -$countAllUpdates = 0 -$countSupersededAll = 0 -$countSupersededLastLevel = 0 -$countSupersededExclusionPeriod = 0 -$countSupersededLastLevelExclusionPeriod = 0 -$countDeclined = 0 - -Write-Host "Getting a list of all updates... " -NoNewLine - -try { - $allUpdates = $wsus.GetUpdates() -} - -catch [System.Exception] -{ - Write-Host "Failed to get updates." - Write-Host "Error:" $_.Exception.Message - Write-Host "If this operation timed out, please decline the superseded updates from the WSUS Console manually." - Write-Host "" - return -} - -Write-Host "Done" - -Write-Host "Parsing the list of updates... " -NoNewLine -foreach($update in $allUpdates) { - - $countAllUpdates++ - - if ($update.IsDeclined) { - $countDeclined++ - } - - if (!$update.IsDeclined -and $update.IsSuperseded) { - $countSupersededAll++ - - if (!$update.HasSupersededUpdates) { - $countSupersededLastLevel++ - } - - if ($update.CreationDate -lt (get-date).AddDays(-$ExclusionPeriod)) { - $countSupersededExclusionPeriod++ - if (!$update.HasSupersededUpdates) { - $countSupersededLastLevelExclusionPeriod++ - } - } - - "$($update.Id.UpdateId.Guid), $($update.Id.RevisionNumber), $($update.Title), $($update.KnowledgeBaseArticles), $($update.SecurityBulletins), $($update.HasSupersededUpdates)" | Out-File $outSupersededList -Append - - } -} - -Write-Host "Done." -Write-Host "List of superseded updates: $outSupersededList" - -Write-Host "" -Write-Host "Summary:" -Write-Host "========" - -Write-Host "All Updates =" $countAllUpdates -Write-Host "Any except Declined =" ($countAllUpdates - $countDeclined) -Write-Host "All Superseded Updates =" $countSupersededAll -Write-Host " Superseded Updates (Intermediate) =" ($countSupersededAll - $countSupersededLastLevel) -Write-Host " Superseded Updates (Last Level) =" $countSupersededLastLevel -Write-Host " Superseded Updates (Older than $ExclusionPeriod days) =" $countSupersededExclusionPeriod -Write-Host " Superseded Updates (Last Level Older than $ExclusionPeriod days) =" $countSupersededLastLevelExclusionPeriod -Write-Host "" - -$i = 0 -if (!$SkipDecline) { - - Write-Host "SkipDecline flag is set to $SkipDecline. Continuing with declining updates" - $updatesDeclined = 0 - - if ($DeclineLastLevelOnly) { - Write-Host " DeclineLastLevel is set to True. Only declining last level superseded updates." - - foreach ($update in $allUpdates) { - - if (!$update.IsDeclined -and $update.IsSuperseded -and !$update.HasSupersededUpdates) { - if ($update.CreationDate -lt (get-date).AddDays(-$ExclusionPeriod)) { - $i++ - $percentComplete = "{0:N2}" -f (($updatesDeclined/$countSupersededLastLevelExclusionPeriod) * 100) - Write-Progress -Activity "Declining Updates" -Status "Declining update #$i/$countSupersededLastLevelExclusionPeriod - $($update.Id.UpdateId.Guid)" -PercentComplete $percentComplete -CurrentOperation "$($percentComplete)% complete" - - try - { - $update.Decline() - $updatesDeclined++ - } - catch [System.Exception] - { - Write-Host "Failed to decline update $($update.Id.UpdateId.Guid). Error:" $_.Exception.Message - } - } - } - } - } - else { - Write-Host " DeclineLastLevel is set to False. Declining all superseded updates." - - foreach ($update in $allUpdates) { - - if (!$update.IsDeclined -and $update.IsSuperseded) { - if ($update.CreationDate -lt (get-date).AddDays(-$ExclusionPeriod)) { - - $i++ - $percentComplete = "{0:N2}" -f (($updatesDeclined/$countSupersededAll) * 100) - Write-Progress -Activity "Declining Updates" -Status "Declining update #$i/$countSupersededAll - $($update.Id.UpdateId.Guid)" -PercentComplete $percentComplete -CurrentOperation "$($percentComplete)% complete" - try - { - $update.Decline() - $updatesDeclined++ - } - catch [System.Exception] - { - Write-Host "Failed to decline update $($update.Id.UpdateId.Guid). Error:" $_.Exception.Message - } - } - } - } - - } - - Write-Host " Declined $updatesDeclined updates." - if ($updatesDeclined -ne 0) { - Copy-Item -Path $outSupersededList -Destination $outSupersededListBackup -Force - Write-Host " Backed up list of superseded updates to $outSupersededListBackup" - } - -} -else { - Write-Host "SkipDecline flag is set to $SkipDecline. Skipped declining updates" -} - - - - -Write-Host "" -Write-Host "Done" -Write-Host "" \ No newline at end of file diff --git a/dump/Dev-Servers-Ping.txt b/dump/Dev-Servers-Ping.txt deleted file mode 100644 index d644839..0000000 Binary files a/dump/Dev-Servers-Ping.txt and /dev/null differ diff --git a/dump/Files/9PM - Production Patching-NoInstall.csv b/dump/Files/9PM - Production Patching-NoInstall.csv deleted file mode 100644 index 0d1819b..0000000 --- a/dump/Files/9PM - Production Patching-NoInstall.csv +++ /dev/null @@ -1,60 +0,0 @@ -"Server","InstalledOn","LastHF","InstalledBy","Description" -"KSOVEPOPS001","8/20/2017 12:00:00 AM","Q2758694","Server Administration and Management","Security update for MSXML4 SP3 (KB2758694)" -"PSQL023","10/13/2019 12:00:00 AM","KB4520005","NT AUTHORITY\SYSTEM","Security Update" -"PSQL022","10/13/2019 12:00:00 AM","KB4520005","NT AUTHORITY\SYSTEM","Security Update" -"PSEC002","1/26/2020 12:00:00 AM","KB4534251","CCX\clroth-ccxadmin","Security Update" -"PSQL023B","1/26/2020 12:00:00 AM","KB4534324","NT AUTHORITY\SYSTEM","Update" -"PNCRAFILE005","1/26/2020 12:00:00 AM","KB4534271","NT AUTHORITY\SYSTEM","Security Update" -"PFNP014","1/26/2020 12:00:00 AM","KB4534324","NT AUTHORITY\SYSTEM","Update" -"PRSH058","1/26/2020 12:00:00 AM","KB4534324","NT AUTHORITY\SYSTEM","Update" -"PSPT001","1/26/2020 12:00:00 AM","KB4534251","CCX\NNAZMAT-CCXADMIN","Security Update" -"PRSH003","2/14/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH002","2/14/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH152","2/16/2020 12:00:00 AM","KB4537767","NT AUTHORITY\SYSTEM","Security Update" -"PBIZ124","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PSQL016","2/16/2020 12:00:00 AM","KB4537821","CCX\jmbukov-ccxadmin","Security Update" -"PFNP011","2/16/2020 12:00:00 AM","KB4537821","CCX\kmboatr-ccxadmin","Security Update" -"PIIS003","2/16/2020 12:00:00 AM","KB4539601","CCX\abamaso-ccxadmin","Update" -"PSQL026","2/16/2020 12:00:00 AM","KB4520724","CCX\jmbukov-ccxadmin","Security Update" -"PSQL011","2/16/2020 12:00:00 AM","KB4539601","CCX\abamaso-ccxadmin","Update" -"PFNP005","2/16/2020 12:00:00 AM","KB2632503","PFNP005\Administrator","Update" -"PFNP013","2/16/2020 12:00:00 AM","KB4537764","NT AUTHORITY\SYSTEM","Security Update" -"PGAW001","2/16/2020 12:00:00 AM","KB4537821","CCX\rrpante-ccxadmin","Security Update" -"PSQL007","2/16/2020 12:00:00 AM","KB4538483","CCX\dapalme-ccxadmin","Security Update" -"PEXP001","2/16/2020 12:00:00 AM","KB4538483","CCX\clroth-ccxadmin","Security Update" -"PMHB002","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PVSS012","2/16/2020 12:00:00 AM","KB4537821","CCX\rrpante-ccxadmin","Security Update" -"PSNW001","2/16/2020 12:00:00 AM","KB4537821","CCX\SSTHOMA6-CCXAdmin","Security Update" -"PSHP002","2/16/2020 12:00:00 AM","KB4534310","CCX\kmboatr-ccxadmin","Security Update" -"PKEY001","2/16/2020 12:00:00 AM","KB4538483","CCX\SSTHOMA6-CCXAdmin","Security Update" -"PIIS005","2/16/2020 12:00:00 AM","KB4538483","CCX\baboyle-ccxadmin","Security Update" -"PSQL006","2/16/2020 12:00:00 AM","KB4538483","CCX\rrpante-ccxadmin","Security Update" -"PSRS003","2/16/2020 12:00:00 AM","KB4538483","CCX\rrpante-ccxadmin","Security Update" -"PRSH055","2/16/2020 12:00:00 AM","KB4537821","CCX\dapalme-ccxadmin","Security Update" -"PTABL001","2/16/2020 12:00:00 AM","KB4537821","CCX\SSTHOMA6-CCXAdmin","Security Update" -"PQRDS001","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PSRS001","2/16/2020 12:00:00 AM","KB2841134","CCX\baboyle-ccxadmin","Update" -"PNCRAFILE001","2/16/2020 12:00:00 AM","KB4537764","NT AUTHORITY\SYSTEM","Security Update" -"PARM001","2/16/2020 12:00:00 AM","KB4538483","CCX\abamaso-ccxadmin","Security Update" -"PBIZ122","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PBIZ123","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PSLK001","2/16/2020 12:00:00 AM","KB4537821","CCX\clroth-ccxadmin","Security Update" -"PADF001","2/16/2020 12:00:00 AM","KB4538483","CCX\SSTHOMA6-CCXAdmin","Security Update" -"PRSH059","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PBIZ126","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PWTS040","2/16/2020 12:00:00 AM","KB2849696","CCX\rrpante-ccxadmin","Update" -"PBIZ125","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH008","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PBIZ121","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH024","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH010","2/16/2020 12:00:00 AM","KB4486105","NT AUTHORITY\SYSTEM","Update" -"PRSH005","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH015","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PIIS007","2/16/2020 12:00:00 AM","KB4538483","CCX\clroth-ccxadmin","Security Update" -"PRSH021","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH020","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PRSH018","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PNCRAFILE003","2/16/2020 12:00:00 AM","KB4537764","NT AUTHORITY\SYSTEM","Security Update" -"PDOC001","2/16/2020 12:00:00 AM","KB4537821","CCX\rrpante-ccxadmin","Security Update" -"PRSH013","2/16/2020 12:00:00 AM","KB4537821","NT AUTHORITY\SYSTEM","Security Update" -"PSPT002","2/16/2020 12:00:00 AM","KB4534310","CCX\kmboatr-ccxadmin","Security Update" \ No newline at end of file diff --git a/dump/Files/9PM - Production Patching.csv b/dump/Files/9PM - Production Patching.csv deleted file mode 100644 index ad6d9cf..0000000 --- a/dump/Files/9PM - Production Patching.csv +++ /dev/null @@ -1,164 +0,0 @@ -"Name","IsClient" -"PQRSH001","True" -"PRSH027","True" -"PRSH019","True" -"PRSH011","True" -"PRSH020","True" -"PRSH021","True" -"PAAD001","True" -"PRSH023","True" -"PRSH010","True" -"PRSH024","True" -"PRSH008","True" -"PRSH001","True" -"PRSH006","True" -"PRSH000","True" -"PRSH009","True" -"PRSH005","True" -"PRSH003","True" -"PRSH004","True" -"PRSH002","True" -"PRSH007","True" -"PRSH022","True" -"PRSH014","True" -"PRSH012","True" -"PRSH016","True" -"PRSH015","True" -"PRSH018","True" -"PRSH017","True" -"PRSH013","True" -"PRSH028","True" -"PRSH052","True" -"PRSH025","True" -"PRSH029","True" -"PRSH026","True" -"PSSP001","True" -"PRSH172","True" -"PWTS040","True" -"PFNP009","True" -"PSPT002","True" -"PDOC001","True" -"PEDI114","True" -"PRSH054","True" -"PRSH051","True" -"PWHD003","True" -"PRSH174","True" -"PBIZ125","True" -"PBIZ121","True" -"PFNP010","True" -"PRSH171","True" -"PIIS007","True" -"PNCRAFILE003","True" -"PSUF002","True" -"PPCH001","True" -"PRSH059","True" -"PBIZ112","True" -"PPCS001","True" -"PARM001","True" -"PSKY001","True" -"PSQL022B","True" -"PTTS011","True" -"PFNP006","True" -"PIIS003","True" -"PEXP001","True" -"PFNP013","True" -"PSQL013","True" -"PALM001","True" -"PGAW001","True" -"PWHD004","True" -"PSPT001","True" -"PNCRAFILE007","True" -"PSUF001","True" -"PEDI111","True" -"PSQL011","True" -"PEZP001","True" -"PNCRANTRX001","True" -"PEDI112","True" -"PDWH001","True" -"PSQL015","True" -"PADF003","True" -"PSQL007","True" -"PFNP005","True" -"PSQL026","True" -"PBIZ126","True" -"PADF002","True" -"PFNP011","True" -"PFNP002","True" -"POWA001","True" -"PSQL030A","True" -"PSQL029A","True" -"PSQL016","True" -"PRSH176","True" -"PRSH056","True" -"PRSH057","True" -"PBIZ124","True" -"PSQL010","True" -"PBIZ111","True" -"PFNP008","True" -"PSSP003","True" -"PRSH152","True" -"PMHB002","True" -"PTABL001","True" -"PCCR001","True" -"PEDI116","True" -"PSNW001","True" -"PSLK001","True" -"PRSH161","True" -"PSKY003","True" -"PBIZ123","True" -"FLT2PTTS011","True" -"PRSH175","True" -"PRSH151","True" -"PSQL030B","True" -"PMHB001","True" -"PVST001","True" -"PIQV001","True" -"PSQL009","True" -"PFNP015","True" -"PSQL025","True" -"PRSH173","True" -"PBIZ122","True" -"PPDQ001","True" -"PVST002","True" -"PRSH053","True" -"PSEC002","True" -"PSQL029B","True" -"PVSS012","True" -"PSQL021","True" -"PFNP012","True" -"PNCRAFILE001","True" -"PSQL028A","True" -"PSRS001","True" -"PNCRAFILE005","True" -"PSIS002","True" -"FLT2PSQL021","True" -"PFNP007","True" -"PVSS011","True" -"PFNP003","True" -"PEDI113","True" -"PADF001","True" -"PQRDS001","True" -"PSQL022","True" -"PRSH050","True" -"PRSH055","True" -"PRSH058","True" -"PRSH162","True" -"PIWC012","True" -"PEDI115","True" -"PJMP001","True" -"PDWH002","True" -"PSRS003","True" -"PSQL006","True" -"PSQL028B","True" -"PIIS005","True" -"PKEY001","True" -"PSHP002","True" -"KSOVEPOPS001","False" -"PSQL001","False" -"PFNP001","False" -"PCPR001","False" -"PBLD001","False" -"PCVV001","False" -"PSQL023","False" -"PSQL023B","False" -"PFNP014","False" diff --git a/dump/Files/All-patching-collections.csv b/dump/Files/All-patching-collections.csv deleted file mode 100644 index 93aadbc..0000000 --- a/dump/Files/All-patching-collections.csv +++ /dev/null @@ -1,213 +0,0 @@ -"Server","ClientInstalled","CollectionName" -"PIAP002","True","_6PM - Production Patching" -"PKEY003","True","_6PM - Production Patching" -"PNCRAVERIDX002","True","_6PM - Production Patching" -"PNCRAVERIDX005","True","_6PM - Production Patching" -"PNCRAVERDA001","True","_6PM - Production Patching" -"PNCRAVERVLT002","True","_6PM - Production Patching" -"PNCRAVERIDX004","True","_6PM - Production Patching" -"PNCRAVERIDX001","True","_6PM - Production Patching" -"PNCRAVERIDX003","True","_6PM - Production Patching" -"PSEV013","True","_6PM - Production Patching" -"PSEV011","True","_6PM - Production Patching" -"NYMEPALT001","True","_6PM - Production Patching" -"AZPHPALT001","True","_6PM - Production Patching" -"PSEV012","True","_6PM - Production Patching" -"PADM001","True","_6PM - Production Patching" -"PSEV014","True","_6PM - Production Patching" -"KSOPPALT001","True","_6PM - Production Patching" -"PUTL005","True","_6PM - Production Patching" -"PSEV010","True","_6PM - Production Patching" -"PIAP001","True","_6PM - Production Patching" -"PKEY002","True","_6PM - Production Patching" -"PNCRAVERVLT003","True","_6PM - Production Patching" -"PSEV024","True","_6PM - Production Patching" -"PSNX001","True","_6PM - Production Patching" -"PSEV022","True","_6PM - Production Patching" -"PNCRAWINAUTO001","True","_6PM - Production Patching" -"PUTL011","True","_6PM - Production Patching" -"PSSP004","True","_6PM - Production Patching" -"PVRS012","True","_6PM - Production Patching" -"PCAC002","True","_6PM - Production Patching" -"PDRF001","True","_6PM - Production Patching" -"PIAM001","True","_6PM - Production Patching" -"PAPCAV001","True","_6PM - Production Patching" -"PSSP002","True","_6PM - Production Patching" -"CTHAPALT001","True","_6PM - Production Patching" -"PSEV015","True","_6PM - Production Patching" -"PUTL006","True","_6PM - Production Patching" -"PDEP001","True","_6PM - Production Patching" -"PCAC001","True","_6PM - Production Patching" -"PSSP001","True","_6PM - Production Patching" -"PAPCAC002","True","_6PM - Production Patching" -"PIAC001","True","_6PM - Production Patching" -"PIWM002","True","_6PM - Production Patching" -"PMON006","True","_6PM - Production Patching" -"PMON002","True","_6PM - Production Patching" -"PAPJNKSSLA201","True","_6PM - Production Patching" -"PVRS011","True","_6PM - Production Patching" -"PAPSEP001","True","_6PM - Production Patching" -"CTHAPDMC001","True","_6PM - Production Patching" -"AZPHPDMC001","True","_6PM - Production Patching" -"PPKI004","True","_6PM - Production Patching" -"PMON007","True","_6PM - Production Patching" -"PAPJNKSSLA202","True","_6PM - Production Patching" -"PUTL012","True","_6PM - Production Patching" -"PICO001","True","_6PM - Production Patching" -"PFNP009","True","_11PM - Production Patching - File Servers" -"PFNP010","True","_11PM - Production Patching - File Servers" -"PNCRAFILE003","True","_11PM - Production Patching - File Servers" -"PFNP006","True","_11PM - Production Patching - File Servers" -"PFNP013","True","_11PM - Production Patching - File Servers" -"PNCRAFILE007","True","_11PM - Production Patching - File Servers" -"PFNP011","True","_11PM - Production Patching - File Servers" -"PFNP002","True","_11PM - Production Patching - File Servers" -"PFNP008","True","_11PM - Production Patching - File Servers" -"PFNP015","True","_11PM - Production Patching - File Servers" -"PFNP016","True","_11PM - Production Patching - File Servers" -"PFNP017","True","_11PM - Production Patching - File Servers" -"PFNP012","True","_11PM - Production Patching - File Servers" -"PFNP018","True","_11PM - Production Patching - File Servers" -"PNCRAFILE001","True","_11PM - Production Patching - File Servers" -"PFNP019","True","_11PM - Production Patching - File Servers" -"PNCRAFILE005","True","_11PM - Production Patching - File Servers" -"PFNP007","True","_11PM - Production Patching - File Servers" -"PFNP014","False","_11PM - Production Patching - File Servers" -"PFAX021","True","_11PM - Production Patching" -"PFAX022","True","_11PM - Production Patching" -"PRSH030","True","_11PM - Production Patching" -"PRDS001","True","_11PM - Production Patching" -"PRSH038","True","_11PM - Production Patching" -"PRSH039","True","_11PM - Production Patching" -"PRSH033","True","_11PM - Production Patching" -"PRSH031","True","_11PM - Production Patching" -"PRSH035","True","_11PM - Production Patching" -"PRSH032","True","_11PM - Production Patching" -"PDFS001","True","_11PM - Production Patching" -"PDFS003","True","_11PM - Production Patching" -"PIAM002","True","_11PM - Production Patching" -"PRDS002","True","_11PM - Production Patching" -"PRSH037","True","_11PM - Production Patching" -"PRSH034","True","_11PM - Production Patching" -"PNCRAMSMQ001","True","_11PM - Production Patching" -"PRSH036","True","_11PM - Production Patching" -"PIWM001","True","_11PM - Production Patching" -"PAPP011","True","_11PM - Production Patching" -"PDFS002","True","_11PM - Production Patching" -"PRSH040","True","_11PM - Production Patching" -"PAPP001","True","_11PM - Production Patching" -"PQRSH001","True","_9PM - Production Patching" -"PRSH027","True","_9PM - Production Patching" -"PRSH019","True","_9PM - Production Patching" -"PRSH011","True","_9PM - Production Patching" -"PRSH020","True","_9PM - Production Patching" -"PRSH021","True","_9PM - Production Patching" -"PAAD001","True","_9PM - Production Patching" -"PRSH023","True","_9PM - Production Patching" -"PRSH010","True","_9PM - Production Patching" -"PRSH024","True","_9PM - Production Patching" -"PRSH008","True","_9PM - Production Patching" -"PRSH001","True","_9PM - Production Patching" -"PRSH006","True","_9PM - Production Patching" -"PRSH000","True","_9PM - Production Patching" -"PRSH009","True","_9PM - Production Patching" -"PRSH005","True","_9PM - Production Patching" -"PRSH003","True","_9PM - Production Patching" -"PRSH004","True","_9PM - Production Patching" -"PRSH002","True","_9PM - Production Patching" -"PRSH007","True","_9PM - Production Patching" -"PRSH022","True","_9PM - Production Patching" -"PRSH012","True","_9PM - Production Patching" -"PRSH016","True","_9PM - Production Patching" -"PRSH015","True","_9PM - Production Patching" -"PRSH018","True","_9PM - Production Patching" -"PRSH017","True","_9PM - Production Patching" -"PRSH013","True","_9PM - Production Patching" -"PRSH028","True","_9PM - Production Patching" -"PRSH052","True","_9PM - Production Patching" -"PRSH025","True","_9PM - Production Patching" -"PRSH029","True","_9PM - Production Patching" -"PRSH026","True","_9PM - Production Patching" -"PSSP001","True","_9PM - Production Patching" -"PRSH172","True","_9PM - Production Patching" -"PDOC001","True","_9PM - Production Patching" -"PEDI114","True","_9PM - Production Patching" -"PRSH054","True","_9PM - Production Patching" -"PRSH051","True","_9PM - Production Patching" -"PWHD003","True","_9PM - Production Patching" -"PRSH174","True","_9PM - Production Patching" -"PBIZ125","True","_9PM - Production Patching" -"PBIZ121","True","_9PM - Production Patching" -"PRSH171","True","_9PM - Production Patching" -"PSUF002","True","_9PM - Production Patching" -"PPCH001","True","_9PM - Production Patching" -"PRSH059","True","_9PM - Production Patching" -"PBIZ112","True","_9PM - Production Patching" -"PPCS001","True","_9PM - Production Patching" -"PSKY001","True","_9PM - Production Patching" -"PSQL022B","True","_9PM - Production Patching" -"PSQL013","True","_9PM - Production Patching" -"PALM001","True","_9PM - Production Patching" -"PGAW001","True","_9PM - Production Patching" -"PWHD004","True","_9PM - Production Patching" -"PSUF001","True","_9PM - Production Patching" -"PEDI111","True","_9PM - Production Patching" -"PEZP001","True","_9PM - Production Patching" -"PNCRANTRX001","True","_9PM - Production Patching" -"PEDI112","True","_9PM - Production Patching" -"PSQL015","True","_9PM - Production Patching" -"PADF003","True","_9PM - Production Patching" -"PSQL026","True","_9PM - Production Patching" -"PBIZ126","True","_9PM - Production Patching" -"PADF002","True","_9PM - Production Patching" -"POWA001","True","_9PM - Production Patching" -"PSQL030A","True","_9PM - Production Patching" -"PSQL029A","True","_9PM - Production Patching" -"PSQL016","True","_9PM - Production Patching" -"PRSH176","True","_9PM - Production Patching" -"PRSH056","True","_9PM - Production Patching" -"PRSH057","True","_9PM - Production Patching" -"PBIZ124","True","_9PM - Production Patching" -"PSQL010","True","_9PM - Production Patching" -"PBIZ111","True","_9PM - Production Patching" -"PSSP003","True","_9PM - Production Patching" -"PRSH152","True","_9PM - Production Patching" -"PMHB002","True","_9PM - Production Patching" -"PTABL001","True","_9PM - Production Patching" -"PCCR001","True","_9PM - Production Patching" -"PEDI116","True","_9PM - Production Patching" -"PSNW001","True","_9PM - Production Patching" -"PSLK001","True","_9PM - Production Patching" -"PRSH161","True","_9PM - Production Patching" -"PSKY003","True","_9PM - Production Patching" -"PBIZ123","True","_9PM - Production Patching" -"PRSH175","True","_9PM - Production Patching" -"PRSH151","True","_9PM - Production Patching" -"PSQL030B","True","_9PM - Production Patching" -"PMHB001","True","_9PM - Production Patching" -"PVST001","True","_9PM - Production Patching" -"PIQV001","True","_9PM - Production Patching" -"PSQL009","True","_9PM - Production Patching" -"PSQL025","True","_9PM - Production Patching" -"PRSH173","True","_9PM - Production Patching" -"PBIZ122","True","_9PM - Production Patching" -"PPDQ001","True","_9PM - Production Patching" -"PVST002","True","_9PM - Production Patching" -"PRSH053","True","_9PM - Production Patching" -"PSQL029B","True","_9PM - Production Patching" -"PVSS012","True","_9PM - Production Patching" -"PSQL021","True","_9PM - Production Patching" -"PSQL028A","True","_9PM - Production Patching" -"PSIS002","True","_9PM - Production Patching" -"FLT2PSQL021","True","_9PM - Production Patching" -"PVSS011","True","_9PM - Production Patching" -"PEDI113","True","_9PM - Production Patching" -"PQRDS001","True","_9PM - Production Patching" -"PSQL022","True","_9PM - Production Patching" -"PRSH050","True","_9PM - Production Patching" -"PRSH055","True","_9PM - Production Patching" -"PRSH058","True","_9PM - Production Patching" -"PRSH162","True","_9PM - Production Patching" -"PEDI115","True","_9PM - Production Patching" -"PJMP001","True","_9PM - Production Patching" -"PSQL028B","True","_9PM - Production Patching" diff --git a/dump/Files/DEV-App-Servers-1-2020.txt b/dump/Files/DEV-App-Servers-1-2020.txt deleted file mode 100644 index e5a8bb0..0000000 --- a/dump/Files/DEV-App-Servers-1-2020.txt +++ /dev/null @@ -1,32 +0,0 @@ -DAPP012 -DFNP009 -DVCO001 -DAPP006 -DWHD003 -DFNP001 -DBIT901 -DWAM002 -DCTI001 -DFNP020 -DFNP002 -DAPP011 -DCPR001 -DVB6001 -DWHD001 -DPGP001 -DEDI001 -DDWH001 -DUTL012 -DFNP014 -DIAP001 -DGAW001 -DAPVRNS001 -DAPCAV001 -DAPCAC001 -DAPCAC002 -DFAX011 -DAPSEP001 -DDOC001 -DBTS001 -DWAM001 -DMHB001 \ No newline at end of file diff --git a/dump/Files/DEV-Application-Servers-Collection.txt b/dump/Files/DEV-Application-Servers-Collection.txt deleted file mode 100644 index b7217c0..0000000 Binary files a/dump/Files/DEV-Application-Servers-Collection.txt and /dev/null differ diff --git a/dump/Files/DEV-Patching-Application-Servers-Status-1-2020.csv b/dump/Files/DEV-Patching-Application-Servers-Status-1-2020.csv deleted file mode 100644 index da7d612..0000000 --- a/dump/Files/DEV-Patching-Application-Servers-Status-1-2020.csv +++ /dev/null @@ -1,54 +0,0 @@ -DeviceName CollectionName StatusTime Status ----------- -------------- ---------- ------ -DAPP012 DEV-Patching-Application-Servers 1/27/2020 3:09:05 PM InProgress -DFNP009 DEV-Patching-Application-Servers 1/24/2020 4:34:27 PM InProgress -DVCO001 DEV-Patching-Application-Servers 1/27/2020 2:58:17 PM InProgress -DAPP006 DEV-Patching-Application-Servers 1/29/2020 8:01:37 PM InProgress -DWHD003 DEV-Patching-Application-Servers 1/24/2020 4:14:43 PM InProgress -DFNP001 DEV-Patching-Application-Servers 1/24/2020 4:32:24 PM InProgress -DBIT901 DEV-Patching-Application-Servers 1/24/2020 4:15:29 PM InProgress -DWAM002 DEV-Patching-Application-Servers 1/27/2020 2:20:13 PM InProgress -DCTI001 DEV-Patching-Application-Servers 1/24/2020 4:13:11 PM InProgress -DFNP020 DEV-Patching-Application-Servers 1/24/2020 4:12:41 PM InProgress -DFNP002 DEV-Patching-Application-Servers 1/24/2020 5:34:08 PM InProgress -DAPP011 DEV-Patching-Application-Servers 3/24/2020 11:03:27 PM InProgress -DCPR001 DEV-Patching-Application-Servers 1/24/2020 5:07:06 PM InProgress -DVB6001 DEV-Patching-Application-Servers 1/27/2020 6:16:47 PM InProgress -DWHD001 DEV-Patching-Application-Servers 1/29/2020 7:43:59 PM Success -DPGP001 DEV-Patching-Application-Servers 1/29/2020 6:41:40 PM Success -DEDI001 DEV-Patching-Application-Servers 1/27/2020 3:23:54 PM Success -DDWH001 DEV-Patching-Application-Servers 1/27/2020 2:59:06 PM Success -DUTL012 DEV-Patching-Application-Servers 2/11/2020 11:25:39 PM Success -DFNP014 DEV-Patching-Application-Servers 1/24/2020 4:51:33 PM Success -DIAP001 DEV-Patching-Application-Servers 1/24/2020 3:45:21 PM Success -DGAW001 DEV-Patching-Application-Servers 1/29/2020 6:45:43 PM Success -DAPVRNS001 DEV-Patching-Application-Servers 3/20/2020 8:53:59 AM Success -DAPCAV001 DEV-Patching-Application-Servers 1/29/2020 5:26:57 PM Success -DAPCAC001 DEV-Patching-Application-Servers 2/6/2020 9:56:05 AM Success -DAPCAC002 DEV-Patching-Application-Servers 1/29/2020 5:46:44 PM Success -DFAX011 DEV-Patching-Application-Servers 1/29/2020 6:02:48 PM Success -DAPSEP001 DEV-Patching-Application-Servers 1/29/2020 5:35:25 PM Success -DDOC001 DEV-Patching-Application-Servers 3/2/2020 9:49:41 AM Success -DBTS001 DEV-Patching-Application-Servers 3/26/2020 11:47:08 AM Success -DWAM001 DEV-Patching-Application-Servers 3/28/2020 12:06:01 AM Unknown -DMHB001 DEV-Patching-Application-Servers 3/28/2020 12:06:01 AM Unknown - - - - - - - - - - - - - - - - - - - - diff --git a/dump/Files/DEV-Patching-Application-Servers.csv b/dump/Files/DEV-Patching-Application-Servers.csv deleted file mode 100644 index 5a323cf..0000000 --- a/dump/Files/DEV-Patching-Application-Servers.csv +++ /dev/null @@ -1,33 +0,0 @@ -"Name","IsClient" -"DFNP014","True" -"DAPSEP001","True" -"DFAX011","True" -"DAPCAC002","True" -"DAPCAC001","True" -"DFNP002","True" -"DAPCAV001","True" -"DAPVRNS001","True" -"DCPR001","True" -"DGAW001","True" -"DWAM002","True" -"DIAP001","True" -"DFNP001","True" -"DWHD003","True" -"DAPP006","True" -"DAPP012","True" -"DDOC001","True" -"DCTI001","True" -"DVB6001","True" -"DFNP009","True" -"DVCO001","True" -"DBIT901","True" -"DFNP020","True" -"DWHD001","True" -"DPGP001","True" -"DEDI001","True" -"DAPP011","True" -"DMHB001","True" -"DDWH001","True" -"DUTL012","True" -"DWAM001","True" -"DBTS001","True" diff --git a/dump/Files/Patches-In-SUG.csv b/dump/Files/Patches-In-SUG.csv deleted file mode 100644 index 200feca..0000000 --- a/dump/Files/Patches-In-SUG.csv +++ /dev/null @@ -1,258 +0,0 @@ -"UpdateGroup","ArticleID","BulletinID","Title" -"Server 2008 Required Updates","2500170","MS11-066","Security Update for Microsoft Chart Controls for Microsoft .NET Framework 3.5 Service Pack 1 (KB2500170)" -"Server 2008 Required Updates","3208481","MS16-144","Security Update for Windows Server 2008 for x64-based Systems (KB3208481)" -"Server 2008 Required Updates","4014652","","Security Update for Windows Server 2008 for x64-based Systems (KB4014652)" -"Server 2008 Required Updates","4014794","","Security Update for Windows Server 2008 for x64-based Systems (KB4014794)" -"Server 2008 Required Updates","4015067","","Security Update for Windows Server 2008 for x64-based Systems (KB4015067)" -"Server 2008 Required Updates","4018927","","Security Update for Windows Server 2008 for x64-based Systems (KB4018927)" -"Server 2008 Required Updates","4034744","","Security Update for Windows Server 2008 for x64-based Systems (KB4034744)" -"Server 2008 Required Updates","3170455","","Security Update for Windows Server 2008 for x64-based Systems (KB3170455)" -"Server 2008 Required Updates","4089229","","2018-03 Security Update for Windows Server 2008 for x64-based Systems (KB4089229)" -"Server 2008 Required Updates","4093227","","2018-06 Security Update for Windows Server 2008 for x64-based Systems (KB4093227)" -"Server 2008 Required Updates","4130956","","2018-06 Security Update for Windows Server 2008 for x64-based Systems (KB4130956)" -"Server 2008 Required Updates","4291391","","2018-07 Security Update for Windows Server 2008 for x64-based Systems (KB4291391)" -"Server 2008 Required Updates","4339503","","2018-07 Security Update for Windows Server 2008 for x64-based Systems (KB4339503)" -"Server 2008 Required Updates","4340007","","2018-07 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4340007)" -"Server 2008 Required Updates","4338380","","2018-08 Security Update for Windows Server 2008 for x64-based Systems (KB4338380)" -"Server 2008 Required Updates","4340939","","2018-08 Security Update for Windows Server 2008 for x64-based Systems (KB4340939)" -"Server 2008 Required Updates","4341832","","2018-08 Security Update for Windows Server 2008 for x64-based Systems (KB4341832)" -"Server 2008 Required Updates","4345682","","2018-08 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4345682)" -"Server 2008 Required Updates","4457984","","2018-09 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4457984)" -"Server 2008 Required Updates","4463104","","2018-10 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4463104)" -"Server 2008 Required Updates","4467700","","2018-11 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4467700)" -"Server 2008 Required Updates","4471319","","2018-12 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4471319)" -"Server 2008 Required Updates","4471984","","2018-12 Security Only Update for .NET Framework 3.5 SP1, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4471984)" -"Server 2008 Required Updates","4480957","","2019-01 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4480957)" -"Server 2008 Required Updates","4487124","","2019-02 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4487124)" -"Server 2008 Required Updates","4487019","","2019-02 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4487019)" -"Server 2008 Required Updates","4489876","","2019-03 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4489876)" -"Server 2008 Required Updates","4493730","","Security Update for Windows Server 2008 for x64-based Systems (KB4493730)" -"Server 2008 Required Updates","4493458","","2019-04 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4493458)" -"Server 2008 Required Updates","4498964","","2019-05 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 on Windows Server 2008 SP2 for x64 (KB4498964)" -"Server 2008 Required Updates","4499180","","2019-05 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4499180)" -"Server 2008 Required Updates","4503287","","2019-06 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4503287)" -"Server 2008 Required Updates","4507461","","2019-07 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4507461)" -"Server 2008 Required Updates","4507414","","2019-07 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4507414)" -"Server 2008 Required Updates","4512491","","2019-08 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4512491)" -"Server 2008 Required Updates","4516051","","2019-09 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4516051)" -"Server 2008 Required Updates","4520009","","2019-10 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4520009)" -"Server 2008 Required Updates","4474419","","2019-09 Security Update for Windows Server 2008 for x64-based Systems (KB4474419)" -"Server 2008 Required Updates","4525239","","2019-11 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4525239)" -"Server 2008 Required Updates","4530719","","2019-12 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4530719)" -"Server 2008 Required Updates","4534979","","2020-01 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4534979)" -"Server 2008 Required Updates","4534312","","2020-01 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4534312)" -"Server 2008 Required Updates","960568","","BITS 4.0 for Windows Server 2008 x64 Edition (KB960568)" -"Server 2008 Required Updates","4132941","","Update for Windows Server 2008 x64 Edition (KB4132941)" -"Server 2008 Required Updates","4486459","","2019-02 Update for Windows Server 2008 for x64-based Systems (KB4486459)" -"Server 2008 Required Updates","4490128","","2019-03 Update for Windows Server 2008 for x64-based Systems (KB4490128)" -"Server 2008 Required Updates","4489489","","Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4489489)" -"Server 2008 Required Updates","4507704","","2019-07 Update for Windows Server 2008 for x64-based Systems (KB4507704)" -"Server 2008 Required Updates","4501226","","2019-05 Update for Windows Server 2008 for x64-based Systems (KB4501226)" -"Server 2008 Required Updates","4519108","","2019-10 Update for Windows Server 2008 for x64-based Systems (KB4519108)" -"Server 2008 Required Updates","4537822","","2020-02 Security Only Quality Update for Windows Server 2008 for x64-based Systems (KB4537822)" -"Server 2008 Required Updates","4556406","","2020-05 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4556406)" -"Server 2008 Required Updates","4575904","","2020-07 Extended Security Updates (ESU) Licensing Preparation Package for Windows Server 2008 for x64-based Systems (KB4575904)" -"Server 2008 Required Updates","4570503","","2020-08 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4570503)" -"Server 2008 Required Updates","4580470","","2020-10 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4580470)" -"Server 2008 Required Updates","4566469","","2020-10 Security Only Update for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4566469)" -"Server 2008 Required Updates","4586086","","2020-11 Security and Quality Rollup for .NET Framework 2.0, 3.0, 4.5.2, 4.6 for Windows Server 2008 SP2 for x64 (KB4586086)" -"Server 2008 R2 Requred Patches","2894844","","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2894844)" -"Server 2008 R2 Requred Patches","4576490","","2020-09 Security Only Update for .NET Framework 4.8 for Windows Server 2008 R2 for x64 (KB4576490)" -"Server 2008 R2 Requred Patches","2823180","","Update for Windows Server 2008 R2 x64 Edition (KB2823180)" -"Server 2008 R2 Requred Patches","4507411","","2019-07 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 7 and Server 2008 R2 for x64 (KB4507411)" -"Server 2008 R2 Requred Patches","4580387","","2020-10 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4580387)" -"Server 2008 R2 Requred Patches","4556403","","2020-05 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows Server 2008 R2 for x64 (KB4556403)" -"Server 2008 R2 Requred Patches","2972100","MS14-057","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2972100)" -"Server 2008 R2 Requred Patches","4099637","","2018-05 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 on Windows 7 and Server 2008 R2 for x64 (KB4099637)" -"Server 2008 R2 Requred Patches","4490628","","2019-03 Servicing Stack Update for Windows Server 2008 R2 for x64-based Systems (KB4490628)" -"Server 2008 R2 Requred Patches","4586083","","2020-11 Security and Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows Server 2008 R2 for x64 (KB4586083)" -"Server 2008 R2 Requred Patches","2992611","MS14-066","Security Update for Windows Server 2008 R2 x64 Edition (KB2992611)" -"Server 2008 R2 Requred Patches","4019108","","May, 2017 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2 on Windows 7 and Windows Server 2008 R2 for x64 (KB4019108)" -"Server 2008 R2 Requred Patches","4467106","","2018-11 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4467106)" -"Server 2008 R2 Requred Patches","4503269","","2019-06 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4503269)" -"Server 2008 R2 Requred Patches","2742599","MS13-004","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2742599)" -"Server 2008 R2 Requred Patches","2789645","MS13-015","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2789645)" -"Server 2008 R2 Requred Patches","4099950","","2018-04 Update for Windows Server 2008 R2 for x64-based Systems (KB4099950)" -"Server 2008 R2 Requred Patches","4033342","","Microsoft .NET Framework 4.7.1 for Windows 7 and Windows Server 2008 R2 for x64 (KB4033342)" -"Server 2008 R2 Requred Patches","3072305","MS15-080","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 SP1 and Windows Server 2008 R2 SP1 for x64 (KB3072305)" -"Server 2008 R2 Requred Patches","4486459","","2019-02 Update for Windows Server 2008 R2 for x64-based Systems (KB4486459)" -"Server 2008 R2 Requred Patches","4541500","","2020-03 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4541500)" -"Server 2008 R2 Requred Patches","4340004","","2018-07 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 7 and Server 2008 R2 for x64 (KB4340004)" -"Server 2008 R2 Requred Patches","3186497","","Microsoft .NET Framework 4.7 for Windows 7 and Windows Server 2008 R2 for x64 (KB3186497)" -"Server 2008 R2 Requred Patches","4580467","","2020-10 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows Server 2008 R2 for x64 (KB4580467)" -"Server 2008 R2 Requred Patches","4501226","","2019-05 Update for Windows Server 2008 R2 for x64-based Systems (KB4501226)" -"Server 2008 R2 Requred Patches","4471328","","2018-12 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4471328)" -"Server 2008 R2 Requred Patches","4507456","","2019-07 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4507456)" -"Server 2008 R2 Requred Patches","2836942","","Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2836942)" -"Server 2008 R2 Requred Patches","2604115","MS12-035","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2604115)" -"Server 2008 R2 Requred Patches","4343899","","2018-08 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4343899)" -"Server 2008 R2 Requred Patches","4525233","","2019-11 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4525233)" -"Server 2008 R2 Requred Patches","2931356","MS14-026","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2931356)" -"Server 2008 R2 Requred Patches","4503548","","Microsoft .NET Framework 4.8 for Windows Server 2008 R2 for x64 (KB4503548)" -"Server 2008 R2 Requred Patches","3023215","MS15-048","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB3023215)" -"Server 2008 R2 Requred Patches","4462915","","2018-10 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4462915)" -"Server 2008 R2 Requred Patches","4493448","","2019-04 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4493448)" -"Server 2008 R2 Requred Patches","4489486","","Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 7 and Server 2008 R2 for x64 (KB4489486)" -"Server 2008 R2 Requred Patches","2729452","MS12-074","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2729452)" -"Server 2008 R2 Requred Patches","3031432","MS15-015","Security Update for Windows Server 2008 R2 x64 Edition (KB3031432)" -"Server 2008 R2 Requred Patches","4497410","","Microsoft .NET Framework 4.8 Language Packs for Windows 7 and Server 2008 R2 (KB4497410)" -"Server 2008 R2 Requred Patches","2500170","MS11-066","Security Update for Microsoft Chart Controls for Microsoft .NET Framework 3.5 Service Pack 1 (KB2500170)" -"Server 2008 R2 Requred Patches","4499175","","2019-05 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4499175)" -"Server 2008 R2 Requred Patches","4592510","","2020-12 Servicing Stack Update for Windows Server 2008 R2 for x64-based Systems (KB4592510)" -"Server 2008 R2 Requred Patches","3102429","","Update for Windows Server 2008 R2 x64 Edition (KB3102429)" -"Server 2008 R2 Requred Patches","4575903","","2020-07 Extended Security Updates (ESU) Licensing Preparation Package for Windows Server 2008 R2 for x64-based Systems (KB4575903)" -"Server 2008 R2 Requred Patches","4561669","","2020-06 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4561669)" -"Server 2008 R2 Requred Patches","4487121","","2019-02 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 7 and Server 2008 R2 for x64 (KB4487121)" -"Server 2008 R2 Requred Patches","4345679","","2018-08 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 7 and Server 2008 R2 for x64 (KB4345679)" -"Server 2008 R2 Requred Patches","2968294","MS14-057","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2968294)" -"Server 2008 R2 Requred Patches","4471981","","2018-12 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 7 and Server 2008 R2 for x64 (KB4471981)" -"Server 2008 R2 Requred Patches","3074543","MS15-101","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB3074543)" -"Server 2008 R2 Requred Patches","4519108","","2019-10 Update for Windows Server 2008 R2 for x64-based Systems (KB4519108)" -"Server 2008 R2 Requred Patches","2840631","MS13-052","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2840631)" -"Server 2008 R2 Requred Patches","4534314","","2020-01 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4534314)" -"Server 2008 R2 Requred Patches","4041090","","2017-09 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4041090)" -"Server 2008 R2 Requred Patches","2736422","MS13-007","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2736422)" -"Server 2008 R2 Requred Patches","3097989","MS15-118","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB3097989)" -"Server 2008 R2 Requred Patches","2937610","MS14-046","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2937610)" -"Server 2008 R2 Requred Patches","3127220","MS16-019","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64 (KB3127220)" -"Server 2008 R2 Requred Patches","4571719","","2020-08 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4571719)" -"Server 2008 R2 Requred Patches","4480960","","2019-01 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4480960)" -"Server 2008 R2 Requred Patches","4474419","","2019-09 Security Update for Windows Server 2008 R2 for x64-based Systems (KB4474419)" -"Server 2008 R2 Requred Patches","4557900","","2020-05 Update for Windows Server 2008 R2 for x64-based Systems (KB4557900)" -"Server 2008 R2 Requred Patches","4550965","","2020-04 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4550965)" -"Server 2008 R2 Requred Patches","4566371","","2020-09 Update for Windows Server 2008 R2 for x64-based Systems (KB4566371)" -"Server 2008 R2 Requred Patches","3037574","MS15-041","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB3037574)" -"Server 2008 R2 Requred Patches","4520003","","2019-10 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4520003)" -"Server 2008 R2 Requred Patches","4014985","","April, 2017 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2 on Windows 7 and Windows Server 2008 R2 for x64 (KB4014985)" -"Server 2008 R2 Requred Patches","2911501","MS14-009","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2911501)" -"Server 2008 R2 Requred Patches","4507704","","2019-07 Update for Windows Server 2008 R2 for x64-based Systems (KB4507704)" -"Server 2008 R2 Requred Patches","4054530","","Microsoft .NET Framework 4.7.2 for Windows Server 2008 R2 for x64 (KB4054530)" -"Server 2008 R2 Requred Patches","4570500","","2020-08 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows Server 2008 R2 for x64 (KB4570500)" -"Server 2008 R2 Requred Patches","4586768","","2020-11 Cumulative Security Update for Internet Explorer 11 for Windows Server 2008 R2 for x64-based systems (KB4586768)" -"Server 2008 R2 Requred Patches","2861698","MS13-082","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2861698)" -"Server 2008 R2 Requred Patches","4578623","","2020-10 Update for Windows Server 2008 R2 for x64-based Systems (KB4578623)" -"Server 2008 R2 Requred Patches","4592471","","2020-12 Security Monthly Quality Rollup for Windows Server 2008 R2 for x64-based Systems (KB4592471)" -"Server 2008 R2 Requred Patches","4586805","","2020-11 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4586805)" -"Server 2008 R2 Requred Patches","4338823","","2018-07 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4338823)" -"Server 2008 R2 Requred Patches","4566466","","2020-10 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows Server 2008 R2 for x64 (KB4566466)" -"Server 2008 R2 Requred Patches","4537813","","2020-02 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4537813)" -"Server 2008 R2 Requred Patches","4490128","","2019-03 Update for Windows Server 2008 R2 for x64-based Systems (KB4490128)" -"Server 2008 R2 Requred Patches","4592503","","2020-12 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4592503)" -"Server 2008 R2 Requred Patches","4534976","","2020-01 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 7 and Server 2008 R2 for x64 (KB4534976)" -"Server 2008 R2 Requred Patches","4577053","","2020-09 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4577053)" -"Server 2008 R2 Requred Patches","4530692","","2019-12 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4530692)" -"Server 2008 R2 Requred Patches","2943357","MS14-046","Security Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2943357)" -"Server 2008 R2 Requred Patches","4489885","","2019-03 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4489885)" -"Server 2008 R2 Requred Patches","2836943","","Update for Microsoft .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 SP1 for x64-based Systems (KB2836943)" -"Server 2008 R2 Requred Patches","4556843","","2020-05 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4556843)" -"Server 2008 R2 Requred Patches","4486564","","2019-02 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4486564)" -"Server 2008 R2 Requred Patches","4498961","","2019-05 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 7 and Server 2008 R2 for x64 (KB4498961)" -"Server 2008 R2 Requred Patches","4565539","","2020-07 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4565539)" -"Server 2008 R2 Requred Patches","4055269","","2018-01 Security Only Update for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 on Windows 7 and Server 2008 R2 for x64 (KB4055269)" -"Server 2008 R2 Requred Patches","4457145","","2018-09 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4457145)" -"Server 2016 Required Patches","4576750","","2020-09 Servicing Stack Update for Windows Server 2016 for x64-based Systems (KB4576750)" -"Server 2016 Required Patches","4580325","","2020-10 Security Update for Adobe Flash Player for Windows Server 2016 for x64-based Systems (KB4580325)" -"Server 2016 Required Patches","890830","","Windows Malicious Software Removal Tool x64 - v5.84 (KB890830)" -"Server 2016 Required Patches","4593226","","2020-12 Cumulative Update for Windows Server 2016 for x64-based Systems (KB4593226)" -"Server 2019 Required Patches","4566516","","2020-07 Cumulative Update for .NET Framework 3.5, 4.7.2 and 4.8 for Windows Server 2019 for x64 (KB4566516)" -"Server 2019 Required Patches","4570505","","2020-08 Cumulative Update for .NET Framework 3.5, 4.7.2 and 4.8 for Windows Server 2019 for x64 (KB4570505)" -"Server 2019 Required Patches","4580325","","2020-10 Security Update for Adobe Flash Player for Windows Server 2019 for x64-based Systems (KB4580325)" -"Server 2019 Required Patches","890830","","Windows Malicious Software Removal Tool x64 - v5.84 (KB890830)" -"Server 2019 Required Patches","4586082","","2020-11 Cumulative Update for .NET Framework 3.5, 4.7.2 and 4.8 for Windows Server 2019 for x64 (KB4586082)" -"Server 2019 Required Patches","4587735","","2020-11 Servicing Stack Update for Windows Server 2019 for x64-based Systems (KB4587735)" -"Server 2019 Required Patches","4592440","","2020-12 Cumulative Update for Windows Server 2019 for x64-based Systems (KB4592440)" -"Server 2012 R2 Required Patches","2966826","MS14-046","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB2966826)" -"Server 2012 R2 Required Patches","4468323","","Update for Windows Server 2012 R2 (KB4468323)" -"Server 2012 R2 Required Patches","4099639","","2018-05 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 on Windows 8.1 and Server 2012 R2 for x64 (KB4099639)" -"Server 2012 R2 Required Patches","4580325","","2020-10 Security Update for Adobe Flash Player for Windows Server 2012 R2 for x64-based Systems (KB4580325)" -"Server 2012 R2 Required Patches","4556853","","2020-05 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4556853)" -"Server 2012 R2 Required Patches","3138910","MS16-027","Security Update for Windows Server 2012 R2 (KB3138910)" -"Server 2012 R2 Required Patches","3115224","","Update for Windows Server 2012 R2 (KB3115224)" -"Server 2012 R2 Required Patches","4487028","","2019-02 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4487028)" -"Server 2012 R2 Required Patches","4055271","","2018-01 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 on Windows 8.1 and Server 2012 R2 for x64 (KB4055271)" -"Server 2012 R2 Required Patches","4471983","","2018-12 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 8.1 and Server 2012 R2 for x64 (KB4471983)" -"Server 2012 R2 Required Patches","3020393","MS15-002","Security Update for Windows Server 2012 R2 (KB3020393)" -"Server 2012 R2 Required Patches","4340006","","2018-07 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 8.1 and Server 2012 R2 for x64 (KB4340006)" -"Server 2012 R2 Required Patches","3109560","MS16-007","Security Update for Windows Server 2012 R2 (KB3109560)" -"Server 2012 R2 Required Patches","2972213","MS14-053","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB2972213)" -"Server 2012 R2 Required Patches","4565540","","2020-07 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4565540)" -"Server 2012 R2 Required Patches","890830","","Windows Malicious Software Removal Tool x64 - v5.84 (KB890830)" -"Server 2012 R2 Required Patches","4019111","","May, 2017 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2 on Windows 8.1 and Windows Server 2012 R2 for x64 (KB4019111)" -"Server 2012 R2 Required Patches","3015696","","Update for Windows Server 2012 R2 (KB3015696)" -"Server 2012 R2 Required Patches","3115858","MS16-013","Security Update for Windows Server 2012 R2 (KB3115858)" -"Server 2012 R2 Required Patches","3186539","","Microsoft .NET Framework 4.7 for Windows 8.1 and Windows Server 2012 R2 for x64 (KB3186539)" -"Server 2012 R2 Required Patches","4556405","","2020-05 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4556405)" -"Server 2012 R2 Required Patches","3072307","MS15-080","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB3072307)" -"Server 2012 R2 Required Patches","4566425","","2020-07 Servicing Stack Update for Windows Server 2012 R2 for x64-based Systems (KB4566425)" -"Server 2012 R2 Required Patches","4530730","","2019-12 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4530730)" -"Server 2012 R2 Required Patches","3000483","MS15-011","Security Update for Windows Server 2012 R2 (KB3000483)" -"Server 2012 R2 Required Patches","3037576","MS15-041","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB3037576)" -"Server 2012 R2 Required Patches","4566371","","2020-09 Update for Windows Server 2012 R2 for x64-based Systems (KB4566371)" -"Server 2012 R2 Required Patches","3023219","MS15-048","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB3023219)" -"Server 2012 R2 Required Patches","4514599","","2019-09 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4514599)" -"Server 2012 R2 Required Patches","3013538","","Update for Windows Server 2012 R2 (KB3013538)" -"Server 2012 R2 Required Patches","4507704","","2019-07 Update for Windows Server 2012 R2 for x64-based Systems (KB4507704)" -"Server 2012 R2 Required Patches","4041092","","2017-09 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 8.1 and Server 2012 R2 for x64 (KB4041092)" -"Server 2012 R2 Required Patches","2968296","MS14-057","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB2968296)" -"Server 2012 R2 Required Patches","4550970","","2020-04 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4550970)" -"Server 2012 R2 Required Patches","4561673","","2020-06 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4561673)" -"Server 2012 R2 Required Patches","4503290","","2019-06 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4503290)" -"Server 2012 R2 Required Patches","2894852","","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB2894852)" -"Server 2012 R2 Required Patches","4557900","","2020-05 Update for Windows Server 2012 R2 for x64-based Systems (KB4557900)" -"Server 2012 R2 Required Patches","4576489","","2020-09 Security Only Update for .NET Framework 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4576489)" -"Server 2012 R2 Required Patches","4577071","","2020-09 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4577071)" -"Server 2012 R2 Required Patches","4507457","","2019-07 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4507457)" -"Server 2012 R2 Required Patches","4501226","","2019-05 Update for Windows Server 2012 R2 for x64-based Systems (KB4501226)" -"Server 2012 R2 Required Patches","4592484","","2020-12 Security Monthly Quality Rollup for Windows Server 2012 R2 for x64-based Systems (KB4592484)" -"Server 2012 R2 Required Patches","2973114","MS14-053","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB2973114)" -"Server 2012 R2 Required Patches","3134813","","Update for Windows Server 2012 R2 (KB3134813)" -"Server 2012 R2 Required Patches","4499165","","2019-05 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4499165)" -"Server 2012 R2 Required Patches","3097992","MS15-118","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB3097992)" -"Server 2012 R2 Required Patches","4541505","","2020-03 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4541505)" -"Server 2012 R2 Required Patches","4462930","","Update for Adobe Flash Player for Windows Server 2012 R2 (KB4462930)" -"Server 2012 R2 Required Patches","4033369","","Microsoft .NET Framework 4.7.1 for Windows 8.1 and Windows Server 2012 R2 for x64 (KB4033369)" -"Server 2012 R2 Required Patches","4493467","","2019-04 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4493467)" -"Server 2012 R2 Required Patches","2982998","MS14-076","Security Update for Windows Server 2012 R2 (KB2982998)" -"Server 2012 R2 Required Patches","3074545","MS15-101","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB3074545)" -"Server 2012 R2 Required Patches","4507413","","2019-07 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4507413)" -"Server 2012 R2 Required Patches","4586085","","2020-11 Security and Quality Rollup for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4586085)" -"Server 2012 R2 Required Patches","4534978","","2020-01 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4534978)" -"Server 2012 R2 Required Patches","4586823","","2020-11 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4586823)" -"Server 2012 R2 Required Patches","3138962","MS16-027","Security Update for Windows Server 2012 R2 (KB3138962)" -"Server 2012 R2 Required Patches","3127222","MS16-019","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64 (KB3127222)" -"Server 2012 R2 Required Patches","4525250","","2019-11 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4525250)" -"Server 2012 R2 Required Patches","4586768","","2020-11 Cumulative Security Update for Internet Explorer 11 for Windows Server 2012 R2 for x64-based systems (KB4586768)" -"Server 2012 R2 Required Patches","4487123","","2019-02 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 8.1 and Server 2012 R2 for x64 (KB4487123)" -"Server 2012 R2 Required Patches","3018133","","Update for Windows Server 2012 R2 (KB3018133)" -"Server 2012 R2 Required Patches","4578623","","2020-10 Update for Windows Server 2012 R2 for x64-based Systems (KB4578623)" -"Server 2012 R2 Required Patches","4534309","","2020-01 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4534309)" -"Server 2012 R2 Required Patches","4486459","","2019-02 Update for Windows Server 2012 R2 for x64-based Systems (KB4486459)" -"Server 2012 R2 Required Patches","4054566","","Microsoft .NET Framework 4.7.2 for Windows Server 2012 R2 for x64 (KB4054566)" -"Server 2012 R2 Required Patches","4592495","","2020-12 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4592495)" -"Server 2012 R2 Required Patches","4512489","","2019-08 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4512489)" -"Server 2012 R2 Required Patches","4498963","","2019-05 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4498963)" -"Server 2012 R2 Required Patches","4467703","","2018-11 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4467703)" -"Server 2012 R2 Required Patches","4519108","","2019-10 Update for Windows Server 2012 R2 for x64-based Systems (KB4519108)" -"Server 2012 R2 Required Patches","4490128","","2019-03 Update for Windows Server 2012 R2 for x64-based Systems (KB4490128)" -"Server 2012 R2 Required Patches","4345681","","2018-08 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 8.1 and Server 2012 R2 for x64 (KB4345681)" -"Server 2012 R2 Required Patches","4570502","","2020-08 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4570502)" -"Server 2012 R2 Required Patches","4516064","","2019-09 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4516064)" -"Server 2012 R2 Required Patches","4566468","","2020-10 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4566468)" -"Server 2012 R2 Required Patches","3138378","","Update for Windows Server 2012 R2 (KB3138378)" -"Server 2012 R2 Required Patches","4462901","","Update for Windows Server 2012 R2 (KB4462901)" -"Server 2012 R2 Required Patches","2966828","MS14-046","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB2966828)" -"Server 2012 R2 Required Patches","4486105","","Microsoft .NET Framework 4.8 for Windows Server 2012 R2 for x64 (KB4486105)" -"Server 2012 R2 Required Patches","3134179","","Update for Windows Server 2012 R2 (KB3134179)" -"Server 2012 R2 Required Patches","4339284","","Update for Windows Server 2012 R2 (KB4339284)" -"Server 2012 R2 Required Patches","4537803","","2020-02 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4537803)" -"Server 2012 R2 Required Patches","4489883","","2019-03 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4489883)" -"Server 2012 R2 Required Patches","4014987","","April, 2017 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2 on Windows 8.1 and Windows Server 2012 R2 for x64 (KB4014987)" -"Server 2012 R2 Required Patches","4519990","","2019-10 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4519990)" -"Server 2012 R2 Required Patches","3005628","","Update for Microsoft .NET Framework 3.5 for x64-based Systems (KB3005628)" -"Server 2012 R2 Required Patches","3076949","MS15-089","Security Update for Windows Server 2012 R2 (KB3076949)" -"Server 2012 R2 Required Patches","4580358","","2020-10 Security Only Quality Update for Windows Server 2012 R2 for x64-based Systems (KB4580358)" -"Server 2012 R2 Required Patches","4489488","","2019-03 Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 for Windows 8.1 and Server 2012 R2 for x64 (KB4489488)" -"Server 2012 R2 Required Patches","3012235","","Update for Windows Server 2012 R2 (KB3012235)" -"Server 2012 R2 Required Patches","4580469","","2020-10 Security Only Update for .NET Framework 3.5, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 8.1 and Server 2012 R2 for x64 (KB4580469)" -"Server 2012 R2 Required Patches","2972103","MS14-057","Security Update for Microsoft .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2 for x64-based Systems (KB2972103)" -"Server 2012 R2 Required Patches","3013531","","Update for Windows Server 2012 R2 (KB3013531)" diff --git a/dump/Files/Production-Patching-minus-DO-NOT-PATCH.csv b/dump/Files/Production-Patching-minus-DO-NOT-PATCH.csv deleted file mode 100644 index 9bab88a..0000000 --- a/dump/Files/Production-Patching-minus-DO-NOT-PATCH.csv +++ /dev/null @@ -1,637 +0,0 @@ -server -W2012A -W2012B -Q1NCRAFILE001 -DFNP014 -DAPCAC002 -DAPCAV001 -DAPVRNS001 -DGAW001 -DWAM002 -DIAP001 -DWHD003 -DCTI001 -DVB6001 -DFNP009 -DVCO001 -DBIT901 -DFNP020 -DAPP011 -DMHB001 -QRSH023 -QRSH022 -QRSH021 -DCAM011 -DCIC011 -DCIC012 -DSPUPG2010 -DOSM012 -DOSM011 -DMDA011 -DICW011 -DTABL001 -DSIS002 -DOWA001 -DBIZ111 -DBIZ112 -DBIZ113 -DUTL012 -DWAM001 -DSRS004 -DSSS001 -DSQL009 -DSQL021 -DSIS004 -QRSH002 -QRSH041 -QRSH051 -QRSH001 -QRSH031 -QAPP041 -DEDI111 -DEDI112 -DEDI113 -QRSH111 -DSQL027A -DSQL027B -DSRS005 -DSQL000 -DSQL030 -DSQL004 -DSQL029 -DSIS005 -DSQL031 -DSIS003 -DNCRASSIS001 -DSQL028 -DSQL021Q -DSQL024 -DNCRASPWFE01 -DNCRASPAS01 -QAPP031 -QNCRASPAPP01 -QNCRASPDC01 -QNCRASPAPP02 -QNCRASPWFE01 -QNCRASPWFE02 -QNCRASPDC02 -QNCRASPSEA01 -QNCRASPSEA02 -QRDS002 -QMHB003 -QMHB004 -QRDS001 -QAPP051 -QMHB001 -QMFT001 -QBIZ151 -QBIZ152 -Q1SQL024 -QAPP011 -QNCRASPOOS01 -DNCRASPOOS01 -QRSH101 -QSCH012 -QDRF001 -QFNP008 -Q2NCRAFILE001 -Q3NCRAFILE001 -QMHB002 -QSRS004 -QFNP007 -QSQL029 -QSQL030 -Q5NCRAFILE001 -QADF001 -QTABL001 -Q4NCRAFILE001 -QFNP009 -QSCH011 -QSQL028 -QAPP021 -QSCH014 -QFNP001 -QSCH013 -PQRSH001 -QVST012 -QVST011 -QSIS003 -PNCRAVPRXY001 -PIAP002 -PKEY003 -PMON005 -PNCRAVERIDX002 -PNCRAVERIDX005 -PNCRAVERDA001 -PNCRAVERVLT002 -PNCRAVERVLT001 -PNCRAVERIDX004 -PNCRAVERIDX001 -PNCRAVERIDX003 -PSEV013 -PSEV011 -PALT001 -NYMEPALT001 -AZPHPALT001 -PSEV012 -PADM001 -PSEV014 -KSOPPALT001 -PRSH027 -PRSH019 -PRSH011 -PUTL005 -PSEV010 -PICW011 -PVEO002 -PIAP001 -PKEY002 -PNCRAVERVLT003 -PSEV024 -PSNX001 -PSEV022 -PNCRAWINAUTO001 -PUTL011 -PSSP004 -PVRS012 -PCAC002 -PDRF001 -PRSH020 -PRSH021 -PAAD001 -PIAM001 -PAPCAV001 -PRSH023 -PSSP002 -PMON010 -PRSH010 -PRSH024 -PRSH008 -PRSH001 -PRSH006 -PRSH000 -PRSH009 -PRSH005 -PRSH003 -PRSH004 -PRSH002 -PRSH007 -PRSH022 -PRSH014 -PRSH012 -PRSH016 -PRSH015 -PRSH018 -PRSH017 -PRSH013 -PFAX021 -PVEO001 -PNCRAVPRXY002 -PFAX022 -CTHAPALT001 -PSEV015 -PUTL006 -PVET001 -PDEP001 -PRSH028 -PCAC001 -PRSH052 -PRSH030 -PRSH025 -PRSH029 -PMON009 -PRSH026 -PSSP001 -PAPCAC002 -PIAC001 -PNCRANTRX002 -PRSH172 -PIWM002 -PFNP009 -PDOC001 -PEDI114 -PRSH054 -PRSH051 -PWHD003 -PRSH174 -PBIZ125 -PBIZ121 -PFNP010 -PRSH171 -PNCRAFILE003 -PSUF002 -PPCH001 -PRSH059 -PBIZ112 -PSSS001 -PPCS001 -PSKY001 -PSQL022B -PTTS011 -PFNP006 -PFNP013 -PSQL013 -PALM001 -PGAW001 -PWHD004 -PNCRAFILE007 -PSUF001 -PEDI111 -PEZP001 -PNCRANTRX001 -PMON006 -PEDI112 -PVER001 -PSQL015 -PADF003 -PVEB001 -PSQL026 -PBIZ126 -PADF002 -PFNP011 -PFNP002 -POWA001 -PSQL030A -PSQL029A -PSQL016 -PRDS001 -PRSH176 -PRSH056 -PRSH057 -PBIZ124 -PSQL010 -PMON011 -PBIZ111 -PMON002 -PFNP008 -PSSP003 -PRSH152 -PMHB002 -PAPJNKSSLA201 -PTABL001 -PCCR001 -PEDI116 -PDMC005 -PSNW001 -PSLK001 -PDMC003 -PRSH161 -PSKY003 -PDMC002 -PDMC001 -PDMC004 -PVRS011 -PAPSEP001 -CTHAPDMC001 -PDMC006 -CTSTPDMC001 -PBIZ123 -FLT2PTTS011 -FLT2PDMC001 -AZPHPDMC001 -FLT2PDMC002 -KSOPPDMC001 -NYMEPDMC001 -PRSH175 -PRSH151 -PSQL030B -PMHB001 -PVST001 -PIQV001 -PSQL009 -PFNP015 -PSQL025 -PRSH173 -PBIZ122 -PPDQ001 -PVST002 -PRSH053 -PSQL029B -PRSH038 -PRSH039 -PRSH033 -PRSH031 -PRSH035 -PRSH032 -PVSS012 -PDFS001 -PDFS003 -PIAM002 -PSQL021 -PRDS002 -PRSH037 -PRSH034 -PFNP016 -PVAV001 -PFNP017 -PFNP012 -PNCRAMSMQ001 -PRSH036 -PFNP018 -PNCRAFILE001 -PIWM001 -PAPP011 -PDFS002 -PSQL028A -PRSH040 -PVAV002 -PVAV003 -PFNP019 -PNCRAFILE005 -PSIS002 -FLT2PSQL021 -PAPP001 -PFNP007 -PNCRARCM001 -AZPHPRCS011 -CTHAPRCS011 -CTHAPALT002 -CTSTPALT001 -PPKI004 -PMON007 -PVSS011 -PFNP003 -PEDI113 -DPOCSP001 -PVVC012 -PVVC014 -PVVC013 -QRSH113 -Q5SQL022 -QUTL012 -Q4SQL024 -QFNP003 -QBIZ121 -QBIZ132 -QEDI153 -PQRDS001 -QEDI113 -QRSH112 -QBIZ131 -QSIS002 -QBIZ122 -QVST021 -QEDI152 -QEDI111 -QVST022 -QEDI151 -QEDI112 -Q1SQL022 -PAPJNKSSLA202 -PUTL012 -PVVC015 -PVVC016 -QBIZ112 -QBIZ111 -Q2SQL022 -Q3SQL022 -Q4SQL022B -Q4SQL022 -POSM014 -PSQL022 -PCIC011 -PIMQ011 -PRSH050 -PMDA011 -PISR011 -PSRS004 -PMDA014 -PSQL014 -PRSH055 -PMDA012 -PMDA013 -PRSH058 -PRSH162 -FLT2PCIC011 -PBIT901 -PIWC012 -FLT2POSM012 -POSM012 -PIWC011 -FLT2POSM013 -PVVC011 -PRSH101 -QBIZ142 -FLT2PMDA011 -FLT2POSM011 -FLT2PMDA012 -FLT2POSM014 -FLT2PICW011 -FLT2PMDA013 -FLT2PMDA014 -PRCS012 -POSM011 -POSM013 -DIWC011 -PRCS011 -PSQL024 -PDISKTEST1 -PMDA016 -FLT2PCAC001 -PMDA015 -PMDA017 -FLT2PALT001 -POSM016 -FLT2PCAC002 -POSM015 -PSQL012 -FLT2PRCS011 -FLT2PMDA017 -FLT2PMDA015 -FLT2PMDA016 -KSOPPRCS011 -PEDI115 -PRSH102 -DVST001 -QBIZ141 -PIPM001 -DRCS011 -QSNX001 -PJMP001 -PAPCAC001 -DNCRAAUTO006 -PSQL027 -PSUS001 -PNCRAVERRRPT001 -PSIS003 -PSQL028Q -PSQL028B -PSQL030Q -QNCRASCCM001 -QQATEST01 -PVAPV002 -PSEC003 -PVAPV003 -PVAPV001 -PSQL029Q -PVVCO005 -PVVCO006 -PVVCO002 -PICO001 -PVVCO003 -PNCRALSWMON001 -PVVCO004 -PNCRANTRX004 -PNCRAVERVLT004 -FLT2VEB002 -FLT2VEB003 -S16NCRASRV00001 -PNCRAVONE01 -DSPUPG2013 -DAPP012 -DDOC001 -DAPCAC001 -DFNP001 -DFAX011 -DAPP006 -DFNP002 -DAPSEP001 -PNCRASCCMWKDP03 -PNCRASCCMWSP2 -PNCRASCCMWKDP02 -PNCRASCCMWSP3 -PNCRASMTP02 -PNCRASMTP01 -PNCRAADMIN01 -PVVCO001 -PFNP005 -PFNP001 -PNCRACS01 -QNCRACS01 -DNCRACS01 -PNCRAMEP01 -DNCRAMEP01 -PNCRAEXMBX005 -DNCRAFILETEST01 -PPKI003 -PSQL008 -PAPP002 -QAPP005 -PSEV005 -PSEV002 -PVEP001 -PRSH181 -PRSH150 -PVCO001 -PRSH182 -QAPP002 -DFNP011 -DHIL001 -QAPP010 -PSEV021 -PRSH049 -PRSH060 -PDRDS001 -PSQL023 -PSQL023B -PSEV017 -PFNP014 -DAPP001-2012R2 -PSEV023 -DOIT001 -PVRT006 -PVRT003 -PVRT004 -PVRT001 -PVRT005 -PVRT002 -PFAX014 -PFAX013 -PFAX012 -PFAX011 -PVRT007 -FLT2PVRT007 -DVVC002 -DVVC001 -CTHAPVRT007 -AZPHPVRT007 -KSOPPVRT007 -PSQL026B -PSQLCL26 -PRMS002 -PRMS001 -PVER005 -Q2FNP003 -Q5FNP003 -Q1FNP003 -Q4FNP003 -Q3FNP003 -QDNS001 -PMQS001 -QCMX001 -psql029cl -psql028cl -PNTX001 -PCMX001 -DMQS001 -FLT2VEB001 -psql030cl -DRSQL003 -DRSQL002 -DRRDS001 -DRTEST001 -DRRDS002 -dsql02130cl -DMS3001 -PNCRASPOWA01 -I3-PROD-LIS -PNCRASMI01 -DNCRAAUTO004 -DNCRAAUTO003 -DSPC001 -DFAX001 -DWHD004 -GOLD-S16-INSTAN -DVRS001 -DFAX002 -DVVC003 -FLT2PDEP001 -DVVC004 -DSTMN001 -DNCRATESTVM2 -PADS001 -NPTEST1 -PSCH014-TEST -PVEP602 -PWAP002-0 -PSQL000 -PSEV006 -PVEP601 -PFAX011CAP -PSCH011-TEST -PVEP604 -PMFT001 -PFAX015 -PDOMS001 -PVEP603 -PWAP001-0 -TESTVM6 -TEST -QBIZ100 -PNCRAMEDI001 -TEMPDC004 -TEMPDC006 -TEMPNETWRIX -DSTEA001 -DSACS001 -DSBAMCS001 -PNCRAWFM01 -DSNX001 -CLVA1PFNP005 -CLVA1PFNP003 -CLVA1PFNP006 -CLVA1PEXM001 -CLVA1PFNP007 -CLVA1PFNP001 -CLVA1PFNP002 -CLVA1PDMC001 -DSPUPG2016 -DRSQL028 -PNCRAFILE004 -QNCRAMEP01 -PNCRAPROSPD01 -PNFP012A -PNFP011A -PFNP003A -PFNP001A -PEXM004 diff --git a/dump/Files/Servers-Not-In-Patching-Group-UPDATED.csv b/dump/Files/Servers-Not-In-Patching-Group-UPDATED.csv deleted file mode 100644 index 6420add..0000000 --- a/dump/Files/Servers-Not-In-Patching-Group-UPDATED.csv +++ /dev/null @@ -1,301 +0,0 @@ -"PSComputerName","caption" -"W2012A","Microsoft Windows Server 2012 R2 Standard" -"W2012B","Microsoft Windows Server 2012 R2 Standard" -"Q1NCRAFILE001","Microsoft Windows Server 2019 Standard" -"DFNP014","Microsoft Windows Server 2016 Standard" -"DAPCAC002","Microsoft Windows Server 2016 Standard" -"DAPCAV001","Microsoft Windows Server 2016 Standard" -"DAPVRNS001","Microsoft Windows Server 2012 R2 Standard" -"DGAW001","Microsoft Windows Server 2016 Standard" -"DWAM002","Microsoft Windows Server 2012 R2 Standard" -"DIAP001","Microsoft Windows Server 2012 R2 Standard" -"DWHD003","Microsoft Windows Server 2012 R2 Standard" -"DCTI001","Microsoft Windows Server 2012 R2 Standard" -"DVB6001","Microsoft Windows Server 2012 R2 Standard" -"DFNP009","Microsoft Windows Server 2012 R2 Standard" -"DBIT901","Microsoft Windows Server 2012 R2 Standard" -"DFNP020","Microsoft Windows Server 2012 R2 Standard" -"DAPP011","Microsoft Windows Server 2012 R2 Standard" -"DMHB001","Microsoft Windows Server 2012 R2 Standard" -"QRSH023","Microsoft Windows Server 2012 R2 Standard" -"QRSH022","Microsoft Windows Server 2012 R2 Standard" -"QRSH021","Microsoft Windows Server 2012 R2 Standard" -"DCAM011","Microsoft Windows Server 2012 R2 Standard" -"DCIC011","Microsoft Windows Server 2012 R2 Standard" -"DCIC012","Microsoft Windows Server 2012 R2 Standard" -"DSPUPG2010","Microsoft Windows Server 2012 R2 Standard" -"DOSM012","Microsoft Windows Server 2012 R2 Standard" -"DOSM011","Microsoft Windows Server 2012 R2 Standard" -"DMDA011","Microsoft Windows Server 2012 R2 Standard" -"DICW011","Microsoft Windows Server 2012 R2 Standard" -"DTABL001","Microsoft Windows Server 2012 R2 Standard" -"DSIS002","Microsoft Windows Server 2012 R2 Standard" -"DOWA001","Microsoft Windows Server 2012 R2 Standard" -"DBIZ111","Microsoft Windows Server 2012 R2 Standard" -"DBIZ112","Microsoft Windows Server 2012 R2 Standard" -"DBIZ113","Microsoft Windows Server 2012 R2 Standard" -"DUTL012","Microsoft Windows Server 2016 Standard" -"DWAM001","Microsoft Windows Server 2012 R2 Standard" -"DSRS004","Microsoft Windows Server 2012 R2 Standard" -"DSSS001","Microsoft Windows Server 2012 R2 Standard" -"DSQL009","Microsoft Windows Server 2012 R2 Standard" -"DSQL021","Microsoft Windows Server 2012 R2 Standard" -"DSIS004","Microsoft Windows Server 2016 Standard" -"QRSH002","Microsoft Windows Server 2012 R2 Standard" -"QRSH041","Microsoft Windows Server 2012 R2 Standard" -"QRSH051","Microsoft Windows Server 2012 R2 Standard" -"QRSH001","Microsoft Windows Server 2012 R2 Standard" -"QRSH031","Microsoft Windows Server 2012 R2 Standard" -"QAPP041","Microsoft Windows Server 2012 R2 Standard" -"DEDI111","Microsoft Windows Server 2012 R2 Standard" -"DEDI112","Microsoft Windows Server 2012 R2 Standard" -"DEDI113","Microsoft Windows Server 2012 R2 Standard" -"QRSH111","Microsoft Windows Server 2012 R2 Standard" -"DSQL027A","Microsoft Windows Server 2016 Standard" -"DSQL027B","Microsoft Windows Server 2016 Standard" -"DSRS005","Microsoft Windows Server 2016 Standard" -"DSQL000","Microsoft Windows Server 2016 Standard" -"DSQL030","Microsoft Windows Server 2016 Standard" -"DSQL004","Microsoft Windows Server 2016 Standard" -"DSQL029","Microsoft Windows Server 2016 Standard" -"DSIS005","Microsoft Windows Server 2016 Standard" -"DSQL031","Microsoft Windows Server 2016 Standard" -"DSIS003","Microsoft Windows Server 2016 Standard" -"DNCRASSIS001","Microsoft Windows Server 2019 Standard" -"DSQL028","Microsoft Windows Server 2016 Standard" -"DSQL021Q","Microsoft Windows Server 2019 Standard" -"DSQL024","Microsoft Windows Server 2012 R2 Standard" -"DNCRASPWFE01","Microsoft Windows Server 2019 Standard" -"DNCRASPAS01","Microsoft Windows Server 2019 Standard" -"QAPP031","Microsoft Windows Server 2012 R2 Standard" -"QNCRASPAPP01","Microsoft Windows Server 2019 Standard" -"QNCRASPDC01","Microsoft Windows Server 2019 Standard" -"QNCRASPAPP02","Microsoft Windows Server 2019 Standard" -"QNCRASPWFE01","Microsoft Windows Server 2019 Standard" -"QNCRASPWFE02","Microsoft Windows Server 2019 Standard" -"QNCRASPDC02","Microsoft Windows Server 2019 Standard" -"QNCRASPSEA01","Microsoft Windows Server 2019 Standard" -"QNCRASPSEA02","Microsoft Windows Server 2019 Standard" -"QRDS002","Microsoft Windows Server 2012 R2 Standard" -"QMHB003","Microsoft Windows Server 2012 R2 Standard" -"QMHB004","Microsoft Windows Server 2012 R2 Standard" -"QRDS001","Microsoft Windows Server 2012 R2 Standard" -"QAPP051","Microsoft Windows Server 2012 R2 Standard" -"QMHB001","Microsoft Windows Server 2012 R2 Standard" -"QMFT001","Microsoft Windows Server 2012 R2 Standard" -"QBIZ151","Microsoft Windows Server 2012 R2 Standard" -"QBIZ152","Microsoft Windows Server 2012 R2 Standard" -"Q1SQL024","Microsoft Windows Server 2012 R2 Standard" -"QAPP011","Microsoft Windows Server 2012 R2 Standard" -"QNCRASPOOS01","Microsoft Windows Server 2016 Standard" -"DNCRASPOOS01","Microsoft Windows Server 2016 Standard" -"QRSH101","Microsoft Windows Server 2012 R2 Standard" -"QSCH012","Microsoft Windows Server 2012 R2 Standard" -"QDRF001","Microsoft Windows Server 2012 R2 Standard" -"QFNP008","Microsoft Windows Server 2012 R2 Standard" -"Q2NCRAFILE001","Microsoft Windows Server 2019 Standard" -"Q3NCRAFILE001","Microsoft Windows Server 2019 Standard" -"QMHB002","Microsoft Windows Server 2012 R2 Standard" -"QSRS004","Microsoft Windows Server 2012 R2 Standard" -"QFNP007","Microsoft Windows Server 2012 R2 Standard" -"QSQL029","Microsoft Windows Server 2016 Standard" -"QSQL030","Microsoft Windows Server 2016 Standard" -"Q5NCRAFILE001","Microsoft Windows Server 2019 Standard" -"QADF001","Microsoft Windows Server 2016 Standard" -"QTABL001","Microsoft Windows Server 2012 R2 Standard" -"Q4NCRAFILE001","Microsoft Windows Server 2019 Standard" -"QFNP009","Microsoft Windows Server 2012 R2 Standard" -"QSCH011","Microsoft Windows Server 2012 R2 Standard" -"QSQL028","Microsoft Windows Server 2016 Standard" -"QAPP021","Microsoft Windows Server 2012 R2 Standard" -"QSCH014","Microsoft Windows Server 2012 R2 Standard" -"QFNP001","Microsoft Windows Server 2012 R2 Standard" -"QSCH013","Microsoft Windows Server 2012 R2 Standard" -"QVST012","Microsoft Windows Server 2012 R2 Standard" -"QVST011","Microsoft Windows Server 2012 R2 Standard" -"QSIS003","Microsoft Windows Server 2016 Standard" -"PNCRAVPRXY001","Microsoft Windows Server 2019 Standard" -"PMON005","Microsoft Windows Server 2016 Standard" -"PNCRAVERVLT001","Microsoft Windows Server 2016 Standard" -"PICW011","Microsoft Windows Server 2012 R2 Standard" -"PMON010","Microsoft Windows Server 2016 Standard" -"PNCRAVPRXY002","Microsoft Windows Server 2019 Standard" -"PVET001","Microsoft Windows Server 2016 Standard" -"PMON009","Microsoft Windows Server 2016 Standard" -"PNCRANTRX002","Microsoft Windows Server 2016 Standard" -"PSSS001","Microsoft Windows Server 2012 R2 Standard" -"PTTS011","Microsoft Windows Server 2012 R2 Standard" -"PVER001","Microsoft Windows Server 2019 Standard" -"PVEB001","Microsoft Windows Server 2012 R2 Standard" -"PMON011","Microsoft Windows Server 2016 Standard" -"PDMC005","Microsoft Windows Server 2019 Standard" -"PDMC003","Microsoft Windows Server 2012 R2 Standard" -"PDMC003","Microsoft Windows Server 2012 R2 Standard" -"PDMC004","Microsoft Windows Server 2012 R2 Standard" -"PDMC006","Microsoft Windows Server 2012 R2 Standard" -"CTSTPDMC001","Microsoft Windows Server 2012 R2 Standard" -"FLT2PTTS011","Microsoft Windows Server 2012 R2 Standard" -"FLT2PDMC001","Microsoft Windows Server 2012 R2 Standard" -"FLT2PDMC002","Microsoft Windows Server 2012 R2 Standard" -"KSOPPDMC001","Microsoft Windows Server 2012 R2 Standard" -"NYMEPDMC001","Microsoft Windows Server 2012 R2 Standard" -"PVAV001","Microsoft Windows Server 2012 R2 Standard" -"PVAV002","Microsoft Windows Server 2016 Standard" -"PVAV003","Microsoft Windows Server 2016 Standard" -"AZPHPRCS011","Microsoft Windows Server 2012 R2 Standard" -"CTHAPRCS011","Microsoft Windows Server 2012 R2 Standard" -"CTHAPALT002","Microsoft Windows Server 2012 R2 Standard" -"CTSTPALT001","Microsoft Windows Server 2012 R2 Standard" -"PFNP003","Microsoft? Windows Server? 2008 Enterprise " -"DPOCSP001","Microsoft Windows Server 2019 Standard" -"PVVC012","Microsoft Windows Server 2012 R2 Standard" -"PVVC014","Microsoft Windows Server 2012 R2 Standard" -"PVVC013","Microsoft Windows Server 2012 R2 Standard" -"QRSH113","Microsoft Windows Server 2012 R2 Standard" -"Q5SQL022","Microsoft Windows Server 2012 R2 Standard" -"QUTL012","Microsoft Windows Server 2016 Standard" -"Q4SQL024","Microsoft Windows Server 2012 R2 Standard" -"QFNP003","Microsoft Windows Server 2012 R2 Standard" -"QBIZ121","Microsoft Windows Server 2012 R2 Standard" -"QBIZ132","Microsoft Windows Server 2012 R2 Standard" -"QEDI153","Microsoft Windows Server 2012 R2 Standard" -"QEDI113","Microsoft Windows Server 2012 R2 Standard" -"QRSH112","Microsoft Windows Server 2012 R2 Standard" -"QBIZ131","Microsoft Windows Server 2012 R2 Standard" -"QSIS002","Microsoft Windows Server 2012 R2 Standard" -"QBIZ122","Microsoft Windows Server 2012 R2 Standard" -"QVST021","Microsoft Windows Server 2012 R2 Standard" -"QEDI152","Microsoft Windows Server 2012 R2 Standard" -"QEDI111","Microsoft Windows Server 2012 R2 Standard" -"QVST022","Microsoft Windows Server 2012 R2 Standard" -"QEDI151","Microsoft Windows Server 2012 R2 Standard" -"QEDI112","Microsoft Windows Server 2012 R2 Standard" -"Q1SQL022","Microsoft Windows Server 2012 R2 Standard" -"PVVC015","Microsoft Windows Server 2012 R2 Standard" -"PVVC016","Microsoft Windows Server 2012 R2 Standard" -"QBIZ112","Microsoft Windows Server 2012 R2 Standard" -"QBIZ111","Microsoft Windows Server 2012 R2 Standard" -"Q2SQL022","Microsoft Windows Server 2012 R2 Standard" -"Q3SQL022","Microsoft Windows Server 2012 R2 Standard" -"Q4SQL022B","Microsoft Windows Server 2012 R2 Standard" -"Q4SQL022","Microsoft Windows Server 2012 R2 Standard" -"POSM014","Microsoft Windows Server 2012 R2 Standard" -"PCIC011","Microsoft Windows Server 2012 R2 Standard" -"PIMQ011","Microsoft Windows Server 2012 R2 Standard" -"PMDA011","Microsoft Windows Server 2012 R2 Standard" -"PISR011","Microsoft Windows Server 2012 R2 Standard" -"PSRS004","Microsoft Windows Server 2012 R2 Standard" -"PMDA014","Microsoft Windows Server 2012 R2 Standard" -"PSQL014","Microsoft Windows Server 2012 R2 Standard" -"PMDA012","Microsoft Windows Server 2012 R2 Standard" -"PMDA013","Microsoft Windows Server 2012 R2 Standard" -"FLT2PCIC011","Microsoft Windows Server 2012 R2 Standard" -"PBIT901","Microsoft Windows Server 2012 R2 Standard" -"PIWC012","Microsoft Windows Server 2012 R2 Standard" -"FLT2POSM012","Microsoft Windows Server 2012 R2 Standard" -"POSM012","Microsoft Windows Server 2012 R2 Standard" -"PIWC011","Microsoft Windows Server 2012 R2 Standard" -"FLT2POSM013","Microsoft Windows Server 2012 R2 Standard" -"PVVC011","Microsoft Windows Server 2012 R2 Standard" -"PRSH101","Microsoft Windows Server 2012 R2 Standard" -"QBIZ142","Microsoft Windows Server 2012 R2 Standard" -"FLT2PMDA011","Microsoft Windows Server 2012 R2 Standard" -"FLT2POSM011","Microsoft Windows Server 2012 R2 Standard" -"FLT2PMDA012","Microsoft Windows Server 2012 R2 Standard" -"FLT2POSM014","Microsoft Windows Server 2012 R2 Standard" -"FLT2PICW011","Microsoft Windows Server 2012 R2 Standard" -"FLT2PMDA013","Microsoft Windows Server 2012 R2 Standard" -"FLT2PMDA014","Microsoft Windows Server 2012 R2 Standard" -"PRCS012","Microsoft Windows Server 2012 R2 Standard" -"POSM011","Microsoft Windows Server 2012 R2 Standard" -"POSM013","Microsoft Windows Server 2012 R2 Standard" -"DIWC011","Microsoft Windows Server 2012 R2 Standard" -"PRCS011","Microsoft Windows Server 2012 R2 Standard" -"PSQL024","Microsoft Windows Server 2012 R2 Standard" -"PDISKTEST1","Microsoft Windows Server 2012 R2 Standard" -"PMDA016","Microsoft Windows Server 2012 R2 Standard" -"FLT2PCAC001","Microsoft Windows Server 2012 R2 Standard" -"PMDA015","Microsoft Windows Server 2012 R2 Standard" -"PMDA017","Microsoft Windows Server 2012 R2 Standard" -"FLT2PALT001","Microsoft Windows Server 2012 R2 Standard" -"POSM016","Microsoft Windows Server 2012 R2 Standard" -"FLT2PCAC002","Microsoft Windows Server 2012 R2 Standard" -"POSM015","Microsoft Windows Server 2012 R2 Standard" -"PSQL012","Microsoft Windows Server 2012 R2 Standard" -"FLT2PRCS011","Microsoft Windows Server 2012 R2 Standard" -"FLT2PMDA017","Microsoft Windows Server 2012 R2 Standard" -"FLT2PMDA015","Microsoft Windows Server 2012 R2 Standard" -"FLT2PMDA016","Microsoft Windows Server 2012 R2 Standard" -"KSOPPRCS011","Microsoft Windows Server 2012 R2 Standard" -"PRSH102","Microsoft Windows Server 2012 R2 Standard" -"DVST001","Microsoft Windows Server 2012 R2 Standard" -"QBIZ141","Microsoft Windows Server 2012 R2 Standard" -"DRCS011","Microsoft Windows Server 2012 R2 Standard" -"QSNX001","Microsoft Windows Server 2012 R2 Standard" -"PAPCAC001","Microsoft Windows Server 2016 Standard" -"DNCRAAUTO006","Microsoft Windows Server 2016 Standard" -"PSQL027","Microsoft Windows Server 2016 Standard" -"PSUS001","Microsoft Windows Server 2016 Standard" -"PNCRAVERRRPT001","Microsoft Windows Server 2016 Standard" -"PSIS003","Microsoft Windows Server 2016 Standard" -"PSQL028Q","Microsoft Windows Server 2019 Standard" -"PSQL030Q","Microsoft Windows Server 2019 Standard" -"QNCRASCCM001","Microsoft Windows Server 2019 Standard" -"PVAPV002","Microsoft Windows Server 2019 Standard" -"PSEC003","Microsoft Windows Server 2019 Standard" -"PVAPV003","Microsoft Windows Server 2019 Standard" -"PVAPV001","Microsoft Windows Server 2019 Standard" -"PSQL029Q","Microsoft Windows Server 2019 Standard" -"PVVCO005","Microsoft Windows Server 2019 Standard" -"PVVCO006","Microsoft Windows Server 2019 Standard" -"PVVCO002","Microsoft Windows Server 2019 Standard" -"PVVCO003","Microsoft Windows Server 2019 Standard" -"PNCRALSWMON001","Microsoft Windows Server 2019 Standard" -"PVVCO004","Microsoft Windows Server 2019 Standard" -"PNCRANTRX004","Microsoft Windows Server 2019 Standard" -"PNCRAVERVLT004","Microsoft Windows Server 2016 Standard" -"FLT2VEB002","Microsoft Windows Server 2019 Standard" -"FLT2VEB003","Microsoft Windows Server 2016 Standard" -"S16NCRASRV00001","Microsoft Windows Server 2016 Standard" -"PNCRAVONE01","Microsoft Windows Server 2019 Standard" -"DSPUPG2013","Microsoft Windows Server 2012 R2 Standard" -"DAPP012","Microsoft Windows Server 2012 R2 Standard" -"DDOC001","Microsoft Windows Server 2012 R2 Standard" -"DAPCAC001","Microsoft Windows Server 2016 Standard" -"DFNP001","Microsoft Windows Server 2012 R2 Standard" -"DFAX011","Microsoft Windows Server 2016 Standard" -"DAPP006","Microsoft Windows Server 2012 R2 Standard" -"DFNP002","Microsoft Windows Server 2012 R2 Standard" -"DAPSEP001","Microsoft Windows Server 2016 Standard" -"PNCRASCCMWKDP03","Microsoft Windows Server 2019 Standard" -"PNCRASCCMWSP2","Microsoft Windows Server 2019 Standard" -"PNCRASCCMWKDP02","Microsoft Windows Server 2019 Standard" -"PNCRASCCMWSP3","Microsoft Windows Server 2019 Standard" -"PNCRASMTP02","Microsoft Windows Server 2019 Standard" -"PNCRASMTP01","Microsoft Windows Server 2019 Standard" -"PNCRAADMIN01","Microsoft Windows Server 2019 Standard" -"PVVCO001","Microsoft Windows Server 2019 Standard" -"PFNP005","Microsoft Windows Server 2019 Standard" -"PFNP001","Microsoft? Windows Server? 2008 Enterprise " -"PNCRACS01","Microsoft Windows Server 2019 Standard" -"QNCRACS01","Microsoft Windows Server 2019 Standard" -"DNCRACS01","Microsoft Windows Server 2019 Standard" -"PNCRAMEP01","Microsoft Windows Server 2019 Standard" -"DNCRAMEP01","Microsoft Windows Server 2019 Standard" -"PNCRAEXMBX005","Microsoft Windows Server 2012 R2 Standard" -"DNCRAFILETEST01","Microsoft Windows Server 2019 Standard" -"PAPP002","Microsoft Windows 2000 Server" -"DFNP011","Microsoft Windows Server 2012 R2 Standard" -"PSQL023","Microsoft Windows Server 2012 R2 Standard" -"PSQL023B","Microsoft Windows Server 2012 R2 Standard" -"PSQL026","Microsoft Windows Server 2016 Standard" -"PSQL029A","Microsoft Windows Server 2016 Standard" -"PSQL030A","Microsoft Windows Server 2016 Standard" -"PSQL030A","Microsoft Windows Server 2016 Standard" -"PNCRAWFM01","Microsoft Windows Server 2019 Standard" -"DSPUPG2016","Microsoft Windows Server 2019 Standard" -"DRSQL028","Microsoft Windows Server 2016 Standard" -"PNCRAFILE004","Microsoft Windows Server 2019 Standard" -"QNCRAMEP01","Microsoft Windows Server 2019 Standard" -"PFNP003A","Microsoft Windows Server 2019 Standard" -"PFNP001A","Microsoft Windows Server 2019 Standard" diff --git a/dump/Files/Servers-Not-In-Patching-Group.csv b/dump/Files/Servers-Not-In-Patching-Group.csv deleted file mode 100644 index 2d9ee9b..0000000 --- a/dump/Files/Servers-Not-In-Patching-Group.csv +++ /dev/null @@ -1,426 +0,0 @@ -"server","SideIndicator" -"W2012A","<=" -"W2012B","<=" -"Q1NCRAFILE001","<=" -"DFNP014","<=" -"DAPCAC002","<=" -"DAPCAV001","<=" -"DAPVRNS001","<=" -"DGAW001","<=" -"DWAM002","<=" -"DIAP001","<=" -"DWHD003","<=" -"DCTI001","<=" -"DVB6001","<=" -"DFNP009","<=" -"DVCO001","<=" -"DBIT901","<=" -"DFNP020","<=" -"DAPP011","<=" -"DMHB001","<=" -"QRSH023","<=" -"QRSH022","<=" -"QRSH021","<=" -"DCAM011","<=" -"DCIC011","<=" -"DCIC012","<=" -"DSPUPG2010","<=" -"DOSM012","<=" -"DOSM011","<=" -"DMDA011","<=" -"DICW011","<=" -"DTABL001","<=" -"DSIS002","<=" -"DOWA001","<=" -"DBIZ111","<=" -"DBIZ112","<=" -"DBIZ113","<=" -"DUTL012","<=" -"DWAM001","<=" -"DSRS004","<=" -"DSSS001","<=" -"DSQL009","<=" -"DSQL021","<=" -"DSIS004","<=" -"QRSH002","<=" -"QRSH041","<=" -"QRSH051","<=" -"QRSH001","<=" -"QRSH031","<=" -"QAPP041","<=" -"DEDI111","<=" -"DEDI112","<=" -"DEDI113","<=" -"QRSH111","<=" -"DSQL027A","<=" -"DSQL027B","<=" -"DSRS005","<=" -"DSQL000","<=" -"DSQL030","<=" -"DSQL004","<=" -"DSQL029","<=" -"DSIS005","<=" -"DSQL031","<=" -"DSIS003","<=" -"DNCRASSIS001","<=" -"DSQL028","<=" -"DSQL021Q","<=" -"DSQL024","<=" -"DNCRASPWFE01","<=" -"DNCRASPAS01","<=" -"QAPP031","<=" -"QNCRASPAPP01","<=" -"QNCRASPDC01","<=" -"QNCRASPAPP02","<=" -"QNCRASPWFE01","<=" -"QNCRASPWFE02","<=" -"QNCRASPDC02","<=" -"QNCRASPSEA01","<=" -"QNCRASPSEA02","<=" -"QRDS002","<=" -"QMHB003","<=" -"QMHB004","<=" -"QRDS001","<=" -"QAPP051","<=" -"QMHB001","<=" -"QMFT001","<=" -"QBIZ151","<=" -"QBIZ152","<=" -"Q1SQL024","<=" -"QAPP011","<=" -"QNCRASPOOS01","<=" -"DNCRASPOOS01","<=" -"QRSH101","<=" -"QSCH012","<=" -"QDRF001","<=" -"QFNP008","<=" -"Q2NCRAFILE001","<=" -"Q3NCRAFILE001","<=" -"QMHB002","<=" -"QSRS004","<=" -"QFNP007","<=" -"QSQL029","<=" -"QSQL030","<=" -"Q5NCRAFILE001","<=" -"QADF001","<=" -"QTABL001","<=" -"Q4NCRAFILE001","<=" -"QFNP009","<=" -"QSCH011","<=" -"QSQL028","<=" -"QAPP021","<=" -"QSCH014","<=" -"QFNP001","<=" -"QSCH013","<=" -"QVST012","<=" -"QVST011","<=" -"QSIS003","<=" -"PNCRAVPRXY001","<=" -"PMON005","<=" -"PNCRAVERVLT001","<=" -"PALT001","<=" -"PICW011","<=" -"PVEO002","<=" -"PMON010","<=" -"PRSH014","<=" -"PVEO001","<=" -"PNCRAVPRXY002","<=" -"PVET001","<=" -"PMON009","<=" -"PNCRANTRX002","<=" -"PSSS001","<=" -"PTTS011","<=" -"PVER001","<=" -"PVEB001","<=" -"PMON011","<=" -"PDMC005","<=" -"PDMC003","<=" -"PDMC002","<=" -"PDMC001","<=" -"PDMC004","<=" -"PDMC006","<=" -"CTSTPDMC001","<=" -"FLT2PTTS011","<=" -"FLT2PDMC001","<=" -"FLT2PDMC002","<=" -"KSOPPDMC001","<=" -"NYMEPDMC001","<=" -"PVAV001","<=" -"PVAV002","<=" -"PVAV003","<=" -"PNCRARCM001","<=" -"AZPHPRCS011","<=" -"CTHAPRCS011","<=" -"CTHAPALT002","<=" -"CTSTPALT001","<=" -"PFNP003","<=" -"DPOCSP001","<=" -"PVVC012","<=" -"PVVC014","<=" -"PVVC013","<=" -"QRSH113","<=" -"Q5SQL022","<=" -"QUTL012","<=" -"Q4SQL024","<=" -"QFNP003","<=" -"QBIZ121","<=" -"QBIZ132","<=" -"QEDI153","<=" -"QEDI113","<=" -"QRSH112","<=" -"QBIZ131","<=" -"QSIS002","<=" -"QBIZ122","<=" -"QVST021","<=" -"QEDI152","<=" -"QEDI111","<=" -"QVST022","<=" -"QEDI151","<=" -"QEDI112","<=" -"Q1SQL022","<=" -"PVVC015","<=" -"PVVC016","<=" -"QBIZ112","<=" -"QBIZ111","<=" -"Q2SQL022","<=" -"Q3SQL022","<=" -"Q4SQL022B","<=" -"Q4SQL022","<=" -"POSM014","<=" -"PCIC011","<=" -"PIMQ011","<=" -"PMDA011","<=" -"PISR011","<=" -"PSRS004","<=" -"PMDA014","<=" -"PSQL014","<=" -"PMDA012","<=" -"PMDA013","<=" -"FLT2PCIC011","<=" -"PBIT901","<=" -"PIWC012","<=" -"FLT2POSM012","<=" -"POSM012","<=" -"PIWC011","<=" -"FLT2POSM013","<=" -"PVVC011","<=" -"PRSH101","<=" -"QBIZ142","<=" -"FLT2PMDA011","<=" -"FLT2POSM011","<=" -"FLT2PMDA012","<=" -"FLT2POSM014","<=" -"FLT2PICW011","<=" -"FLT2PMDA013","<=" -"FLT2PMDA014","<=" -"PRCS012","<=" -"POSM011","<=" -"POSM013","<=" -"DIWC011","<=" -"PRCS011","<=" -"PSQL024","<=" -"PDISKTEST1","<=" -"PMDA016","<=" -"FLT2PCAC001","<=" -"PMDA015","<=" -"PMDA017","<=" -"FLT2PALT001","<=" -"POSM016","<=" -"FLT2PCAC002","<=" -"POSM015","<=" -"PSQL012","<=" -"FLT2PRCS011","<=" -"FLT2PMDA017","<=" -"FLT2PMDA015","<=" -"FLT2PMDA016","<=" -"KSOPPRCS011","<=" -"PRSH102","<=" -"DVST001","<=" -"QBIZ141","<=" -"PIPM001","<=" -"DRCS011","<=" -"QSNX001","<=" -"PAPCAC001","<=" -"DNCRAAUTO006","<=" -"PSQL027","<=" -"PSUS001","<=" -"PNCRAVERRRPT001","<=" -"PSIS003","<=" -"PSQL028Q","<=" -"PSQL030Q","<=" -"QNCRASCCM001","<=" -"QQATEST01","<=" -"PVAPV002","<=" -"PSEC003","<=" -"PVAPV003","<=" -"PVAPV001","<=" -"PSQL029Q","<=" -"PVVCO005","<=" -"PVVCO006","<=" -"PVVCO002","<=" -"PVVCO003","<=" -"PNCRALSWMON001","<=" -"PVVCO004","<=" -"PNCRANTRX004","<=" -"PNCRAVERVLT004","<=" -"FLT2VEB002","<=" -"FLT2VEB003","<=" -"S16NCRASRV00001","<=" -"PNCRAVONE01","<=" -"DSPUPG2013","<=" -"DAPP012","<=" -"DDOC001","<=" -"DAPCAC001","<=" -"DFNP001","<=" -"DFAX011","<=" -"DAPP006","<=" -"DFNP002","<=" -"DAPSEP001","<=" -"PNCRASCCMWKDP03","<=" -"PNCRASCCMWSP2","<=" -"PNCRASCCMWKDP02","<=" -"PNCRASCCMWSP3","<=" -"PNCRASMTP02","<=" -"PNCRASMTP01","<=" -"PNCRAADMIN01","<=" -"PVVCO001","<=" -"PFNP005","<=" -"PFNP001","<=" -"PNCRACS01","<=" -"QNCRACS01","<=" -"DNCRACS01","<=" -"PNCRAMEP01","<=" -"DNCRAMEP01","<=" -"PNCRAEXMBX005","<=" -"DNCRAFILETEST01","<=" -"PPKI003","<=" -"PSQL008","<=" -"PAPP002","<=" -"QAPP005","<=" -"PSEV005","<=" -"PSEV002","<=" -"PVEP001","<=" -"PRSH181","<=" -"PRSH150","<=" -"PVCO001","<=" -"PRSH182","<=" -"QAPP002","<=" -"DFNP011","<=" -"DHIL001","<=" -"QAPP010","<=" -"PSEV021","<=" -"PRSH049","<=" -"PRSH060","<=" -"PDRDS001","<=" -"PSQL023","<=" -"PSQL023B","<=" -"PSEV017","<=" -"DAPP001-2012R2","<=" -"PSEV023","<=" -"DOIT001","<=" -"PVRT006","<=" -"PVRT003","<=" -"PVRT004","<=" -"PVRT001","<=" -"PVRT005","<=" -"PVRT002","<=" -"PFAX014","<=" -"PFAX013","<=" -"PFAX012","<=" -"PFAX011","<=" -"PVRT007","<=" -"FLT2PVRT007","<=" -"DVVC002","<=" -"DVVC001","<=" -"CTHAPVRT007","<=" -"AZPHPVRT007","<=" -"KSOPPVRT007","<=" -"PSQL026B","<=" -"PSQLCL26","<=" -"PRMS002","<=" -"PRMS001","<=" -"PVER005","<=" -"Q2FNP003","<=" -"Q5FNP003","<=" -"Q1FNP003","<=" -"Q4FNP003","<=" -"Q3FNP003","<=" -"QDNS001","<=" -"PMQS001","<=" -"QCMX001","<=" -"psql029cl","<=" -"psql028cl","<=" -"PNTX001","<=" -"PCMX001","<=" -"DMQS001","<=" -"FLT2VEB001","<=" -"psql030cl","<=" -"DRSQL003","<=" -"DRSQL002","<=" -"DRRDS001","<=" -"DRTEST001","<=" -"DRRDS002","<=" -"dsql02130cl","<=" -"DMS3001","<=" -"PNCRASPOWA01","<=" -"I3-PROD-LIS","<=" -"PNCRASMI01","<=" -"DNCRAAUTO004","<=" -"DNCRAAUTO003","<=" -"DSPC001","<=" -"DFAX001","<=" -"DWHD004","<=" -"GOLD-S16-INSTAN","<=" -"DVRS001","<=" -"DFAX002","<=" -"DVVC003","<=" -"FLT2PDEP001","<=" -"DVVC004","<=" -"DSTMN001","<=" -"DNCRATESTVM2","<=" -"PADS001","<=" -"NPTEST1","<=" -"PSCH014-TEST","<=" -"PVEP602","<=" -"PWAP002-0","<=" -"PSQL000","<=" -"PSEV006","<=" -"PVEP601","<=" -"PFAX011CAP","<=" -"PSCH011-TEST","<=" -"PVEP604","<=" -"PMFT001","<=" -"PFAX015","<=" -"PDOMS001","<=" -"PVEP603","<=" -"PWAP001-0","<=" -"TESTVM6","<=" -"TEST","<=" -"QBIZ100","<=" -"PNCRAMEDI001","<=" -"TEMPDC004","<=" -"TEMPDC006","<=" -"TEMPNETWRIX","<=" -"DSTEA001","<=" -"DSACS001","<=" -"DSBAMCS001","<=" -"PNCRAWFM01","<=" -"DSNX001","<=" -"CLVA1PFNP005","<=" -"CLVA1PFNP003","<=" -"CLVA1PFNP006","<=" -"CLVA1PEXM001","<=" -"CLVA1PFNP007","<=" -"CLVA1PFNP001","<=" -"CLVA1PFNP002","<=" -"CLVA1PDMC001","<=" -"DSPUPG2016","<=" -"DRSQL028","<=" -"PNCRAFILE004","<=" -"QNCRAMEP01","<=" -"PNCRAPROSPD01","<=" -"PNFP012A","<=" -"PNFP011A","<=" -"PFNP003A","<=" -"PFNP001A","<=" -"PEXM004","<=" diff --git a/dump/Files/Servers-Not-Responding.txt b/dump/Files/Servers-Not-Responding.txt deleted file mode 100644 index 0fd2452..0000000 Binary files a/dump/Files/Servers-Not-Responding.txt and /dev/null differ diff --git a/dump/Files/dev-app-error-2-2020.txt b/dump/Files/dev-app-error-2-2020.txt deleted file mode 100644 index ae1d64c..0000000 Binary files a/dump/Files/dev-app-error-2-2020.txt and /dev/null differ diff --git a/dump/Files/dev-app-pending-restart.txt b/dump/Files/dev-app-pending-restart.txt deleted file mode 100644 index a045e25..0000000 --- a/dump/Files/dev-app-pending-restart.txt +++ /dev/null @@ -1,13 +0,0 @@ -DIAP001 -DAPP006 -DFAX011 -DAPVRNS001 -DWAM001 -DMHB001 -DFNP002 -DFNP020 -DBIT901 -DFNP009 -DVB6001 -DCTI001 -DWHD003 \ No newline at end of file diff --git a/dump/Fully Automate Software Update Maintenance in Configuration Manager – Dam Good Admin.website b/dump/Fully Automate Software Update Maintenance in Configuration Manager – Dam Good Admin.website deleted file mode 100644 index e058c41..0000000 --- a/dump/Fully Automate Software Update Maintenance in Configuration Manager – Dam Good Admin.website +++ /dev/null @@ -1,18 +0,0 @@ -[{000214A0-0000-0000-C000-000000000046}] -Prop3=19,11 -Prop4=31,Fully Automate Software Update Maintenance in Configuration Manager Dam Good Admin -[InternetShortcut] -IDList= -URL=https://damgoodadmin.com/2017/11/05/fully-automate-software-update-maintenance-in-cm/ -IconFile=https://damgoodadmin.com/favicon.ico -IconIndex=1 -[{A7AF692E-098D-4C08-A225-D433CA835ED0}] -Prop5=3,0 -Prop9=19,0 -Prop2=65,2C0000000000000001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8F0200003D0000003F07000083030000B7 -[{000214A0-0000-0000-C000-000000000046}.A] -Prop4=31,Fully Automate Software Update Maintenance in Configuration Manager Dam Good Admin -[{000214A0-0000-0000-C000-000000000046}.W] -Prop4=31,Fully Automate Software Update Maintenance in Configuration Manager +IBM- Dam Good Admin -[{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}] -Prop5=8,Microsoft.Website.47A136E5.3264C1C6 diff --git a/dump/GUI-AlertBox.ps1 b/dump/GUI-AlertBox.ps1 deleted file mode 100644 index 2106d6b..0000000 --- a/dump/GUI-AlertBox.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -Add-Type -AssemblyName PresentationCore,PresentationFramework -$ButtonType = [System.Windows.MessageBoxButton]::YesNoCancel -$MessageIcon = [System.Windows.MessageBoxImage]::Error -$MessageBody = "Are you sure you want to delete the log file?" -$MessageTitle = "Confirm Deletion" -$Result = [System.Windows.MessageBox]::Show($MessageBody,$MessageTitle,$ButtonType,$MessageIcon) -"Your choice is $Result" \ No newline at end of file diff --git a/dump/GUI-DialogBox.ps1 b/dump/GUI-DialogBox.ps1 deleted file mode 100644 index 6311c4b..0000000 --- a/dump/GUI-DialogBox.ps1 +++ /dev/null @@ -1,12 +0,0 @@ - -$d = [Windows.Forms.MessageBox]::show("PowerShell Rocks", "PowerShell Rocks", -[Windows.Forms.MessageBoxButtons]::YesNo, [Windows.Forms.MessageBoxIcon]::Question) - -If ($d -eq [Windows.Forms.DialogResult]::Yes) -{ - 'Yes, PowerShell Rocks' -} -else -{ - "On no, you don't like me" -} \ No newline at end of file diff --git a/dump/GUI-Inputbox-Dropdown-temp.ps1 b/dump/GUI-Inputbox-Dropdown-temp.ps1 deleted file mode 100644 index be560ac..0000000 --- a/dump/GUI-Inputbox-Dropdown-temp.ps1 +++ /dev/null @@ -1,135 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -Function Start-Form { - - $Global:Collection_Name = "" - #$Global:Select_Tool = "" - $Global:Output_Type = "" - - $Temp = "" - - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - - $Form = New-Object System.Windows.Forms.Form - $Form.Size = New-Object System.Drawing.Size(600,400) - ############################################## - #$Form_Load={ $outputBox.text = "Welcome" } - ############################################## Start functions - <# function pingInfo { - - if ($RadioButton1.Checked -eq $true) {$nrOfPings=1} - if ($RadioButton2.Checked -eq $true) {$nrOfPings=2} - if ($RadioButton3.Checked -eq $true) {$nrOfPings=3} - - $computer=$DropDownBox.SelectedItem.ToString() #populate the var with the value you selected - $pingResult=ping $wks -n $nrOfPings | fl | out-string; - $outputBox.text=$pingResult - - } #end pingInfo - #> - ############################################## end functions - ############################################## - Function temp { - $outputBox.text = $textBox1.text | Out-String - $Global:Collection_Name = $textBox1.Text - #$Global:Select_Tool = $RadioButton1.Checked - $Global:Select_Tool = $DropDownBox.text - #$Global:Output_Type = - #if ($RadioButton2.Checked -eq $true) {Get-Service | Out-GridView} - - If($DropDownBox.text = "Tool1"){gcc} - - $textBox1.clear() - $DropDownBox.text = "----Select Tool----" - } - ############################################## - Function Update-Dropdown1 { - # $Collections += $textBox1.text - $Collections = @("Tool1","Tool2","Tool3","Tool4","Tool5","Tool6","Tool7") - $Collections | % { $DropDownBox.Items.Add($_) } - } - ############################################## - Function gcc { - $outputBox.text = Get-Service | Out-String - } - ############################################## - Function Clear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - } - ############################################## Start group boxes - $groupBox = New-Object System.Windows.Forms.GroupBox - $groupBox.Location = New-Object System.Drawing.Size(270,20) - $groupBox.size = New-Object System.Drawing.Size(150,110) - $groupBox.text = "Select Output:" - $Form.Controls.Add($groupBox) - ############################################## end group boxes - - ############################################## Start radio buttons - $RadioButton1 = New-Object System.Windows.Forms.RadioButton - $RadioButton1.Location = new-object System.Drawing.Point(15,15) - $RadioButton1.size = New-Object System.Drawing.Size(130,20) - $RadioButton1.Checked = $true - $RadioButton1.Text = "Powershell Window" - $groupBox.Controls.Add($RadioButton1) - - $RadioButton2 = New-Object System.Windows.Forms.RadioButton - $RadioButton2.Location = new-object System.Drawing.Point(15,35) - $RadioButton2.size = New-Object System.Drawing.Size(80,20) - $RadioButton2.Text = "Gridview" - $groupBox.Controls.Add($RadioButton2) - - $RadioButton3 = New-Object System.Windows.Forms.RadioButton - $RadioButton3.Location = new-object System.Drawing.Point(15,55) - $RadioButton3.size = New-Object System.Drawing.Size(80,20) - $RadioButton3.Text = "Export csv" - $groupBox.Controls.Add($RadioButton3) - - ############################################## end radio buttons - ########### Text Box ########### - ############Define text box1 for input - $textBox1 = New-Object “System.Windows.Forms.TextBox”; - $textBox1.Left = 20; - $textBox1.Top = 30; - $textBox1.width = 200; - $Form.Controls.Add($textBox1) - ############################################## Start drop down boxes - - $DropDownBox = New-Object System.Windows.Forms.ComboBox - $DropDownBox.Location = New-Object System.Drawing.Size(20,80) - $DropDownBox.Size = New-Object System.Drawing.Size(180,20) - $DropDownBox.DropDownHeight = 200 - $DropDownBox.text = "----Select Tool----" - $Form.Controls.Add($DropDownBox) - - ############################################## end drop down boxes - - ############################################## Start text fields - - $outputBox = New-Object System.Windows.Forms.TextBox - $outputBox.Location = New-Object System.Drawing.Size(10,150) - $outputBox.Size = New-Object System.Drawing.Size(565,200) - $outputBox.MultiLine = $True - - $outputBox.ScrollBars = "Vertical" - $Form.Controls.Add($outputBox) - - ############################################## end text fields - - ############################################## Start buttons - - $Button = New-Object System.Windows.Forms.Button - $Button.Location = New-Object System.Drawing.Size(450,30) - $Button.Size = New-Object System.Drawing.Size(110,80) - $Button.Text = "Go" - $Button.Add_Click({temp}) - $Form.Controls.Add($Button) - - ############################################## end buttons - Update-Dropdown1 - - $Form.Add_Shown({$Form.Activate()}) - [void] $Form.ShowDialog() - -} \ No newline at end of file diff --git a/dump/GUI-Inputbox-Dropdown.ps1 b/dump/GUI-Inputbox-Dropdown.ps1 deleted file mode 100644 index 0ea901e..0000000 --- a/dump/GUI-Inputbox-Dropdown.ps1 +++ /dev/null @@ -1,96 +0,0 @@ -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - -$Form = New-Object System.Windows.Forms.Form -$Form.Size = New-Object System.Drawing.Size(600,400) - -############################################## Start functions - -function pingInfo { - -if ($RadioButton1.Checked -eq $true) {$nrOfPings=1} -if ($RadioButton2.Checked -eq $true) {$nrOfPings=2} -if ($RadioButton3.Checked -eq $true) {$nrOfPings=3} - -$computer=$DropDownBox.SelectedItem.ToString() #populate the var with the value you selected -$pingResult=ping $wks -n $nrOfPings | fl | out-string; -$outputBox.text=$pingResult - - } #end pingInfo - -############################################## end functions - -############################################## Start group boxes - -$groupBox = New-Object System.Windows.Forms.GroupBox -$groupBox.Location = New-Object System.Drawing.Size(270,20) -$groupBox.size = New-Object System.Drawing.Size(100,100) -$groupBox.text = "Nr of pings:" -$Form.Controls.Add($groupBox) - -############################################## end group boxes - -############################################## Start radio buttons - -$RadioButton1 = New-Object System.Windows.Forms.RadioButton -$RadioButton1.Location = new-object System.Drawing.Point(15,15) -$RadioButton1.size = New-Object System.Drawing.Size(80,20) -$RadioButton1.Checked = $true -$RadioButton1.Text = "Ping once" -$groupBox.Controls.Add($RadioButton1) - -$RadioButton2 = New-Object System.Windows.Forms.RadioButton -$RadioButton2.Location = new-object System.Drawing.Point(15,45) -$RadioButton2.size = New-Object System.Drawing.Size(80,20) -$RadioButton2.Text = "Ping twice" -$groupBox.Controls.Add($RadioButton2) - -$RadioButton3 = New-Object System.Windows.Forms.RadioButton -$RadioButton3.Location = new-object System.Drawing.Point(15,75) -$RadioButton3.size = New-Object System.Drawing.Size(80,20) -$RadioButton3.Text = "Ping thrice" -$groupBox.Controls.Add($RadioButton3) - -############################################## end radio buttons - -############################################## Start drop down boxes - -$DropDownBox = New-Object System.Windows.Forms.ComboBox -$DropDownBox.Location = New-Object System.Drawing.Size(20,50) -$DropDownBox.Size = New-Object System.Drawing.Size(180,20) -$DropDownBox.DropDownHeight = 200 -$Form.Controls.Add($DropDownBox) - -$wksList=@("hrcomputer1","hrcomputer2","hrcomputer3","workstation1","workstation2","computer5","localhost") - -foreach ($wks in $wksList) { - $DropDownBox.Items.Add($wks) - } #end foreach - -############################################## end drop down boxes - -############################################## Start text fields - -$outputBox = New-Object System.Windows.Forms.TextBox -$outputBox.Location = New-Object System.Drawing.Size(10,150) -$outputBox.Size = New-Object System.Drawing.Size(565,200) -$outputBox.MultiLine = $True - -$outputBox.ScrollBars = "Vertical" -$Form.Controls.Add($outputBox) - -############################################## end text fields - -############################################## Start buttons - -$Button = New-Object System.Windows.Forms.Button -$Button.Location = New-Object System.Drawing.Size(400,30) -$Button.Size = New-Object System.Drawing.Size(110,80) -$Button.Text = "Ping" -$Button.Add_Click({pingInfo}) -$Form.Controls.Add($Button) - -############################################## end buttons - -$Form.Add_Shown({$Form.Activate()}) -[void] $Form.ShowDialog() \ No newline at end of file diff --git a/dump/GUI-Inputbox-Radio.ps1 b/dump/GUI-Inputbox-Radio.ps1 deleted file mode 100644 index 9fcd112..0000000 --- a/dump/GUI-Inputbox-Radio.ps1 +++ /dev/null @@ -1,93 +0,0 @@ -2 -3 - -# Introduction to Radio buttons and Grouping # -############################################## - -# A function to create the form -function Cheesy_Form{ - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - - # Set the size of your form - $Form = New-Object System.Windows.Forms.Form - $Form.width = 500 - $Form.height = 300 - $Form.Text = "My Cheesy Form with Radio buttons" - - # Set the font of the text to be used within the form - $Font = New-Object System.Drawing.Font("Times New Roman",12) - $Form.Font = $Font - - # Create a group that will contain your radio buttons - $MyGroupBox = New-Object System.Windows.Forms.GroupBox - $MyGroupBox.Location = '40,30' - $MyGroupBox.size = '400,110' - $MyGroupBox.text = "Do you like Cheese?" - - # Create the collection of radio buttons - $RadioButton1 = New-Object System.Windows.Forms.RadioButton - $RadioButton1.Location = '20,40' - $RadioButton1.size = '350,20' - $RadioButton1.Checked = $true - $RadioButton1.Text = "Yes - I like Cheese." - - $RadioButton2 = New-Object System.Windows.Forms.RadioButton - $RadioButton2.Location = '20,70' - $RadioButton2.size = '350,20' - $RadioButton2.Checked = $false - $RadioButton2.Text = "No - I don't like Cheese." - - $RadioButton3 = New-Object System.Windows.Forms.RadioButton - $RadioButton3.Location = '60,150' - $RadioButton3.size = '350,20' - $RadioButton3.Checked = $false - $RadioButton3.Text = "This is not a cheese related response." - - # Add an OK button - # Thanks to J.Vierra for simplifing the use of buttons in forms - $OKButton = new-object System.Windows.Forms.Button - $OKButton.Location = '130,200' - $OKButton.Size = '100,40' - $OKButton.Text = 'OK' - $OKButton.DialogResult=[System.Windows.Forms.DialogResult]::OK - - #Add a cancel button - $CancelButton = new-object System.Windows.Forms.Button - $CancelButton.Location = '255,200' - $CancelButton.Size = '100,40' - $CancelButton.Text = "Cancel" - $CancelButton.DialogResult=[System.Windows.Forms.DialogResult]::Cancel - - # Add all the GroupBox controls on one line - $MyGroupBox.Controls.AddRange(@($Radiobutton1,$RadioButton2)) - - # Add all the Form controls on one line - $form.Controls.AddRange(@($MyGroupBox,$OKButton,$CancelButton,$RadioButton3)) - - - - # Assign the Accept and Cancel options in the form to the corresponding buttons - $form.AcceptButton = $OKButton - $form.CancelButton = $CancelButton - - # Activate the form - $form.Add_Shown({$form.Activate()}) - - # Get the results from the button click - $dialogResult = $form.ShowDialog() - - # If the OK button is selected - if ($dialogResult -eq "OK"){ - - # Check the current state of each radio button and respond accordingly - if ($RadioButton1.Checked -and (!($RadioButton3.Checked))){ - [System.Windows.Forms.MessageBox]::Show("You like cheese." , "Great")} - elseif ($RadioButton2.Checked -and (!($RadioButton3.Checked))){ - [System.Windows.Forms.MessageBox]::Show("So your not a fan of cheese." , "Awe")} - elseif ($RadioButton3.Checked = $true){[System.Windows.Forms.MessageBox]::Show("That's OK - You don't have to answer cheesy questions" , "'No' to cheesy")} - } -} - -# Call the function -Cheesy_Form \ No newline at end of file diff --git a/dump/GUI-Inputbox-Text.ps1 b/dump/GUI-Inputbox-Text.ps1 deleted file mode 100644 index 91d8a50..0000000 --- a/dump/GUI-Inputbox-Text.ps1 +++ /dev/null @@ -1,118 +0,0 @@ -Function Invoke-InputBox { - - [cmdletbinding(DefaultParameterSetName="plain")] - [OutputType([system.string],ParameterSetName='plain')] - [OutputType([system.security.securestring],ParameterSetName='secure')] - - Param( - [Parameter(ParameterSetName="secure")] - [Parameter(HelpMessage = "Enter the title for the input box. No more than 25 characters.", - ParameterSetName="plain")] - - [ValidateNotNullorEmpty()] - [ValidateScript({$_.length -le 25})] - [string]$Title = "User Input", - - [Parameter(ParameterSetName="secure")] - [Parameter(HelpMessage = "Enter a prompt. No more than 50 characters.",ParameterSetName="plain")] - [ValidateNotNullorEmpty()] - [ValidateScript({$_.length -le 50})] - [string]$Prompt = "Please enter a value:", - - [Parameter(HelpMessage = "Use to mask the entry and return a secure string.", - ParameterSetName="secure")] - [switch]$AsSecureString - ) - - if ($PSEdition -eq 'Core') { - Write-Warning "Sorry. This command will not run on PowerShell Core." - #bail out - Return - } - - Add-Type -AssemblyName PresentationFramework - Add-Type –assemblyName PresentationCore - Add-Type –assemblyName WindowsBase - - #remove the variable because it might get cached in the ISE or VS Code - Remove-Variable -Name myInput -Scope script -ErrorAction SilentlyContinue - - $form = New-Object System.Windows.Window - $stack = New-object System.Windows.Controls.StackPanel - - #define what it looks like - $form.Title = $title - $form.Height = 150 - $form.Width = 350 - - $label = New-Object System.Windows.Controls.Label - $label.Content = " $Prompt" - $label.HorizontalAlignment = "left" - $stack.AddChild($label) - - if ($AsSecureString) { - $inputbox = New-Object System.Windows.Controls.PasswordBox - } - else { - $inputbox = New-Object System.Windows.Controls.TextBox - } - - $inputbox.Width = 300 - $inputbox.HorizontalAlignment = "center" - - $stack.AddChild($inputbox) - - $space = new-object System.Windows.Controls.Label - $space.Height = 10 - $stack.AddChild($space) - - $btn = New-Object System.Windows.Controls.Button - $btn.Content = "_OK" - - $btn.Width = 65 - $btn.HorizontalAlignment = "center" - $btn.VerticalAlignment = "bottom" - - #add an event handler - $btn.Add_click( { - if ($AsSecureString) { - $script:myInput = $inputbox.SecurePassword - } - else { - $script:myInput = $inputbox.text - } - $form.Close() - }) - - $stack.AddChild($btn) - $space2 = new-object System.Windows.Controls.Label - $space2.Height = 10 - $stack.AddChild($space2) - - $btn2 = New-Object System.Windows.Controls.Button - $btn2.Content = "_Cancel" - - $btn2.Width = 65 - $btn2.HorizontalAlignment = "center" - $btn2.VerticalAlignment = "bottom" - - #add an event handler - $btn2.Add_click( { - $form.Close() - }) - - $stack.AddChild($btn2) - - #add the stack to the form - $form.AddChild($stack) - - #show the form - $inputbox.Focus() | Out-Null - $form.WindowStartupLocation = [System.Windows.WindowStartupLocation]::CenterScreen - - $form.ShowDialog() | out-null - - #write the result from the input box back to the pipeline - $script:myInput - -} \ No newline at end of file diff --git a/dump/GUI-Inputbox.ps1 b/dump/GUI-Inputbox.ps1 deleted file mode 100644 index 31971ec..0000000 --- a/dump/GUI-Inputbox.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -$global:FN = "" -function New-InputBox -{ - param - ( - [Parameter(Mandatory)] - [string]$FirstName, - - [Parameter(Mandatory)] - [string]$LastName, - - [Parameter(Mandatory)] - [string]$Password - ) - - $FirstName, $LastName, $Password - $Global:FN = $FirstName - -} -Show-Command -Name New-InputBox \ No newline at end of file diff --git a/dump/GUI-Inputbox2.ps1 b/dump/GUI-Inputbox2.ps1 deleted file mode 100644 index 78670c1..0000000 --- a/dump/GUI-Inputbox2.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') -$name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter your name", "Name", "Lastname") -"Your name is $name" \ No newline at end of file diff --git a/dump/GUI-Inputbox3.ps1 b/dump/GUI-Inputbox3.ps1 deleted file mode 100644 index 2dc2708..0000000 --- a/dump/GUI-Inputbox3.ps1 +++ /dev/null @@ -1,98 +0,0 @@ -function button ($title,$mailbx, $WF, $TF) { - -###################Load Assembly for creating form & button###### - -[void][System.Reflection.Assembly]::LoadWithPartialName( “System.Windows.Forms”) -[void][System.Reflection.Assembly]::LoadWithPartialName( “Microsoft.VisualBasic”) - -#####Define the form size & placement - -$form = New-Object “System.Windows.Forms.Form”; -$form.Width = 500; -$form.Height = 150; -$form.Text = $title; -$form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen; - -##############Define text label1 -$textLabel1 = New-Object “System.Windows.Forms.Label”; -$textLabel1.Left = 25; -$textLabel1.Top = 15; - -$textLabel1.Text = $mailbx; - -##############Define text label2 - -$textLabel2 = New-Object “System.Windows.Forms.Label”; -$textLabel2.Left = 25; -$textLabel2.Top = 50; - -$textLabel2.Text = $WF; - -##############Define text label3 - -$textLabel3 = New-Object “System.Windows.Forms.Label”; -$textLabel3.Left = 25; -$textLabel3.Top = 85; - -$textLabel3.Text = $TF; - -############Define text box1 for input -$textBox1 = New-Object “System.Windows.Forms.TextBox”; -$textBox1.Left = 150; -$textBox1.Top = 10; -$textBox1.width = 200; - -############Define text box2 for input - -$textBox2 = New-Object “System.Windows.Forms.TextBox”; -$textBox2.Left = 150; -$textBox2.Top = 50; -$textBox2.width = 200; - - -############Define text box3 for input - -$textBox3 = New-Object “System.Windows.Forms.TextBox”; -$textBox3.Left = 150; -$textBox3.Top = 90; -$textBox3.width = 200; - -#############Define default values for the input boxes -$defaultValue = “” -$textBox1.Text = $defaultValue; -$textBox2.Text = $defaultValue; -$textBox3.Text = $defaultValue; - -#############define OK button -$button = New-Object “System.Windows.Forms.Button”; -$button.Left = 360; -$button.Top = 85; -$button.Width = 100; -$button.Text = “Ok”; - -############# This is when you have to close the form after getting values -$eventHandler = [System.EventHandler]{ -$textBox1.Text; -$textBox2.Text; -$textBox3.Text; -$form.Close();}; - -$button.Add_Click($eventHandler) ; - -#############Add controls to all the above objects defined -$form.Controls.Add($button); -$form.Controls.Add($textLabel1); -$form.Controls.Add($textLabel2); -$form.Controls.Add($textLabel3); -$form.Controls.Add($textBox1); -$form.Controls.Add($textBox2); -$form.Controls.Add($textBox3); -$ret = $form.ShowDialog(); - -#################return values - -return $textBox1.Text, $textBox2.Text, $textBox3.Text -} - -$return= button “Enter Folders” “Enter mailbox” “Working Folder” “Target Folder” - diff --git a/dump/GUI-Rich-Textbox.ps1 b/dump/GUI-Rich-Textbox.ps1 deleted file mode 100644 index b8869f3..0000000 --- a/dump/GUI-Rich-Textbox.ps1 +++ /dev/null @@ -1,78 +0,0 @@ -function Load-Form { -Add-Type -AssemblyName System.Windows.Forms -Add-Type -AssemblyName System.Drawing - -$form = New-Object System.Windows.Forms.Form -$form.Text = "Data Entry Form" -$form.Size = New-Object System.Drawing.Size(400,300) -$form.StartPosition = "CenterScreen" - -$OKButton = New-Object System.Windows.Forms.Button -$OKButton.Location = New-Object System.Drawing.Point(75,120) -$OKButton.Size = New-Object System.Drawing.Size(75,23) -$OKButton.Text = "OK" -$OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK -$form.AcceptButton = $OKButton -$form.Controls.Add($OKButton) - -$CancelButton = New-Object System.Windows.Forms.Button -$CancelButton.Location = New-Object System.Drawing.Point(150,120) -$CancelButton.Size = New-Object System.Drawing.Size(75,23) -$CancelButton.Text = "Cancel" -$CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel -$form.CancelButton = $CancelButton -$form.Controls.Add($CancelButton) - -$StartButton = New-Object System.Windows.Forms.Button -$StartButton.Location = New-Object System.Drawing.Point(75,90) -$StartButton.Size = New-Object System.Drawing.Size(75,23) -$StartButton.Text = "Start" -$StartButton.DialogResult = [System.Windows.Forms.DialogResult]::None -$StartButton.Add_Click({ -Test -$OUTPUT_RICHTEXT.Text+="Get out" -}) -$form.Controls.Add($StartButton) - -$SCRIPT:OUTPUT_RICHTEXT=New-Object System.Windows.Forms.RichTextBox -$OUTPUT_RICHTEXT.Location=New-Object System.Drawing.Size(10,150) -$OUTPUT_RICHTEXT.Size=New-Object System.Drawing.Size(300,100) -$OUTPUT_RICHTEXT.Multiline=$True -$OUTPUT_RICHTEXT.ReadOnly = $True -$OUTPUT_RICHTEXT.BackColor = [Drawing.Color]::White -$OUTPUT_RICHTEXT.ScrollBars = "Vertical" -$form.Controls.Add($OUTPUT_RICHTEXT) - -$label = New-Object System.Windows.Forms.Label -$label.Location = New-Object System.Drawing.Point(10,20) -$label.Size = New-Object System.Drawing.Size(280,20) -$label.Text = "Please enter the information in the space below:" -$form.Controls.Add($label) - -$textBox = New-Object System.Windows.Forms.TextBox -$textBox.Location = New-Object System.Drawing.Point(10,40) -$textBox.Size = New-Object System.Drawing.Size(260,20) -$form.Controls.Add($textBox) - -$form.Topmost = $True - -$form.Add_Shown({$textBox.Select()}) -$result = $form.ShowDialog() - -if ($result -eq [System.Windows.Forms.DialogResult]::OK) -{ - $x = $textBox.Text - $x -} -} - -function Test { -$script:OUTPUT_RICHTEXT.SelectionColor = 'Magenta' -$script:OUTPUT_RICHTEXT.AppendText("This text will be Magenta. `n") -$script:OUTPUT_RICHTEXT.SelectionColor = 'Green' -$script:OUTPUT_RICHTEXT.AppendText("This text will be Green. `n") -$script:OUTPUT_RICHTEXT.SelectionColor = 'Blue' -$script:OUTPUT_RICHTEXT.AppendText("This text will be Blue. `n") -} - -Load-Form \ No newline at end of file diff --git a/dump/GUI-Textbox.ps1 b/dump/GUI-Textbox.ps1 deleted file mode 100644 index 9cfcb07..0000000 --- a/dump/GUI-Textbox.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -Add-Type -AssemblyName System.Windows.Forms -Add-Type -AssemblyName System.Drawing - -$form = New-Object System.Windows.Forms.Form -$form.Text = 'Data Entry Form' -$form.Size = New-Object System.Drawing.Size(300,200) -$form.StartPosition = 'CenterScreen' - -$okButton = New-Object System.Windows.Forms.Button -$okButton.Location = New-Object System.Drawing.Point(75,120) -$okButton.Size = New-Object System.Drawing.Size(75,23) -$okButton.Text = 'OK' -$okButton.DialogResult = [System.Windows.Forms.DialogResult]::OK -$form.AcceptButton = $okButton -$form.Controls.Add($okButton) - -$cancelButton = New-Object System.Windows.Forms.Button -$cancelButton.Location = New-Object System.Drawing.Point(150,120) -$cancelButton.Size = New-Object System.Drawing.Size(75,23) -$cancelButton.Text = 'Cancel' -$cancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel -$form.CancelButton = $cancelButton -$form.Controls.Add($cancelButton) - -$label = New-Object System.Windows.Forms.Label -$label.Location = New-Object System.Drawing.Point(10,20) -$label.Size = New-Object System.Drawing.Size(280,20) -$label.Text = 'Please enter the information in the space below:' -$form.Controls.Add($label) - -$textBox = New-Object System.Windows.Forms.TextBox -$textBox.Location = New-Object System.Drawing.Point(10,40) -$textBox.Size = New-Object System.Drawing.Size(260,20) -$form.Controls.Add($textBox) - -$form.Topmost = $true - -$form.Add_Shown({$textBox.Select()}) -$result = $form.ShowDialog() - -if ($result -eq [System.Windows.Forms.DialogResult]::OK) -{ - $x = $textBox.Text - $x -} \ No newline at end of file diff --git a/dump/GUI-Textbox2.ps1 b/dump/GUI-Textbox2.ps1 deleted file mode 100644 index ab2a6bd..0000000 --- a/dump/GUI-Textbox2.ps1 +++ /dev/null @@ -1,92 +0,0 @@ -### Creating the form with the Windows forms namespace -Add-Type -AssemblyName System.Windows.Forms -Add-Type -AssemblyName System.Drawing -$form = New-Object System.Windows.Forms.Form -$form.Text = 'Enter the appropriate information' ### Text to be displayed in the title -$form.Size = New-Object System.Drawing.Size(310,625) ### Size of the window -$form.StartPosition = 'CenterScreen' ### Optional - specifies where the window should start -$form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::FixedToolWindow ### Optional - prevents resize of the window -#$form.Topmost = $true ### Optional - Opens on top of other windows - -### Adding an OK button to the text box window -$OKButton = New-Object System.Windows.Forms.Button -$OKButton.Location = New-Object System.Drawing.Point(155,550) ### Location of where the button will be -$OKButton.Size = New-Object System.Drawing.Size(75,23) ### Size of the button -$OKButton.Text = 'OK' ### Text inside the button -$OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK -$form.AcceptButton = $OKButton -$form.Controls.Add($OKButton) - -### Adding a Cancel button to the text box window -$CancelButton = New-Object System.Windows.Forms.Button -$CancelButton.Location = New-Object System.Drawing.Point(70,550) ### Location of where the button will be -$CancelButton.Size = New-Object System.Drawing.Size(75,23) ### Size of the button -$CancelButton.Text = 'Cancel' ### Text inside the button -$CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel -$form.CancelButton = $CancelButton -$form.Controls.Add($CancelButton) - -### Putting a label above the text box -$label = New-Object System.Windows.Forms.Label -$label.Location = New-Object System.Drawing.Point(10,10) ### Location of where the label will be -$label.AutoSize = $True -$Font = New-Object System.Drawing.Font("Arial",12,[System.Drawing.FontStyle]::Bold) ### Formatting text for the label -$label.Font = $Font -$label.Text = $Input_Type ### Text of label, defined by the parameter that was used when the function is called -$label.ForeColor = 'Red' ### Color of the label text -$form.Controls.Add($label) - -### Inserting the text box that will accept input -$textBox = New-Object System.Windows.Forms.TextBox -$textBox.Location = New-Object System.Drawing.Point(10,40) ### Location of the text box -$textBox.Size = New-Object System.Drawing.Size(275,500) ### Size of the text box -$textBox.Multiline = $true ### Allows multiple lines of data -$textbox.AcceptsReturn = $true ### By hitting enter it creates a new line -$textBox.ScrollBars = "Vertical" ### Allows for a vertical scroll bar if the list of text is too big for the window -$form.Controls.Add($textBox) - -$form.Add_Shown({$textBox.Select()}) ### Activates the form and sets the focus on it -$result = $form.ShowDialog() ### Displays the form - -### If the OK button is selected do the following -if ($result -eq [System.Windows.Forms.DialogResult]::OK) -{ - ### Removing all the spaces and extra lines - $x = $textBox.Lines | Where{$_} | ForEach{ $_.Trim() } - ### Putting the array together - $array = @() - ### Putting each entry into array as individual objects - $array = $x -split "`r`n" - ### Sending back the results while taking out empty objects - Return $array | Where-Object {$_ -ne ''} -} - -### If the cancel button is selected do the following -if ($result -eq [System.Windows.Forms.DialogResult]::Cancel) -{ - Write-Host "User Canceled" -BackgroundColor Red -ForegroundColor White - Write-Host "Press any key to exit..." - $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") - Exit -} - - - - - -############################################################################### -### User Name(s) example of how to utilize the GUI_TextBox function -############################################################################### -$Users = GUI_TextBox "User Names(s):" ### Calls the text box function with a parameter and puts returned input in variable -$User_Count = $Users | Measure-Object | % {$_.Count} ### Measures how many objects were inputted - -If ($User_Count -eq 0){ ### If the count returns 0 it will throw and error - Write-Host "Nothing was inputed..." -BackgroundColor Red -ForegroundColor White - Return -} -Else { ### If there was actual data returned in the input, the script will continue - Write-Host "Number of users entered:" $User_Count -BackgroundColor Cyan -ForegroundColor Black - $Users - ### Here is where you would put your specific code to take action on those users inputted -} - diff --git a/dump/Hotfix-Report1.ps1 b/dump/Hotfix-Report1.ps1 deleted file mode 100644 index b59afa3..0000000 --- a/dump/Hotfix-Report1.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -<# -.Synopsis - This script will get details of perticular patch installed on remote computer. -.DESCRIPTION - This script will get details of perticular patch installed on remote computer, in this case I am trying to get recent emergency patch installed on remote computer. -.EXAMPLE - get-content "C:\temp\Hareesh\Script\Computers.txt" | get-installedpatch -.EXAMPLE - get-installedpatch -computers computer1,computer2 -.INPUTS - computername -.FUNCTIONALITY - This cmdlet is useful to check the recent emergency patch (KB4499175 or KB4499180) is installed on remote computer or not. -#> - -function get-installedpatch -{ -[cmdletbinding()] -param -( -[Parameter( -Mandatory=$true, -ValueFromPipeline=$true -)] -[string[]]$computers -) -Begin -{ - $Results = @() -} - - Process - { - foreach ($computer in $computers) - { - if (Test-Connection -ComputerName $computer -Count 1 -ea SilentlyContinue) - { - try - { - $hotfix = get-wmiobject win32_quickfixengineering -ComputerName $computer | sort Installedon -Descending | select -First 1 -ErrorAction stop - - } - catch - { - Write-output "$computer is giving exception" - $Computer #| out-file 'C:\temp\Hareesh\Script\KB4499175_ExceptionComputers.txt' -Append - } - } - else - { - Write-output "$computer is not online" #| Out-File "C:\temp\Hareesh\Script\KB4499175_Notonline.txt" - } - $hotfix - $Results #| export-csv "C:\temp\Hareesh\Script\KB4499175_Installed.csv" -NoTypeInformation - } - } -end {} -} -#get-content "C:\temp\Hareesh\Script\Computers.txt" | get-installedpatch \ No newline at end of file diff --git a/dump/Maintenance-Windows.ps1 b/dump/Maintenance-Windows.ps1 deleted file mode 100644 index 1e85ff8..0000000 --- a/dump/Maintenance-Windows.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -<# - -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 - - diff --git a/dump/NA-Collections-Updates-Downloaded.ps1 b/dump/NA-Collections-Updates-Downloaded.ps1 deleted file mode 100644 index 57961af..0000000 --- a/dump/NA-Collections-Updates-Downloaded.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -<# - -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" - -#> - -$DeviceCollection_Name = "6PM - Production Patching" -#$DeviceCollection_Name = "9PM - Production Patching" -#$DeviceCollection_Name = "11PM - Production Patching - File Servers" -#$DeviceCollection_Name = "11PM - Production Patching" -#$DeviceCollection_Name = "" - -$DD = @() -$Downloaded_Updates = @() -$NOT_Downloaded_Updates = @() -$Count = 0 -[INT]$Last_Writetime = "800" #hours - - -CD sccm-drive: - -$DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $DeviceCollection_Name | select Name,MemberCount -$DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $DeviceCollection_Name | select Name,IsClient - -Set-Location c: - -$DeviceCollection_ServerNames.Name | % { - $Computer = $_ - $Check_Contents = gci "\\$Computer\c$\Windows\ccmcache" | ? { $_.lastwritetime -gt ((Get-Date).AddHours((-$Last_Writetime))) } - - If ($Check_Contents) { $Downloaded_Updates += $Computer } - Else { $NOT_Downloaded_Updates += $Computer } - -} - -If($Downloaded_Updates) { - $Downloaded_Updates | % { - $Updates_Downloaded = gci "\\$_\c$\Windows\ccmcache" | ? { $_.lastwritetime -gt ((Get-Date).AddHours((-$Last_Writetime))) } - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Computer -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name LastWriteTime -Value $Updates_Downloaded[-1].LastWriteTime - $Obj | Add-Member -MemberType NoteProperty -Name FileName -Value $Updates_Downloaded[-1].Name - $Obj | Add-Member -MemberType NoteProperty -Name UpdatesCount -Value ($Updates_Downloaded.count) - $Obj - }#end% - }#endIf -Write-Host "" -Write-Host "Total Servers in Collection: $($DeviceCollection_MemberCount.MemberCount)" -ForegroundColor Green -Write-Host "" -Write-Host "Servers Downloaded patches count: $($Downloaded_Updates.count)" -ForegroundColor Green -Write-Host "" -Write-Host "Total Servers in Collection - $($DeviceCollection_MemberCount.MemberCount)" -Write-Host "" -Write-Host "Nothing Downloaded for: $($NOT_Downloaded_Updates.count) Servers" -ForegroundColor Yellow - -Write-Host "" - - - -<# - Write-Host "" - Write-Host "" - Write-Host "Folder Empty for the following:" - Write-Host "$NOT_Downloaded_Updates" - - -#> - - - - - diff --git a/dump/NA-Servers-Updates-Downloaded.ps1 b/dump/NA-Servers-Updates-Downloaded.ps1 deleted file mode 100644 index 9269afa..0000000 --- a/dump/NA-Servers-Updates-Downloaded.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -$Downloaded_Updates = @() -$NOT_Downloaded_Updates = @() -$Count = 0 - -$Servers = Import-Csv 'E:\SCCM-Files\SCCM-Scripts\Files\9PM - Production Patching-NoInstall.csv' - -$Servers.Server | % { - $Computer = $_ - $Check_Contents = gci "\\$Computer\c$\Windows\ccmcache" -ErrorAction SilentlyContinue #| ? { $_.lastwritetime -gt ((Get-Date).AddHours((-$Last_Writetime))) } - - If ($Check_Contents) { $Downloaded_Updates += $Computer } - Else { $NOT_Downloaded_Updates += $Computer } - -} - -If($Downloaded_Updates) { - $Downloaded_Updates | % { - $Updates_Downloaded = gci "\\$_\c$\Windows\ccmcache" -ErrorAction SilentlyContinue #| ? { $_.lastwritetime -gt ((Get-Date).AddHours((-$Last_Writetime))) } - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Computer -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name LastWriteTime -Value $Updates_Downloaded[-1].LastWriteTime - $Obj | Add-Member -MemberType NoteProperty -Name FileName -Value $Updates_Downloaded[-1].Name - $Obj | Add-Member -MemberType NoteProperty -Name UpdatesCount -Value ($Updates_Downloaded.count) - $Obj - }#end% - }#endIf -Write-Host "" -Write-Host "Nothing Downloaded for: $NOT_Downloaded_Updates" -ForegroundColor Yellow -Write-Host "" -Write-Host "Servers Downloaded patches count: $($Downloaded_Updates.count)" -ForegroundColor Green -Write-Host "" - - - - - - diff --git a/dump/NA-Tool-GUI-2.ps1 b/dump/NA-Tool-GUI-2.ps1 deleted file mode 100644 index 25fb1a7..0000000 --- a/dump/NA-Tool-GUI-2.ps1 +++ /dev/null @@ -1,312 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent - -$Script:ALL_Patch_Servers = @() -$Script:Responding = @() -$Script:NotResponding = @() -$Global:Collection_Name = "" -$Global:Select_Tool -$Global:Output_Type = "" - -If(!(Get-PSDrive -Name SCCM-Drive -ErrorAction SilentlyContinue)) { - 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" -} -######################################################################################################################################################### -Function Start-Form { - - #$Global:Collection_Name = "" - #$Global:Select_Tool = "" - #$Global:Output_Type = "" - - $Temp = "" - - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - - $Form = New-Object System.Windows.Forms.Form - $Form.Size = New-Object System.Drawing.Size(1000,800) - ############################################## - #$Form_Load={ $Script:outputBox.text = "Welcome" } - ############################################## Start functions - <# function pingInfo { - - if ($RadioButton1.Checked -eq $true) {$nrOfPings=1} - if ($RadioButton2.Checked -eq $true) {$nrOfPings=2} - if ($RadioButton3.Checked -eq $true) {$nrOfPings=3} - - $computer=$DropDownBox.SelectedItem.ToString() #populate the var with the value you selected - $pingResult=ping $wks -n $nrOfPings | fl | out-string; - $Script:outputBox.text=$pingResult - - } #end pingInfo - #> - ############################################## end functions - Function SCCM-Module { - - If(!(Get-PSDrive).Name -eq "sccm-drive") { - 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" - }#endIf - CD sccm-drive: - }#endFunction - ############################################## - Function Run-Defaults { - $Script:textBox1.Text = "Nabil - Test Collection" - $Script:RadioButton1.Checked = $true - } - ############################################## - Function temp { - $outputBox.Clear() - #$Script:outputBox.text = $textBox1.text | Out-String - $Global:Collection_Name = $textBox1.Text - #$Global:Select_Tool = $RadioButton1.Checked - - $Global:Select_Tool = $DropDownBox.text - #$Global:Output_Type = - If ($RadioButton1.Checked -eq $true) { $Global:Output_Type = "Window"; $outputBox.Text = "Radio1 Checked: $($RadioButton1.Checked)" | Out-String } - ElseIf ($RadioButton2.Checked -eq $true) { $Global:Output_Type = "Gridview"; $outputBox.Text = "Radio2 Checked: $RadioButton2.Checked" | Out-String } - ElseIf ($RadioButton3.Checked -eq $true) { $Global:Output_Type = "Export"; $outputBox.Text = "Radio3 Checked: $RadioButton2.Checked" | Out-String } - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($DropDownBox.text = "Tool1"){gcc} - Run-Tool - $textBox1.clear() - $DropDownBox.text = "----Select Tool----" - Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:outputBox.SelectionColor = 'red' - $Script:outputBox.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction - ############################################## - Function Update-Dropdown1 { - # $Collections += $textBox1.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Tool5","Tool6","Tool7") - $Collections | % { $DropDownBox.Items.Add($_) } - } - ############################################## - Function gcc { - $Script:outputBox.text = Get-Service | Out-String - } - ############################################## - Function Clear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -#region Controls - ############################################## Start group boxes - $groupBox = New-Object System.Windows.Forms.GroupBox - $groupBox.Location = New-Object System.Drawing.Size(270,20) - $groupBox.size = New-Object System.Drawing.Size(150,110) - $groupBox.text = "Select Output:" - $Form.Controls.Add($groupBox) - ############################################## end group boxes - - ############################################## Start radio buttons - $Script:RadioButton1 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton1.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton1.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton1.Checked = $true - $Script:RadioButton1.Text = "Window" - $groupBox.Controls.Add($RadioButton1) - - $Script:RadioButton2 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton2.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton2.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton2.Text = "Gridview" - $groupBox.Controls.Add($RadioButton2) - - $Script:RadioButton3 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton3.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton3.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton3.Text = "Export csv" - $groupBox.Controls.Add($RadioButton3) - - ############################################## end radio buttons - ########### Text Box ########### - ############Define text box1 for input - $Script:textBox1 = New-Object “System.Windows.Forms.TextBox”; - $Script:textBox1.Left = 20; - $Script:textBox1.Top = 30; - $Script:textBox1.width = 200; - $Script:textBox1.Text = "Nabil - Test Collection" - $Form.Controls.Add($textBox1) - ############################################## Start drop down boxes - - $Script:DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:DropDownBox.Location = New-Object System.Drawing.Size(20,80) - $Script:DropDownBox.Size = New-Object System.Drawing.Size(180,20) - $Script:DropDownBox.DropDownHeight = 200 - $Script:DropDownBox.text = "----Select Tool----" - $Form.Controls.Add($DropDownBox) - - ############################################## end drop down boxes - - <############################################## Start text fields - - $Script:outputBox = New-Object System.Windows.Forms.TextBox - $Script:outputBox.Location = New-Object System.Drawing.Size(10,150) - $Script:outputBox.Size = New-Object System.Drawing.Size(865,300) - $Script:outputBox.MultiLine = $True - - $Script:outputBox.ScrollBars = "Vertical" - $Form.Controls.Add($Script:outputBox) - ###########> - $SCRIPT:outputBox=New-Object System.Windows.Forms.RichTextBox - $outputBox.Location=New-Object System.Drawing.Size(10,150) - $outputBox.Size=New-Object System.Drawing.Size(965,600) - $outputBox.Multiline=$True - $outputBox.ReadOnly = $True - $outputBox.BackColor = [Drawing.Color]::White - $outputBox.ScrollBars = "both" - $outputBox.WordWrap = $false - $outputBox.Font = 'Consolas, 8.25pt' - $form.Controls.Add($Script:outputBox) - - - - - ############################################## end text fields - - ############################################## Start buttons - - $Button = New-Object System.Windows.Forms.Button - $Button.Location = New-Object System.Drawing.Size(450,30) - $Button.Size = New-Object System.Drawing.Size(110,80) - $Button.Text = "Go" - $Button.Add_Click({temp}) - $Form.Controls.Add($Button) -#endregion Controls - ############################################## end buttons - Update-Dropdown1 - - $Form.Add_Shown({$Form.Activate()}) - [void] $Form.ShowDialog() - -} -######################################################################################################################################################### - <# Function Input-Box { - [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') - $Global:Collection_Name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter your name", "Name", "Enter Collection Name") - - } - #> -############################################################################################################################################################# - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - Set-Location c: - $Script:DeviceCollection_ServerNames1.Name | % { - - $Obj = New-Object -TypeName PSObject - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:outputBox.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - - }#endIf - - Else { - #$Script:outputBox.AppendText("NOT Responding: $_") - $NotResponding += $_ - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - } - }#end% - $Script:outputBox.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - SCCM-Module - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:outputBox.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $outputBox.Text = $T | ft -AutoSize | Out-String - } -############################################################################################################################################################# - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - }#endSwitch - #Clear-Variables - }#endFunction -############################################################################################################################################################# -Start-Form - diff --git a/dump/NA-Tool-GUI.ps1 b/dump/NA-Tool-GUI.ps1 deleted file mode 100644 index e16ec00..0000000 --- a/dump/NA-Tool-GUI.ps1 +++ /dev/null @@ -1,293 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent - -$Script:ALL_Patch_Servers = @() -$Script:Responding = @() -$Script:NotResponding = @() -$Global:Collection_Name = "" -$Global:Select_Tool -$Global:Output_Type = "" - -If(!(Get-PSDrive -Name SCCM-Drive -ErrorAction SilentlyContinue)) { - 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" -} -######################################################################################################################################################### -Function Start-Form { - - #$Global:Collection_Name = "" - #$Global:Select_Tool = "" - #$Global:Output_Type = "" - - $Temp = "" - - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - - $Form = New-Object System.Windows.Forms.Form - $Form.Size = New-Object System.Drawing.Size(900,500) - ############################################## - #$Form_Load={ $Script:outputBox.text = "Welcome" } - ############################################## Start functions - <# function pingInfo { - - if ($RadioButton1.Checked -eq $true) {$nrOfPings=1} - if ($RadioButton2.Checked -eq $true) {$nrOfPings=2} - if ($RadioButton3.Checked -eq $true) {$nrOfPings=3} - - $computer=$DropDownBox.SelectedItem.ToString() #populate the var with the value you selected - $pingResult=ping $wks -n $nrOfPings | fl | out-string; - $Script:outputBox.text=$pingResult - - } #end pingInfo - #> - ############################################## end functions - Function SCCM-Module { - - If(!(Get-PSDrive).Name -eq "sccm-drive") { - 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" - }#endIf - CD sccm-drive: - }#endFunction - ############################################## - Function Run-Defaults { - $Script:textBox1.Text = "Nabil - Test Collection" - $Script:RadioButton1.Checked = $true - } - ############################################## - Function temp { - $outputBox.Clear() - #$Script:outputBox.text = $textBox1.text | Out-String - $Global:Collection_Name = $textBox1.Text - #$Global:Select_Tool = $RadioButton1.Checked - - $Global:Select_Tool = $DropDownBox.text - #$Global:Output_Type = - If ($RadioButton1.Checked -eq $true) { $Global:Output_Type = "Window"; $outputBox.Text = "Radio1 Checked: $($RadioButton1.Checked)" | Out-String } - ElseIf ($RadioButton2.Checked -eq $true) { $Global:Output_Type = "Gridview"; $outputBox.Text = "Radio2 Checked: $RadioButton2.Checked" | Out-String } - ElseIf ($RadioButton3.Checked -eq $true) { $Global:Output_Type = "Export"; $outputBox.Text = "Radio3 Checked: $RadioButton2.Checked" | Out-String } - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($DropDownBox.text = "Tool1"){gcc} - Run-Tool - $textBox1.clear() - $DropDownBox.text = "----Select Tool----" - Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:outputBox.SelectionColor = 'red' - $Script:outputBox.Text = "You must select 'Tool' and enter Collection Name............!!" - } - Run-Defaults - }#endFunction - ############################################## - Function Update-Dropdown1 { - # $Collections += $textBox1.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Tool4","Tool5","Tool6","Tool7") - $Collections | % { $DropDownBox.Items.Add($_) } - } - ############################################## - Function gcc { - $Script:outputBox.text = Get-Service | Out-String - } - ############################################## - Function Clear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -#region Controls - ############################################## Start group boxes - $groupBox = New-Object System.Windows.Forms.GroupBox - $groupBox.Location = New-Object System.Drawing.Size(270,20) - $groupBox.size = New-Object System.Drawing.Size(150,110) - $groupBox.text = "Select Output:" - $Form.Controls.Add($groupBox) - ############################################## end group boxes - - ############################################## Start radio buttons - $Script:RadioButton1 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton1.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton1.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton1.Checked = $true - $Script:RadioButton1.Text = "Window" - $groupBox.Controls.Add($RadioButton1) - - $Script:RadioButton2 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton2.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton2.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton2.Text = "Gridview" - $groupBox.Controls.Add($RadioButton2) - - $Script:RadioButton3 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton3.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton3.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton3.Text = "Export csv" - $groupBox.Controls.Add($RadioButton3) - - ############################################## end radio buttons - ########### Text Box ########### - ############Define text box1 for input - $Script:textBox1 = New-Object “System.Windows.Forms.TextBox”; - $Script:textBox1.Left = 20; - $Script:textBox1.Top = 30; - $Script:textBox1.width = 200; - $Script:textBox1.Text = "Nabil - Test Collection" - $Form.Controls.Add($textBox1) - ############################################## Start drop down boxes - - $Script:DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:DropDownBox.Location = New-Object System.Drawing.Size(20,80) - $Script:DropDownBox.Size = New-Object System.Drawing.Size(180,20) - $Script:DropDownBox.DropDownHeight = 200 - $Script:DropDownBox.text = "----Select Tool----" - $Form.Controls.Add($DropDownBox) - - ############################################## end drop down boxes - - <############################################## Start text fields - - $Script:outputBox = New-Object System.Windows.Forms.TextBox - $Script:outputBox.Location = New-Object System.Drawing.Size(10,150) - $Script:outputBox.Size = New-Object System.Drawing.Size(865,300) - $Script:outputBox.MultiLine = $True - - $Script:outputBox.ScrollBars = "Vertical" - $Form.Controls.Add($Script:outputBox) - ###########> - $SCRIPT:outputBox=New-Object System.Windows.Forms.RichTextBox - $outputBox.Location=New-Object System.Drawing.Size(10,150) - $outputBox.Size=New-Object System.Drawing.Size(865,300) - $outputBox.Multiline=$True - $outputBox.ReadOnly = $True - $outputBox.BackColor = [Drawing.Color]::White - $outputBox.ScrollBars = "Vertical" - $form.Controls.Add($Script:outputBox) - - - - - ############################################## end text fields - - ############################################## Start buttons - - $Button = New-Object System.Windows.Forms.Button - $Button.Location = New-Object System.Drawing.Size(450,30) - $Button.Size = New-Object System.Drawing.Size(110,80) - $Button.Text = "Go" - $Button.Add_Click({temp}) - $Form.Controls.Add($Button) -#endregion Controls - ############################################## end buttons - Update-Dropdown1 - - $Form.Add_Shown({$Form.Activate()}) - [void] $Form.ShowDialog() - -} -######################################################################################################################################################### - <# Function Input-Box { - [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') - $Global:Collection_Name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter your name", "Name", "Enter Collection Name") - - } - #> -############################################################################################################################################################# - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - Set-Location c: - $Script:DeviceCollection_ServerNames1.Name | % { - - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - $Script:outputBox.AppendText("Responding: $_") - - $Responding += $_ - - }#endIf - - Else { - $Script:outputBox.AppendText("NOT Responding: $_") - $NotResponding += $_ } - - }#end% - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - SCCM-Module - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:outputBox.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } -############################################################################################################################################################# - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - }#endSwitch - #Clear-Variables - }#endFunction -############################################################################################################################################################# -Start-Form - diff --git a/dump/NA-Tool.ps1 b/dump/NA-Tool.ps1 deleted file mode 100644 index 5d2fc2d..0000000 --- a/dump/NA-Tool.ps1 +++ /dev/null @@ -1,133 +0,0 @@ -# Import-Module E:\SCCM-Files\SCCM-Scripts\CMClient.psm1 - -######### From _Get-SCCMSoftwareUpdateStatus.ps1 ####### - -#Get-SCCMSoftwareUpdateStatus -DeploymentIDFromGUI -# $Status = Get-SCCMSoftwareUpdateStatus -DeploymentID 16777359 | select DeviceName - -<# - $status | ? { $_.status -eq "InProgress" } - $Status | ? { $_.status -eq "unknown" } - $Status | ? { $_.status -eq "Error" } - $Status | ? { $_.status -eq "unknown" } | Measure | Select Count - -#> -#################################################################################### - -###### From CCMClient.psm1 #### - -<# -#################################################################################### -#################################################################################### - -Invoke-CMClientUpdateScan -ComputerName -Invoke-CMClientUpdateDeploymentEvaluation -ComputerName -Invoke-CMClientMachinePolicyDownload -ComputerName - - - -$comps | % { - Invoke-CMClientUpdateScan -ComputerName $_ - Invoke-CMClientUpdateDeploymentEvaluation -ComputerName $_ - Invoke-CMClientMachinePolicyDownload -ComputerName $_ -} -#################################################################################### -#################################################################################### - -$comps = "" - - -<# - -$DeviceCollection_ServerNames.Name | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } -} - - -#################################################################################### -### - -$Responding = @() -$NotResponding = @() - -$DeviceCollection_ServerNames.Name | % { - - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - Write-Host "Responding:---- $_ " -ForegroundColor Green - $Responding += $_ - - }#endIf - - Else { $NotResponding += $_ } - -}#end% - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames.Name.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames.Name.count) -- NOT Responding" -foregroundcolor Red - - -Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - -$Responding | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | ft -autosize - - -#################################################################################### - - gwmi win32_operatingsystem -ComputerName $DeviceCollection_ServerNames.Name | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}} | ft -autosize - - -#> - -<# -#################################################################################### -#################################################################################### - -$Downloaded_Updates = @() -$NOT_Downloaded_Updates = @() -$Count = 0 -[INT]$Last_Writetime = "90" - -$comps = $DeviceCollection_ServerNames.name - -$comps | % { - $Computer = $_ - $Check_Contents = gci "\\$Computer\c$\Windows\ccmcache" | ? { $_.lastwritetime -gt ((Get-Date).ADDDays((-$Last_Writetime))) } - - If ($Check_Contents) { $Downloaded_Updates += $Computer } - Else { $NOT_Downloaded_Updates += $Computer } - -} - -If($Downloaded_Updates) { - $Downloaded_Updates | % { - $Updates_Downloaded = gci "\\$_\c$\Windows\ccmcache" | ? { $_.lastwritetime -gt ((Get-Date).ADDDays((-$Last_Writetime))) } - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Computer -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name LastWriteTime -Value $Updates_Downloaded[-1].LastWriteTime - $Obj | Add-Member -MemberType NoteProperty -Name FileName -Value $Updates_Downloaded[-1].Name - $Obj | Add-Member -MemberType NoteProperty -Name UpdatesCount -Value ($Updates_Downloaded.count) - $Obj - }#end% - }#endIf -Write-Host "" -Write-Host "Nothing Downloaded for: $NOT_Downloaded_Updates" -ForegroundColor Yellow -Write-Host "" -Write-Host "Servers Downloaded patches count: $($Downloaded_Updates.count)" -ForegroundColor Green -Write-Host "" -#################################################################################### -#################################################################################### -#> - - -#> - -######################## Check Installed Updates ########################### - -# $DeviceCollection_ServerNames.Name | % { Get-HotFix -ComputerName $_ | sort installedon -Descending | Select -First 1} - -# Get-HotFix -ComputerName pfnp013 | sort installedon -Descending | Select -First 10 - - -# $DeviceCollection_Name - - diff --git a/dump/Patching-Status-PILOT.ps1 b/dump/Patching-Status-PILOT.ps1 deleted file mode 100644 index 6bd43da..0000000 --- a/dump/Patching-Status-PILOT.ps1 +++ /dev/null @@ -1,93 +0,0 @@ - <# - -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" - -#> - - - <# - - $Count = 0 - -# $D_ID = "16777912","16777914","16777916" -# $D_ID = "16777913","16777915","16777917" - -# $D_ID = "16778068" - - $Patching_Collections = "All - Inventory - Supporting Infrastructure", #------------------------0 - "All - Inventory - Database", #------------------------1 - "All - Inventory - Application Servers" #----------2 - - - - -<# - $Patching_Collections = "All - Inventory - Infrastructure Servers", #------------------------0 - "All - Inventory - Supporting Infrastructure", #------------------------1 - "All - Inventory - Database", #------------------------2 - "All - Inventory - Application Servers" #----------3 - - $D_ID = @("16777850"),"16777851") - $Patching_Collections = @("_6PM - Production Patching - Group 1"), - "_6PM - Production Patching - Group 2" - -#> - - - - - #> - $Run_Collections = "0","1","2" -# $Run_Collections = "0" - - $Script:Temp = @() - - -$Global:General = @() - - Function Patch_Report { - Param($ID,$Name) - $ID - $T = Get-SCCMSoftwareUpdateStatus -DeploymentID $ID - - write-host "" - write-host "------------------------------------------------------------------------------------" - write-host "$Name" -foregroundcolor white -backgroundcolor black - write-host "Total Servers: $($T.DeviceName.Count)" -foregroundcolor Black -Backgroundcolor white - $S = $T | ? { $_.Status -eq "InProgress" } - $Err = $T | ? { $_.Status -eq 'error' } | Select DeviceName - $Success = $T | ? { $_.Status -eq 'Success' } | Select DeviceName - $Un = $T | ? { $_.Status -eq 'Unknown' } | Select DeviceName - Write-Host "Unknown: $($Un.count)" -ForegroundColor Gray - Write-Host "Success: $($Success.Devicename.count)" -ForegroundColor Green - write-host "InProgress: $($S.DeviceName.count)" -foregroundcolor Cyan - write-host "Error Count: $($err.DeviceName.count)" -foregroundcolor red - - #Write-Host "Error: $($Err.count)" - $Temp = $Err - $Global:General = $Err - }#endFunction - -Write-Host "#####################################################################################" -BackgroundColor green -ForegroundColor black -$Run_Collections | % { Patch_Report -ID $D_ID[$_] -Name $Patching_Collections[$_] } - - - - <# - - - -$DeviceCollection_ServerNames.Name | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } -} - - - # $DeviceCollection_ServerNames.Name | % { gwmi win32_operatingsystem -ComputerName $_ | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort server| ft -autosize - - - # gwmi win32_operatingsystem -ComputerName $Temp.DeviceName | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}} | ft -autosize - - - - #> \ No newline at end of file diff --git a/dump/Patching-Status.ps1 b/dump/Patching-Status.ps1 deleted file mode 100644 index a191235..0000000 --- a/dump/Patching-Status.ps1 +++ /dev/null @@ -1,68 +0,0 @@ - <# - - $T = Get-SCCMSoftwareUpdateStatus -DeploymentID 16777538 # _11PM - Production Patching - $S = $T | ? { $_.Status -eq "InProgress" } - write-host "" - write-host "------------------------------------------------------------------------------------" - write-host "_11PM - Production Patching" -foregroundcolor white -backgroundcolor black - write-host "Total Servers: $($S.DeviceName.count)" -foregroundcolor Black -Backgroundcolor white - $Err = $T | ? { $_.Status -eq 'error' } | Select DeviceName - $Success = $T | ? { $_.Status -eq 'Success' } | Select DeviceName - write-host "Error Count: $($err.count)" -foregroundcolor Yellow - write-host "InProgress: $($S.DeviceName.count)" -foregroundcolor Cyan - - #> - - <# - - $T = Get-SCCMSoftwareUpdateStatus -DeploymentID 16777541 # _9PM - Production Patching - $S = $T | ? { $_.Status -eq "InProgress" } - write-host "" - write-host "------------------------------------------------------------------------------------" - write-host "_9PM - Production Patching" -foregroundcolor white -backgroundcolor black - write-host "Total Servers: $($S.DeviceName.count)" -foregroundcolor Black -Backgroundcolor white - $Err = $T | ? { $_.Status -eq 'error' } | Select DeviceName - $Success = $T | ? { $_.Status -eq 'Success' } | Select DeviceName - write-host "Error Count: $($err.count)" -foregroundcolor Yellow - write-host "InProgress: $($S.DeviceName.count)" -foregroundcolor Cyan - - #> - - <# - $T = Get-SCCMSoftwareUpdateStatus -DeploymentID 16777540 # _6PM - Production Patching - $S = $T | ? { $_.Status -eq "InProgress" } - write-host "" - write-host "------------------------------------------------------------------------------------" - write-host "_6PM - Production Patching" -foregroundcolor white -backgroundcolor black - write-host "Total Servers: $($S.DeviceName.count)" -foregroundcolor Black -Backgroundcolor white - $Err = $T | ? { $_.Status -eq 'error' } | Select DeviceName - $Success = $T | ? { $_.Status -eq 'Success' } | Select DeviceName - write-host "Error Count: $($err.count)" -foregroundcolor Yellow - write-host "InProgress: $($S.DeviceName.count)" -foregroundcolor Cyan - write-host "Success: $($Success.DeviceName.count)" -foregroundcolor Green - - #> - - <# - $T = Get-SCCMSoftwareUpdateStatus -DeploymentID 16777539 # _11PM - Production Patching - File Servers - $S = $T | ? { $_.Status -eq "InProgress" } - $S.DeviceName.count - write-host "" - write-host "------------------------------------------------------------------------------------" - write-host "_11PM - Production Patching - File Servers" -foregroundcolor white -backgroundcolor black - write-host "Total Servers: $($S.DeviceName.count)" -foregroundcolor Black -Backgroundcolor white - $Err = $T | ? { $_.Status -eq 'error' } | Select DeviceName - $Success = $T | ? { $_.Status -eq 'Success' } | Select DeviceName - write-host "Error Count: $($err.count)" -foregroundcolor Yellow - write-host "InProgress: $($S.DeviceName.count)" -foregroundcolor Cyan - write-host "Success: $($Success.DeviceName.count)" -foregroundcolor Green - - #> - - - # - # Test-Connection -ComputerName $s.DeviceName -Count 1 - # gwmi win32_operatingsystem -ComputerName $s.devicename | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}} | sort LastBootup -descending | ft -autosize - - - # gwmi win32_operatingsystem -ComputerName PVST002 | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}} | ft -autosize diff --git a/dump/Q and A - Remote software center - Concept Preview.URL b/dump/Q and A - Remote software center - Concept Preview.URL deleted file mode 100644 index 3575cbf..0000000 --- a/dump/Q and A - Remote software center - Concept Preview.URL +++ /dev/null @@ -1,6 +0,0 @@ -[InternetShortcut] -URL=https://gallery.technet.microsoft.com/systemcenter/Remote-software-center-044e3514/view/Discussions#content -IDList= -HotKey=0 -IconFile=C:\Users\nnazmat\AppData\Local\Mozilla\Firefox\Profiles\20v5hisb.default-release\shortcutCache\2y5eSHQr6ejNZZQJXZyJKg==.ico -IconIndex=0 diff --git a/dump/RPC2.PS1 b/dump/RPC2.PS1 deleted file mode 100644 index 744c131..0000000 --- a/dump/RPC2.PS1 +++ /dev/null @@ -1,184 +0,0 @@ -# Author: Ryan Ries [MSFT] -# Updated By: Abdulrehman Altaf -# Origianl date: 15 Feb. 2014 -# updated date: 27 September 2018 -#Requires -Version 3 -Function Test-RPC -{ - [CmdletBinding(SupportsShouldProcess=$True)] - Param([Parameter(ValueFromPipeline=$True)][String[]]$ComputerName = 'localhost') - BEGIN - { - Set-StrictMode -Version Latest - $PInvokeCode = @' - using System; - using System.Collections.Generic; - using System.Runtime.InteropServices; - - public class Rpc - { - // I found this crud in RpcDce.h - - [DllImport("Rpcrt4.dll", CharSet = CharSet.Auto)] - public static extern int RpcBindingFromStringBinding(string StringBinding, out IntPtr Binding); - - [DllImport("Rpcrt4.dll")] - public static extern int RpcBindingFree(ref IntPtr Binding); - - [DllImport("Rpcrt4.dll", CharSet = CharSet.Auto)] - public static extern int RpcMgmtEpEltInqBegin(IntPtr EpBinding, - int InquiryType, // 0x00000000 = RPC_C_EP_ALL_ELTS - int IfId, - int VersOption, - string ObjectUuid, - out IntPtr InquiryContext); - - [DllImport("Rpcrt4.dll", CharSet = CharSet.Auto)] - public static extern int RpcMgmtEpEltInqNext(IntPtr InquiryContext, - out RPC_IF_ID IfId, - out IntPtr Binding, - out Guid ObjectUuid, - out IntPtr Annotation); - - [DllImport("Rpcrt4.dll", CharSet = CharSet.Auto)] - public static extern int RpcBindingToStringBinding(IntPtr Binding, out IntPtr StringBinding); - - public struct RPC_IF_ID - { - public Guid Uuid; - public ushort VersMajor; - public ushort VersMinor; - } - - public static List QueryEPM(string host) - { - List ports = new List(); - int retCode = 0; // RPC_S_OK - IntPtr bindingHandle = IntPtr.Zero; - IntPtr inquiryContext = IntPtr.Zero; - IntPtr elementBindingHandle = IntPtr.Zero; - RPC_IF_ID elementIfId; - Guid elementUuid; - IntPtr elementAnnotation; - - try - { - retCode = RpcBindingFromStringBinding("ncacn_ip_tcp:" + host, out bindingHandle); - if (retCode != 0) - throw new Exception("RpcBindingFromStringBinding: " + retCode); - - retCode = RpcMgmtEpEltInqBegin(bindingHandle, 0, 0, 0, string.Empty, out inquiryContext); - if (retCode != 0) - throw new Exception("RpcMgmtEpEltInqBegin: " + retCode); - - do - { - IntPtr bindString = IntPtr.Zero; - retCode = RpcMgmtEpEltInqNext (inquiryContext, out elementIfId, out elementBindingHandle, out elementUuid, out elementAnnotation); - if (retCode != 0) - if (retCode == 1772) - break; - - retCode = RpcBindingToStringBinding(elementBindingHandle, out bindString); - if (retCode != 0) - throw new Exception("RpcBindingToStringBinding: " + retCode); - - string s = Marshal.PtrToStringAuto(bindString).Trim().ToLower(); - if(s.StartsWith("ncacn_ip_tcp:")) - ports.Add(int.Parse(s.Split('[')[1].Split(']')[0])); - - RpcBindingFree(ref elementBindingHandle); - - } - while (retCode != 1772); // RPC_X_NO_MORE_ENTRIES - - } - catch(Exception ex) - { - Console.WriteLine(ex); - return ports; - } - finally - { - RpcBindingFree(ref bindingHandle); - } - - return ports; - } - } -'@ - } - PROCESS - { - ForEach($Computer In $ComputerName) - { - If($PSCmdlet.ShouldProcess($Computer)) - { - [Bool]$EPMOpen = $False - $Socket = New-Object Net.Sockets.TcpClient - - Try - { - $Socket.Connect($Computer, 135) - If ($Socket.Connected) - { - $EPMOpen = $True - } - $Socket.Close() - } - Catch - { - $Socket.Dispose() - } - - If ($EPMOpen) - { - Add-Type $PInvokeCode - $RPCPorts = [Rpc]::QueryEPM($Computer) - [Bool]$AllPortsOpen = $True - Foreach ($Port In $RPCPorts) - { - $Socket = New-Object Net.Sockets.TcpClient - Try - { - $Socket.Connect($Computer, $Port) - If (!$Socket.Connected) - { - $AllPortsOpen = $False - } - $Socket.Close() - } - Catch - { - $AllPortsOpen = $False - $Socket.Dispose() - } - } - - #[PSObject]@{'ComputerName' = $Computer; 'EndPointMapperOpen' = $EPMOpen; 'RPCPortsInUse' = $RPCPorts; 'AllRPCPortsOpen' = $AllPortsOpen} - - Write-Host "open RPC ports on $Computer are:" -BackgroundColor Green -ForegroundColor Black - Write-Host "------------------Summary------------------" - [PSObject]@{'ComputerName' = $Computer; 'EndPointMapperOpen' = $EPMOpen; 'AllRPCPortsOpen' = $AllPortsOpen; 'RPCPortsInUse' = $RPCPorts;} - Write-Host "------------------Port Detail------------------" - - foreach ($all_rpc_prots in $RPCPorts){ - [PSObject]@{'RPCPortsInUse' = $all_rpc_prots;'AllRPCPortsOpen' = $AllPortsOpen; } - - - } - } - Else - { - [PSObject]@{'ComputerName' = $Computer; 'EndPointMapperOpen' = $EPMOpen} - } - } - } - } - END - { - - } -} - -Test-RPC 10.162.98.80 \ No newline at end of file diff --git a/dump/Reboot-Notification-Dialog.ps1 b/dump/Reboot-Notification-Dialog.ps1 deleted file mode 100644 index 90c8058..0000000 --- a/dump/Reboot-Notification-Dialog.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -$computer = "dfnp002" -$namespace = "ROOT\ccm\Policy\Machine\ActualConfig" -$classname = "CCM_RebootSettings" - -Write-Output "=====================================" -Write-Output "COMPUTER : $computer " -Write-Output "CLASS : $classname " -Write-Output "=====================================" - -Get-WmiObject -Class $classname -ComputerName $computer -Namespace $namespace | - Select-Object * -ExcludeProperty PSComputerName, Scope, Path, Options, ClassPath, Properties, SystemProperties, Qualifiers, Site, Container | - Format-List -Property [a-z]* diff --git a/dump/Remote Software Center.ps1 b/dump/Remote Software Center.ps1 deleted file mode 100644 index c14f245..0000000 --- a/dump/Remote Software Center.ps1 +++ /dev/null @@ -1,1648 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: f5f77db1-ba0b-4c5a-80b7-afa0e33b688d -# Source File: Remote Software Center.psproj -#------------------------------------------------------------------------ -#region Project Recovery Data (DO NOT MODIFY) -<#RecoveryData: -/gEAAB+LCAAAAAAABACFkU9PwyAYh+9L9h0I966tc7YHxkGXmh38k3XxaqB9cSiFBuiWfXvRtssW -Nd54wu99fnmBbKAye7DHFfOMTicIkWdr3qHy3xDwBayTRtOrWULiEYa7QipYr6hYiCyreRpxlvDo -ulqwKE94FjHBEpjP+U2e1yQewsPo0LI9tkCD+BxHuVF1qEPxeZsbYEB020lVL3GCaemZ9V07a53r -u/5KonLHLITj1naA0QYEWNAVFJ2ufFhuidd6bz4guleGM/XauhTT/uyCPf3H/ouv3JlD9MCkLoxt -gk9gOlIQigthD/2ap2fp6cnKN6mZ+go8sgboBhrjAZVG+ENYCd2B9mCDsg1jJP6Rn05IfPHfn1/a -p1b+AQAA#> -#endregion -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.3.131 - Generated on: 2017-01-18 13:57 - Generated by: Timmy - -------------------------------------------------------------------------------- - .DESCRIPTION - Script generated by PowerShell Studio 2016 -#> - - -#region Source: Startup.pss -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -2gMAAB+LCAAAAAAABAC9k0tLAzEQgO+C/yH0vGR33a5rIbsglV4EFVfUazadLcE8yiRpyb+3rVJF -QaGHMJd5MPMxL/YIwm4A4w33nOwUJ61pJxe0nHTnZ4Swe5QrabhaSAV3XEPXe44+rOnaOZb/ih5y -rp0DPSgJ7mB/eWKnnbCo5JCR50/WlBZ7ycg8KB8QWgPBI1cZeQi7GuIW4pN9A9MOTcNrUV+Ws2oK -xdWM5ceqPyl9dB50CgZ9kWZpt44uLGqXhLjfVBoQ8q00q1NYRTXWYzOW5bIueMX/Z71qlaSnuUVI -MzyJILzF2ANupICTbuPvMR7Nj0dj+fdf7t4BtbYVHtoDAAA=#> -#endregion -#---------------------------------------------- -#region Import Assemblies -#---------------------------------------------- -[void][Reflection.Assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') -[void][Reflection.Assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') -[void][Reflection.Assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') -[void][Reflection.Assembly]::Load('System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') -#endregion Import Assemblies - -#Define a Param block to use custom parameters in the project -#Param ($CustomParameter) - -function Main { -<# - .SYNOPSIS - The Main function starts the project application. - - .PARAMETER Commandline - $Commandline contains the complete argument string passed to the script packager executable. - - .NOTES - Use this function to initialize your script and to call GUI forms. - - .NOTES - To get the console output in the Packager (Forms Engine) use: - $ConsoleOutput (Type: System.Collections.ArrayList) -#> - Param ([String]$Commandline) - - #-------------------------------------------------------------------------- - #TODO: Add initialization script here (Load modules and check requirements) - - - #-------------------------------------------------------------------------- - - if((Show-MainForm_psf) -eq 'OK') - { - - } - - $script:ExitCode = 0 #Set the exit code for the Packager -} - - - - - - - -#endregion Source: Startup.pss - -#region Source: Globals.ps1 - #-------------------------------------------- - # Declare Global Variables and Functions here - #-------------------------------------------- - - - #Sample function that provides the location of the script - function Get-ScriptDirectory - { - <# - .SYNOPSIS - Get-ScriptDirectory returns the proper location of the script. - - .OUTPUTS - System.String - - .NOTES - Returns the correct path within a packaged executable. - #> - [OutputType([string])] - param () - if ($null -ne $hostinvocation) - { - Split-Path $hostinvocation.MyCommand.path - } - else - { - Split-Path $script:MyInvocation.MyCommand.Path - } - } - - #Sample variable that provides the location of the script - [string]$ScriptDirectory = Get-ScriptDirectory - - function Write-Status - { - [cmdletbinding()] - param - ( - [Parameter(Mandatory)] - [ValidateNotNull()] - [String]$Message - - ) - $statusbar1.Text = $Message - } - - function Invoke-OSDInstall - { - Param - ( - [String][Parameter(Mandatory = $True, Position = 1)] - $Computername, - [String][Parameter(Mandatory = $True, Position = 2)] - $OSDName - - ) - Begin - { - - $CIMClass = (Get-CimClass -Namespace root\ccm\clientsdk -ComputerName $Computername -ClassName CCM_ProgramsManager) - $OSD = (Get-CimInstance -ClassName CCM_Program -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.Name -like "$OSDName" }) - - $Args = @{ - PackageID = $OSD.PackageID - ProgramID = $OSD.ProgramID - } - } - - Process - { - - Invoke-CimMethod -CimClass $CIMClass -ComputerName $Computername -MethodName "ExecuteProgram" –Arguments $Args - - } - End { } - } - - Function Invoke-AppInstall - { - - Param - ( - [String][Parameter(Mandatory = $True, Position = 1)] - $Computername, - [String][Parameter(Mandatory = $True, Position = 2)] - $AppName, - [ValidateSet("Install", "Uninstall")] - [String][Parameter(Mandatory = $True, Position = 3)] - $Method - ) - - Begin - { - $Application = (Get-CimInstance -ClassName CCM_Application -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.Name -like $AppName }) - - $Args = @{ - EnforcePreference = [UINT32] 0 - Id = "$($Application.id)" - IsMachineTarget = $Application.IsMachineTarget - IsRebootIfNeeded = $False - Priority = 'High' - Revision = "$($Application.Revision)" - } - - } - - Process - { - - Invoke-CimMethod -Namespace "root\ccm\clientSDK" -ClassName CCM_Application -ComputerName $Computername -MethodName $Method -Arguments $Args - - } - - End { } - - } - - function Invoke-SupInstall - { - Param - ( - [String][Parameter(Mandatory = $True, Position = 1)] - $Computername, - [String][Parameter(Mandatory = $True, Position = 2)] - $SupName - - ) - Begin - { - $AppEvalState0 = "0" - $AppEvalState1 = "1" - $ApplicationClass = [WmiClass]"root\ccm\clientSDK:CCM_SoftwareUpdatesManager" - } - - Process - { - If ($SupName -Like "All" -or $SupName -like "all") - { - Foreach ($Computer in $Computername) - { - $Application = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_SoftwareUpdate -ComputerName $Computer | Where-Object { $_.EvaluationState -like "*$($AppEvalState0)*" -or $_.EvaluationState -like "*$($AppEvalState1)*" }) - Invoke-WmiMethod -Class CCM_SoftwareUpdatesManager -Name InstallUpdates -ArgumentList ( ,$Application) -Namespace root\ccm\clientsdk -ComputerName $Computer - - } - - } - Else - { - Foreach ($Computer in $Computername) - { - $Application = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_SoftwareUpdate -ComputerName $Computer | Where-Object { $_.EvaluationState -like "*$($AppEvalState)*" -and $_.Name -like "*$($SupName)*" }) - Invoke-WmiMethod -Class CCM_SoftwareUpdatesManager -Name InstallUpdates -ArgumentList ( ,$Application) -Namespace root\ccm\clientsdk -ComputerName $Computer - - } - - } - } - End { } - } -#endregion Source: Globals.ps1 - -#region Source: MainForm.psf -function Show-MainForm_psf -{ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -pTcAAB+LCAAAAAAABADVW1tzokwTvrfK/0B58d7ECuIhMfUmVg2IOXwxUVFzuEkhjiwrgi9g0Pz6 -r4eDHASFbMzuZqtieg7dT3c/M92QzeUAS/o7NjZt0RIp+MFUdO2qVD1lSq1igaIuHw1FVjRR7Sgq -fhAXuNUVFa2jG4vTpTm7pHem3U2Tn1iyKGuzxFclYWNaeHH6pGhT3TZPyV73e5lKmipTYw9F/bRC -/pUpbqVaKwNfaXhlGaJapnqriapI/8OboT7H2tXk/FxsSI0z5qJWx5XmRYnSAMpVaQb6CNwSJf1Q -1KkBS0ucrlmGrpque4C1Z+hLbFgbbw9aWbogiSpuKwusERyw9KxMMbVL2l96aGtXn+JSqwOWDu7h -VAVrlqB8wIb6eaNM1c6Zg5tIoEst37uDywVLNKyebioWeFNqcWAQG4JkYHx47xCvrVJrgBe6hSlB -n1m2aGDKVbG7mX+HCW8nSSan6iaeBlDfgsFL2lmctPNeF8N7iBhbfZhf7MqydO3oDJs4Zm410xJV -VRj19jEtgTCa9EM3Si1WBy1wHO7xbJcxu9vudUl0U1k7q5apavUiwyaXM3G8GTa63CTUrO4egQTC -iJNbbYrXpRZzlmW5w69/xMXyXw8VlQ0W2Xi7EGU8wKoXDUdkMRAHk9kMSkYmHivmSlQFa6NiVpTm -nK6SjAyNFU7aH6YpHF1pvhvSN2c8RljaZWx2/nL6YqKz+vroDJaIoYm+zk1eAkS0LEWTeU2cqOSY -p0Utlb8Mk4++IbCZmVurNMHI7qW6l7qN3bstdwrvxQlWj54/lVjxL+bRcipa2Mx5C5Gy5YQqY/5I -YSu1uopk6CYYpgRRMykBG8qsTF0srTJlktN0xerqND8bmCyZctmQ5HpmWjBVCHpCnvfSop75RtuW -yjRc+fn0O0oaWi5/R0ljGuefK2mA96glLdPy3ZKWDdafWdIA+19a0lDvN5W0PPQNgT1uSaseSr6A -VcggnjobuB+iJpMAhPC9Ja34VVZ8Y5UEJsNaJ09/c4lkatkbph2/M3Os2chfHjMx0rkd90L6o0n0 -KLSHojkX8H8rrEn4b+VRvUydJ94I6TSKeZ6906o181OpkplKAIsiuKh9wBKKXJJPf2mhAy9+T6G7 -yJKmaJ0DrEetc4l3Y/YyB/COUuYES7RWJisaRyeF6ViaiAaTjxNBZsF4rZ69xgQGMyfWedNZzXL/ -BIltfkGd6CkSiel3nM2lawoolTMPkZYdrvslPEUmvEg+lMBq9qMZgpo5g1WSwCxdbpDAjKsFS1+W -Wh1RNXfvo7/joTn3dfzJh2bn4fBeMa1AMywa4Bk2SDHzVilklQqr3FCwK3ODNBh0qELRgfbcT+k5 -bv94fI75kJ69dYg8o2dD9Wc+o5Oq9SWtC3HgO25HC+zAfQOd0nJlYYMMfu7IDPWle17K1ECRf+S7 -J5laxsbUJXEC6OxNMENamUzU3E/kMBVItrYdTAK6t9CCKDNiiiBfbd3WkpV4k79KrW+9iYFAGuD5 -BU59gk0N8kY5+0NVBOlR31rmuxCzI/q6e8yz+TWX2LcyjV8rn6SZX+3zM82pvnk6vADqMXmW/bcj -vEO0bHC+jmTE/4MMiwoZKqaywMd/qLOIlTt9Ak8E0hwb2/+8EqkGjquxlW/DmLt5/ds2mUf3cW+j -6juc1AILloHFRejAsYomGpsWQjxCqE2TL9RH/lcXyfC9Mx3i54fK61NlNa6qq9fri5q0aVxPaneW -tLHl8WK8karq++RnpXL/E62KhS5Xt+85tj19Wlemz3dq76mhTp8Hm5cn27ztsMzLYr18qVgqHg/e -xep41Xu6rT1UeeblY1TtDucfD9cj+7E97xAkxQLiXvfYb9xNnjra62i9lGqD4fTmTn15YlRJJv4g -fnDdqbz0Jc7xA83boI34aXfhO1vlyOicGQ60Piv0O+Atz3IkEhOZRei6DvZZnsgDBPKQRgIPnz9p -NLplh32+WiywNmIfZNAmyG0IFEIgdyFsqE9W8jIrg9xrItpu0+jAJ2CDn1YywJNvaPQxYmm7y6BZ -05G7yBtnyPgj54+bMP7Qh3GwTBO/YJzIkAWYkWOaxjAjo2QLtymaUPOWLRZo+2FMRhyNMEKvIXbk -09Pgr/TXObJjwZEhiI8CGZ/LBJuzsgYaXAyOLYS8HZs0za7XgWZH7pOcuisdDS76rVfxeKFGoEn2 -5RAS0BbG8gEzzCiKhcjrFOxk3LXgeFsszP141VK8+vDHD8fXi9t2Joioq0k+YMH1ehzkdDvT46Ka -+uHxSkp8bYSCXAO2INu2n23Hm/oWK4z3gkwEFuy4BcI330Zi1rea5CCnqRacnG5nAk29XU3M7vh8 -a8GNBuFbYIP3T5OTmX5ipEMZEOJx9nLq6L4YpcSnH450apwb7jndF+mLfoqFkOxqtN1zWo/xicib -CDv4rJkg2Ha9hGvSjUc9iNs8wBKN4ybgq3tO417EcxW29OpbakQzQe7JYiEpHqaf20Y0Lg/hnJ/3 -d86Ql9PIKTqp5DsTJ7I/XiyM/cjveBlgYhN5GDvXaXGbhzFME+qGHGPHPJbTJMYmesuHLd2FMUew -STAz7u9i4GM7wqcwHhX37u2m7JAi9dQ9XUTuJJ9nwcWWfENemIfullgG7egdksbYh5SKHK/sLrax -N5N0mtKi0E2wUCz4NpIy0N1zipIsuH3I4Y4myEB3z6kLndOana+eJtS6eD2NaWJSajzRFL8XwQev -nib1F2ndwh4LgC3edwSnKM4zOdxdxePmYQv3QGlYMnYPfs1K7ArklLqZ2Iv6d0jM5tmeyCdF5TzA -7p6FQ70PvQaYbhd/Qnr4XkoPT84pz7LwHCDDZwd6c7rOw/ImSyOeRjOb7dlD7/OmiYbNNm3ftImM -7BvQ2I3IoK3vj0Am7B6NpC6JD5HZJvFyRuJ4YxP5pB+V4/PFQnwkQYPmWnAssg37nkZmINtElhDB -dgLYRt7MO6xEvI+aRljiaNc7x+vA+zo7C7w/Qc9N3l8HOfVW2ojXiA1YoSHakdtIuoWdYIkmUbgh -UXCjgiXWdi2CzPcIxrbt8K0PNu3rmT/iysGKbDLspwk2zyaM3DveJssOZmBBl9vGi3jtxCvIOWAb -Bn4Trzn76uqS9h6s/dcm8d/Oxd/1BL++PPgLzehrCWSaeDFRFWz6qr2RTWthSrqhKpMvePFwSW+1 -xq24rzq+w8aXv045bJH8qdf3GDJEW9Hkz9iq1GaN2fmMYaaNilgTD9t6Xqjf4hOnG/jrDW1Fl/KX -dPjP8lr/Bzk7bJalNwAA#> -#endregion - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $formMain = New-Object 'System.Windows.Forms.Form' - $buttonInstallSUP = New-Object 'System.Windows.Forms.Button' - $comboboxSUP = New-Object 'System.Windows.Forms.ComboBox' - $labelSoftwareUpdates = New-Object 'System.Windows.Forms.Label' - $buttonInstallApp = New-Object 'System.Windows.Forms.Button' - $comboboxAPP = New-Object 'System.Windows.Forms.ComboBox' - $labelApplications = New-Object 'System.Windows.Forms.Label' - $labelOSDTaskSequence = New-Object 'System.Windows.Forms.Label' - $comboboxOSD = New-Object 'System.Windows.Forms.ComboBox' - $statusbar1 = New-Object 'System.Windows.Forms.StatusBar' - $picturebox1 = New-Object 'System.Windows.Forms.PictureBox' - $buttonInstallOSD = New-Object 'System.Windows.Forms.Button' - $textboxComputername = New-Object 'System.Windows.Forms.TextBox' - $buttonConnect = New-Object 'System.Windows.Forms.Button' - $buttonExit = New-Object 'System.Windows.Forms.Button' - $timerJobTracker = New-Object 'System.Windows.Forms.Timer' - $imagelistButtonBusyAnimation = New-Object 'System.Windows.Forms.ImageList' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - #region Control Helper Functions - function Load-ComboBox - { - <# - .SYNOPSIS - This functions helps you load items into a ComboBox. - - .DESCRIPTION - Use this function to dynamically load items into the ComboBox control. - - .PARAMETER ComboBox - The ComboBox control you want to add items to. - - .PARAMETER Items - The object or objects you wish to load into the ComboBox's Items collection. - - .PARAMETER DisplayMember - Indicates the property to display for the items in this control. - - .PARAMETER Append - Adds the item(s) to the ComboBox without clearing the Items collection. - - .EXAMPLE - Load-ComboBox $combobox1 "Red", "White", "Blue" - - .EXAMPLE - Load-ComboBox $combobox1 "Red" -Append - Load-ComboBox $combobox1 "White" -Append - Load-ComboBox $combobox1 "Blue" -Append - - .EXAMPLE - Load-ComboBox $combobox1 (Get-Process) "ProcessName" - #> - Param ( - [ValidateNotNull()] - [Parameter(Mandatory=$true)] - [System.Windows.Forms.ComboBox]$ComboBox, - [ValidateNotNull()] - [Parameter(Mandatory=$true)] - $Items, - [Parameter(Mandatory=$false)] - [string]$DisplayMember, - [switch]$Append - ) - - if(-not $Append) - { - $ComboBox.Items.Clear() - } - - if($Items -is [Object[]]) - { - $ComboBox.Items.AddRange($Items) - } - elseif ($Items -is [System.Collections.IEnumerable]) - { - $ComboBox.BeginUpdate() - foreach($obj in $Items) - { - $ComboBox.Items.Add($obj) - } - $ComboBox.EndUpdate() - } - else - { - $ComboBox.Items.Add($Items) - } - - $ComboBox.DisplayMember = $DisplayMember - } - - function Load-ListBox - { - <# - .SYNOPSIS - This functions helps you load items into a ListBox or CheckedListBox. - - .DESCRIPTION - Use this function to dynamically load items into the ListBox control. - - .PARAMETER ListBox - The ListBox control you want to add items to. - - .PARAMETER Items - The object or objects you wish to load into the ListBox's Items collection. - - .PARAMETER DisplayMember - Indicates the property to display for the items in this control. - - .PARAMETER Append - Adds the item(s) to the ListBox without clearing the Items collection. - - .EXAMPLE - Load-ListBox $ListBox1 "Red", "White", "Blue" - - .EXAMPLE - Load-ListBox $listBox1 "Red" -Append - Load-ListBox $listBox1 "White" -Append - Load-ListBox $listBox1 "Blue" -Append - - .EXAMPLE - Load-ListBox $listBox1 (Get-Process) "ProcessName" - #> - Param ( - [ValidateNotNull()] - [Parameter(Mandatory=$true)] - [System.Windows.Forms.ListBox]$ListBox, - [ValidateNotNull()] - [Parameter(Mandatory=$true)] - $Items, - [Parameter(Mandatory=$false)] - [string]$DisplayMember, - [switch]$Append - ) - - if(-not $Append) - { - $listBox.Items.Clear() - } - - if($Items -is [System.Windows.Forms.ListBox+ObjectCollection]) - { - $listBox.Items.AddRange($Items) - } - elseif ($Items -is [Array]) - { - $listBox.BeginUpdate() - foreach($obj in $Items) - { - $listBox.Items.Add($obj) - } - $listBox.EndUpdate() - } - else - { - $listBox.Items.Add($Items) - } - - $listBox.DisplayMember = $DisplayMember - } - - function Load-DataGridView - { - <# - .SYNOPSIS - This functions helps you load items into a DataGridView. - - .DESCRIPTION - Use this function to dynamically load items into the DataGridView control. - - .PARAMETER DataGridView - The DataGridView control you want to add items to. - - .PARAMETER Item - The object or objects you wish to load into the DataGridView's items collection. - - .PARAMETER DataMember - Sets the name of the list or table in the data source for which the DataGridView is displaying data. - - .PARAMETER AutoSizeColumns - Resizes DataGridView control's columns after loading the items. - #> - Param ( - [ValidateNotNull()] - [Parameter(Mandatory = $true)] - [System.Windows.Forms.DataGridView]$DataGridView, - [ValidateNotNull()] - [Parameter(Mandatory = $true)] - $Item, - [Parameter(Mandatory = $false)] - [string]$DataMember, - [System.Windows.Forms.DataGridViewAutoSizeColumnMode]$AutoSizeColumns = 'None' - ) - $DataGridView.SuspendLayout() - $DataGridView.DataMember = $DataMember - - if ($Item -is [System.Data.DataSet] -and $Item.Tables.Count -gt 0) - { - $DataGridView.DataSource = $Item.Tables[0] - } - elseif ($Item -is [System.ComponentModel.IListSource]` - -or $Item -is [System.ComponentModel.IBindingList] -or $Item -is [System.ComponentModel.IBindingListView]) - { - $DataGridView.DataSource = $Item - } - else - { - $array = New-Object System.Collections.ArrayList - - if ($Item -is [System.Collections.IList]) - { - $array.AddRange($Item) - } - else - { - $array.Add($Item) - } - $DataGridView.DataSource = $array - } - - if ($AutoSizeColumns -ne 'None') - { - $DataGridView.AutoResizeColumns($AutoSizeColumns) - } - - $DataGridView.ResumeLayout() - } - - function ConvertTo-DataTable - { - <# - .SYNOPSIS - Converts objects into a DataTable. - - .DESCRIPTION - Converts objects into a DataTable, which are used for DataBinding. - - .PARAMETER InputObject - The input to convert into a DataTable. - - .PARAMETER Table - The DataTable you wish to load the input into. - - .PARAMETER RetainColumns - This switch tells the function to keep the DataTable's existing columns. - - .PARAMETER FilterWMIProperties - This switch removes WMI properties that start with an underline. - - .EXAMPLE - $DataTable = ConvertTo-DataTable -InputObject (Get-Process) - #> - [OutputType([System.Data.DataTable])] - param ( - [ValidateNotNull()] - $InputObject, - [ValidateNotNull()] - [System.Data.DataTable]$Table, - [switch]$RetainColumns, - [switch]$FilterWMIProperties) - - if ($null -eq $Table) - { - $Table = New-Object System.Data.DataTable - } - - if ($InputObject -is [System.Data.DataTable]) - { - $Table = $InputObject - } - elseif ($InputObject -is [System.Data.DataSet] -and $InputObject.Tables.Count -gt 0) - { - $Table = $InputObject.Tables[0] - } - else - { - if (-not $RetainColumns -or $Table.Columns.Count -eq 0) - { - #Clear out the Table Contents - $Table.Clear() - - if ($null -eq $InputObject) { return } #Empty Data - - $object = $null - #find the first non null value - foreach ($item in $InputObject) - { - if ($null -ne $item) - { - $object = $item - break - } - } - - if ($null -eq $object) { return } #All null then empty - - #Get all the properties in order to create the columns - foreach ($prop in $object.PSObject.Get_Properties()) - { - if (-not $FilterWMIProperties -or -not $prop.Name.StartsWith('__')) #filter out WMI properties - { - #Get the type from the Definition string - $type = $null - - if ($null -ne $prop.Value) - { - try { $type = $prop.Value.GetType() } - catch { } - } - - if ($null -ne $type) # -and [System.Type]::GetTypeCode($type) -ne 'Object') - { - [void]$table.Columns.Add($prop.Name, $type) - } - else #Type info not found - { - [void]$table.Columns.Add($prop.Name) - } - } - } - - if ($object -is [System.Data.DataRow]) - { - foreach ($item in $InputObject) - { - $Table.Rows.Add($item) - } - return @( ,$Table) - } - } - else - { - $Table.Rows.Clear() - } - - foreach ($item in $InputObject) - { - $row = $table.NewRow() - - if ($item) - { - foreach ($prop in $item.PSObject.Get_Properties()) - { - if ($table.Columns.Contains($prop.Name)) - { - $row.Item($prop.Name) = $prop.Value - } - } - } - [void]$table.Rows.Add($row) - } - } - - return @( ,$Table) - } - #endregion - - #region Search Function - function SearchGrid() - { - $RowIndex = 0 - $ColumnIndex = 0 - $seachString = $textboxComputername.Text - - if($seachString -eq "") - { - return - } - - if($datagridviewResults.SelectedCells.Count -ne 0) - { - $startCell = $datagridviewResults.SelectedCells[0]; - $RowIndex = $startCell.RowIndex - $ColumnIndex = $startCell.ColumnIndex + 1 - } - - $columnCount = $datagridviewResults.ColumnCount - $rowCount = $datagridviewResults.RowCount - for(;$RowIndex -lt $rowCount; $RowIndex++) - { - $Row = $datagridviewResults.Rows[$RowIndex] - - for(;$ColumnIndex -lt $columnCount; $ColumnIndex++) - { - $cell = $Row.Cells[$ColumnIndex] - - if($null -ne $cell.Value -and $cell.Value.ToString().IndexOf($seachString, [StringComparison]::OrdinalIgnoreCase) -ne -1) - { - $datagridviewResults.CurrentCell = $cell - return - } - } - - $ColumnIndex = 0 - } - - $datagridviewResults.CurrentCell = $null - [void][System.Windows.Forms.MessageBox]::Show("The search has reached the end of the grid.","String not Found") - - } - #endregion - - $formMain_Load={ - #TODO: Initialize Form Controls here - - } - - $buttonExit_Click={ - #TODO: Place custom script here - $formMain.Close() - } - - $buttonConnect_Click={ - #TODO: Place custom script here - try - { - $Empty = "" - Load-ComboBox $comboboxOSD $Empty - $comboboxOSD.SelectedIndex = 0 - Load-ComboBox $comboboxAPP $Empty - $comboboxAPP.SelectedIndex = 0 - Load-ComboBox $comboboxSUP $Empty - $comboboxSUP.SelectedIndex = 0 - if (-not $textboxComputername.Text) - { - [System.Windows.Forms.MessageBox]::Show('No computer specified', 'Error') - Throw 'No Computer specified' - } - else - { - $global:Computername = $textboxComputername.Text - } - - Write-Status -Message "Connecting to $computername" - $picturebox1.BackColor = "Gold" - - If (-not (Test-Connection -ComputerName $Computername -Count 1 -Quiet)) - { - $picturebox1.BackColor = "Red" - - - [System.Windows.Forms.MessageBox]::Show('No such computer or computer is offline', 'Error') - Throw 'No such computer or computer is offline' - - } - - Else - { - Write-status -Message "Connected to $Computername" - $picturebox1.BackColor = "Green" - - # OSD Task Sequence # - $OSDTS = (Get-CimInstance -ClassName CCM_Program -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.TaskSequence -like "True" }) - $OSD = $OSDTS.Name - - - # Application # - $Application = (Get-CimInstance -ClassName CCM_Application -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.InstallState -like "NotInstalled" }) - $AppName = $Application.Name - - # Software Updates # - $SUPEvalState0 = "0" - $SUPEvalState1 = "1" - $SUPClass = [WmiClass]"root\ccm\clientSDK:CCM_SoftwareUpdatesManager" - $SUPs = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_SoftwareUpdate -ComputerName $Computername | Where-Object { $_.EvaluationState -like "*$($SUPEvalState0)*" -or $_.EvaluationState -like "*$($SUPEvalState1)*" }) - $SUPName = $SUPs.Name - - if ($OSD) - { - Load-ComboBox $comboboxOSD $OSD -Append - $comboboxOSD.SelectedIndex = 1 - } - if ($APPName) - { - Load-ComboBox $comboboxAPP $AppName -Append - $comboboxAPP.SelectedIndex = 1 - } - if ($SUPName) - { - Load-ComboBox $comboboxSUP $SUPName -Append - $comboboxSUP.SelectedIndex = 1 - } - - - } #Else - } #IF - Catch - { - Write-Status -Message $_.Exception.Message - } - - - } - - - - $formMain_FormClosed=[System.Windows.Forms.FormClosedEventHandler]{ - #Event Argument: $_ = [System.Windows.Forms.FormClosedEventArgs] - #Stop any pending jobs - Stop-JobTracker - } - - $timerJobTracker_Tick={ - Update-JobTracker - } - - #region Job Tracker - $JobTrackerList = New-Object System.Collections.ArrayList - function Add-JobTracker - { - <# - .SYNOPSIS - Add a new job to the JobTracker and starts the timer. - - .DESCRIPTION - Add a new job to the JobTracker and starts the timer. - - .PARAMETER Name - The name to assign to the Job - - .PARAMETER JobScript - The script block that the Job will be performing. - Important: Do not access form controls from this script block. - - .PARAMETER ArgumentList - The arguments to pass to the job - - .PARAMETER CompleteScript - The script block that will be called when the job is complete. - The job is passed as an argument. The Job argument is null when the job fails. - - .PARAMETER UpdateScript - The script block that will be called each time the timer ticks. - The job is passed as an argument. Use this to get the Job's progress. - - .EXAMPLE - Add-JobTracker -Name 'JobName' ` - -JobScript { - Param($Argument1)#Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - Get-WmiObject Win32_Process -Namespace "root\CIMV2" - }` - -CompletedScript { - Param($Job) - $results = Receive-Job -Job $Job - }` - -UpdateScript { - Param($Job) - #$results = Receive-Job -Job $Job -Keep - } - - .LINK - - #> - - Param( - [ValidateNotNull()] - [Parameter(Mandatory=$true)] - [string]$Name, - [ValidateNotNull()] - [Parameter(Mandatory=$true)] - [ScriptBlock]$JobScript, - $ArgumentList = $null, - [ScriptBlock]$CompletedScript, - [ScriptBlock]$UpdateScript) - - #Start the Job - $job = Start-Job -Name $Name -ScriptBlock $JobScript -ArgumentList $ArgumentList - - if($null -ne $job) - { - #Create a Custom Object to keep track of the Job & Script Blocks - $members = @{ 'Job' = $Job; - 'CompleteScript' = $CompletedScript; - 'UpdateScript' = $UpdateScript} - - $psObject = New-Object System.Management.Automation.PSObject -Property $members - - [void]$JobTrackerList.Add($psObject) - - #Start the Timer - if(-not $timerJobTracker.Enabled) - { - $timerJobTracker.Start() - } - } - elseif($null -ne $CompletedScript) - { - #Failed - Invoke-Command -ScriptBlock $CompletedScript -ArgumentList $null - } - - } - - function Update-JobTracker - { - <# - .SYNOPSIS - Checks the status of each job on the list. - #> - - #Poll the jobs for status updates - $timerJobTracker.Stop() #Freeze the Timer - - for($index =0; $index -lt $JobTrackerList.Count; $index++) - { - $psObject = $JobTrackerList[$index] - - if($null -ne $psObject) - { - if($null -ne $psObject.Job) - { - if($psObject.Job.State -ne "Running") - { - #Call the Complete Script Block - if($null -ne $psObject.CompleteScript) - { - #$results = Receive-Job -Job $psObject.Job - Invoke-Command -ScriptBlock $psObject.CompleteScript -ArgumentList $psObject.Job - } - - $JobTrackerList.RemoveAt($index) - Remove-Job -Job $psObject.Job - $index-- #Step back so we don't skip a job - } - elseif($null -ne $psObject.UpdateScript) - { - #Call the Update Script Block - Invoke-Command -ScriptBlock $psObject.UpdateScript -ArgumentList $psObject.Job - } - } - } - else - { - $JobTrackerList.RemoveAt($index) - $index-- #Step back so we don't skip a job - } - } - - if($JobTrackerList.Count -gt 0) - { - $timerJobTracker.Start()#Resume the timer - } - } - - function Stop-JobTracker - { - <# - .SYNOPSIS - Stops and removes all Jobs from the list. - #> - #Stop the timer - $timerJobTracker.Stop() - - #Remove all the jobs - while($JobTrackerList.Count -gt 0) - { - $job = $JobTrackerList[0].Job - $JobTrackerList.RemoveAt(0) - Stop-Job $job - Remove-Job $job - } - } - #endregion - - - $textboxComputername_KeyDown=[System.Windows.Forms.KeyEventHandler]{ - #Event Argument: $_ = [System.Windows.Forms.KeyEventArgs] - if($_.KeyCode -eq 'Enter' -and $buttonConnect.Enabled) - { - #SearchGrid - try - { - $Empty = "" - Load-ComboBox $comboboxOSD $Empty - $comboboxOSD.SelectedIndex = 0 - Load-ComboBox $comboboxAPP $Empty - $comboboxAPP.SelectedIndex = 0 - Load-ComboBox $comboboxSUP $Empty - $comboboxSUP.SelectedIndex = 0 - if (-not $textboxComputername.Text) - { - [System.Windows.Forms.MessageBox]::Show('No computer specified', 'Error') - Throw 'No Computer specified' - } - else - { - $global:Computername = $textboxComputername.Text - } - - Write-Status -Message "Connecting to $computername" - $picturebox1.BackColor = "Gold" - - If (-not (Test-Connection -ComputerName $Computername -Count 1 -Quiet)) - { - $picturebox1.BackColor = "Red" - - - [System.Windows.Forms.MessageBox]::Show('No such Computer or computer is offline', 'Error') - Throw 'No such Computer or computer is offline' - - } - - Else - { - Write-status -Message "Connected to $Computername" - $picturebox1.BackColor = "Green" - - # OSD Task Sequence # - $OSDTS = (Get-CimInstance -ClassName CCM_Program -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.TaskSequence -like "True" }) - $OSD = $OSDTS.Name - - - # Application # - $Application = (Get-CimInstance -ClassName CCM_Application -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.InstallState -like "NotInstalled" }) - $AppName = $Application.Name - - # Software Updates # - $SUPEvalState0 = "0" - $SUPEvalState1 = "1" - $SUPClass = [WmiClass]"root\ccm\clientSDK:CCM_SoftwareUpdatesManager" - $SUPs = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_SoftwareUpdate -ComputerName $Computername | Where-Object { $_.EvaluationState -like "*$($SUPEvalState0)*" -or $_.EvaluationState -like "*$($SUPEvalState1)*" }) - $SUPName = $SUPs.Name - - if ($OSD) - { - Load-ComboBox $comboboxOSD $OSD -Append - $comboboxOSD.SelectedIndex = 1 - } - if ($APPName) - { - Load-ComboBox $comboboxAPP $AppName -Append - $comboboxAPP.SelectedIndex = 1 - } - if ($SUPName) - { - Load-ComboBox $comboboxSUP $SUPName -Append - $comboboxSUP.SelectedIndex = 1 - } - - - } #Else - } #IF - Catch - { - Write-Status -Message $_.Exception.Message - } - - $_.SuppressKeyPress = $true - } - } - - $textboxComputername_TextChanged={ - #TODO: Place custom script here - - } - - $statusbar1_PanelClick=[System.Windows.Forms.StatusBarPanelClickEventHandler]{ - #Event Argument: $_ = [System.Windows.Forms.StatusBarPanelClickEventArgs] - #TODO: Place custom script here - - } - - $toolstripstatuslabel1_Click={ - #TODO: Place custom script here - - } - - - $comboboxOSD_SelectedIndexChanged={ - #TODO: Place custom script here - - } - - $labelOSDTaskSequence_Click={ - #TODO: Place custom script here - - } - - $comboboxAPP_SelectedIndexChanged={ - #TODO: Place custom script here - - } - - $buttonInstallOSD_Click={ - #TODO: Place custom script here - Invoke-OSDInstall -Computername $Computername -OSDName $comboboxOSD.SelectedItem - } - - $buttonInstallApp_Click={ - #TODO: Place custom script here - Invoke-AppInstall -Computername $Computername -Method Install -AppName $comboboxAPP.SelectedItem - } - - $buttonInstallSUP_Click={ - #TODO: Place custom script here - Invoke-SupInstall -Computername $Computername -SupName $comboboxSUP.SelectedItem - } - - $buttonCancelProcess_Click={ - $script:CancelLoop = $true - } - - $buttonStartProcess_Click={ - #Init CancelLoop - $script:CancelLoop = $false - $buttonCancelProcess.Enabled = $true - #Disable the button so we don't trigger it again - $this.Enabled = $false - #Reset the Progress Bar - $progressbar1.Value = 0 - - for($i = 0; $i -lt $progressbar1.Maximum; $i++) - { - #---------------------------------------- - #Place custom script here - sleep -Milliseconds 200 - - #---------------------------------------- - #process the pending message - [System.Windows.Forms.Application]::DoEvents() - - if($script:CancelLoop -eq $true) - { - #Clear the progress bar - $progressbar1.Value = 0 - #Exit the loop - break; - } - #Step the progress bar - $progressbar1.PerformStep() - } - - #Enable the button so we can click it again - $this.Enabled = $true - $buttonCancelProcess.Enabled = $false - } - - $buttonRunProcess_Click={ - $buttonRunProcess.Enabled = $false - #TODO: Set the process path there - Add-ProcessTracker -FilePath "$env:windir/System32/notepad.exe" ` - -CompletedScript { - $buttonRunProcess.Enabled = $true - $buttonRunProcess.ImageIndex = -1 - }` - -UpdateScript { - #Animate the Button - if($null -ne $buttonRunProcess.ImageList) - { - if($buttonRunProcess.ImageIndex -lt $buttonRunProcess.ImageList.Images.Count - 1) - { - $buttonRunProcess.ImageIndex += 1 - } - else - { - $buttonRunProcess.ImageIndex = 0 - } - } - } - } - - $processTracker_FormClosed=[System.Windows.Forms.FormClosedEventHandler]{ - #Event Argument: $_ = [System.Windows.Forms.FormClosedEventArgs] - #Stop any pending processes - #Stop-ProcessTracker - } - - $timerProcessTracker_Tick={ - Update-ProcessTracker - } - - #region Process Tracker - $ProcessTrackerList = New-Object System.Collections.ArrayList - function Add-ProcessTracker - { - <# - .SYNOPSIS - Add a new process to the ProcessTracker and starts the timer. - - .DESCRIPTION - Add a new process to the ProcessTracker and starts the timer. - - .PARAMETER FilePath - The path to executable. - - .PARAMETER ArgumentList - The arguments to pass to the process. - - .PARAMETER CompleteScript - The script block that will be called when the process is complete. - The process is passed as an argument. The process argument is null when the job fails. - - .PARAMETER UpdateScript - The script block that will be called each time the timer ticks. - The process is passed as an argument. - - .EXAMPLE - Add-ProcessTracker -FilePath "$env:windir/System32/notepad.exe" ` - -CompletedScript { - Param([System.Diagnostics.Process]$Process) - $button.Enable = $true - }` - -UpdateScript { - Param([System.Diagnostics.Process]$Process) - Function-Animate $button - } - - .LINK - - #> - - Param( - [ValidateNotNull()] - [Parameter(Mandatory=$true)] - [string]$FilePath, - $ArgumentList = $null, - [ScriptBlock]$CompletedScript, - [ScriptBlock]$UpdateScript) - - #Start the Job - if($ArgumentList) - { - $process = Start-Process -FilePath $FilePath -ArgumentList $ArgumentList -PassThru - } - else - { - $process = Start-Process -FilePath $FilePath -PassThru - } - - if($null -ne $process) - { - #Create a Custom Object to keep track of the Job & Script Blocks - $members = @{ "Process" = $process; - "CompleteScript" = $CompletedScript; - "UpdateScript" = $UpdateScript} - - $psObject = New-Object System.Management.Automation.PSObject -Property $members - - [void]$ProcessTrackerList.Add($psObject) - - #Start the Timer - if(-not $timerProcessTracker.Enabled) - { - $timerProcessTracker.Start() - } - } - elseif($null -ne $CompletedScript) - { - #Failed - Invoke-Command -ScriptBlock $CompletedScript -ArgumentList $null - } - - } - - function Update-ProcessTracker - { - <# - .SYNOPSIS - Checks the status of each job on the list. - #> - - #Poll the jobs for status updates - $timerProcessTracker.Stop() #Freeze the Timer - - for($index =0; $index -lt $ProcessTrackerList.Count; $index++) - { - $psObject = $ProcessTrackerList[$index] - - if($null -ne $psObject) - { - if($null -ne $psObject.Process) - { - if($psObject.Process.HasExited) - { - #Call the Complete Script Block - if($null -ne $psObject.CompleteScript) - { - #$results = Receive-Job -Job $psObject.Job - Invoke-Command -ScriptBlock $psObject.CompleteScript -ArgumentList $psObject.Process - } - - $ProcessTrackerList.RemoveAt($index) - $index-- #Step back so we don't skip a job - } - elseif($null -ne $psObject.UpdateScript) - { - #Call the Update Script Block - Invoke-Command -ScriptBlock $psObject.UpdateScript -ArgumentList $psObject.Process - } - } - } - else - { - $ProcessTrackerList.RemoveAt($index) - $index-- #Step back so we don't skip a job - } - } - - if($ProcessTrackerList.Count -gt 0) - { - $timerProcessTracker.Start()#Resume the timer - } - } - - function Stop-ProcessTracker - { - <# - .SYNOPSIS - Stops and removes all processes from the list. - #> - #Stop the timer - $timerProcessTracker.Stop() - - #Remove all the processes - while($ProcessTrackerList.Count -gt 0) - { - $process = $ProcessTrackerList[0].Process - $ProcessTrackerList.RemoveAt(0) - if(-not $psObject.Process.HasExited) - { - Stop-Process -InputObject $process - } - } - } - #endregion - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $formMain.WindowState = $InitialFormWindowState - } - - $Form_StoreValues_Closing= - { - #Store the control values - $script:MainForm_comboboxSUP = $comboboxSUP.Text - $script:MainForm_comboboxSUP_SelectedItem = $comboboxSUP.SelectedItem - $script:MainForm_comboboxAPP = $comboboxAPP.Text - $script:MainForm_comboboxAPP_SelectedItem = $comboboxAPP.SelectedItem - $script:MainForm_comboboxOSD = $comboboxOSD.Text - $script:MainForm_comboboxOSD_SelectedItem = $comboboxOSD.SelectedItem - $script:MainForm_textboxComputername = $textboxComputername.Text - } - - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $buttonInstallSUP.remove_Click($buttonInstallSUP_Click) - $buttonInstallApp.remove_Click($buttonInstallApp_Click) - $comboboxAPP.remove_SelectedIndexChanged($comboboxAPP_SelectedIndexChanged) - $labelOSDTaskSequence.remove_Click($labelOSDTaskSequence_Click) - $comboboxOSD.remove_SelectedIndexChanged($comboboxOSD_SelectedIndexChanged) - $buttonInstallOSD.remove_Click($buttonInstallOSD_Click) - $textboxComputername.remove_TextChanged($textboxComputername_TextChanged) - $textboxComputername.remove_KeyDown($textboxComputername_KeyDown) - $buttonConnect.remove_Click($buttonConnect_Click) - $buttonExit.remove_Click($buttonExit_Click) - $formMain.remove_FormClosed($formMain_FormClosed) - $formMain.remove_Load($formMain_Load) - $timerJobTracker.remove_Tick($timerJobTracker_Tick) - $formMain.remove_Load($Form_StateCorrection_Load) - $formMain.remove_Closing($Form_StoreValues_Closing) - $formMain.remove_FormClosed($Form_Cleanup_FormClosed) - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - $formMain.SuspendLayout() - # - # formMain - # - $formMain.Controls.Add($buttonInstallSUP) - $formMain.Controls.Add($comboboxSUP) - $formMain.Controls.Add($labelSoftwareUpdates) - $formMain.Controls.Add($buttonInstallApp) - $formMain.Controls.Add($comboboxAPP) - $formMain.Controls.Add($labelApplications) - $formMain.Controls.Add($labelOSDTaskSequence) - $formMain.Controls.Add($comboboxOSD) - $formMain.Controls.Add($statusbar1) - $formMain.Controls.Add($picturebox1) - $formMain.Controls.Add($buttonInstallOSD) - $formMain.Controls.Add($textboxComputername) - $formMain.Controls.Add($buttonConnect) - $formMain.Controls.Add($buttonExit) - $formMain.AutoScaleDimensions = '6, 13' - $formMain.AutoScaleMode = 'Font' - $formMain.ClientSize = '475, 371' - $formMain.Name = 'formMain' - $formMain.StartPosition = 'CenterScreen' - $formMain.Text = 'Remote Software Center' - $formMain.add_FormClosed($formMain_FormClosed) - $formMain.add_Load($formMain_Load) - # - # buttonInstallSUP - # - $buttonInstallSUP.Anchor = 'Bottom, Left' - $buttonInstallSUP.Location = '362, 229' - $buttonInstallSUP.Name = 'buttonInstallSUP' - $buttonInstallSUP.Size = '75, 23' - $buttonInstallSUP.TabIndex = 16 - $buttonInstallSUP.Text = '&Install SUP' - $buttonInstallSUP.TextImageRelation = 'ImageBeforeText' - $buttonInstallSUP.UseVisualStyleBackColor = $True - $buttonInstallSUP.add_Click($buttonInstallSUP_Click) - # - # comboboxSUP - # - $comboboxSUP.FormattingEnabled = $True - $comboboxSUP.Location = '11, 229' - $comboboxSUP.Name = 'comboboxSUP' - $comboboxSUP.Size = '308, 21' - $comboboxSUP.TabIndex = 15 - # - # labelSoftwareUpdates - # - $labelSoftwareUpdates.AutoSize = $True - $labelSoftwareUpdates.Font = 'Microsoft Sans Serif, 9pt, style=Bold' - $labelSoftwareUpdates.Location = '11, 211' - $labelSoftwareUpdates.Name = 'labelSoftwareUpdates' - $labelSoftwareUpdates.Size = '120, 15' - $labelSoftwareUpdates.TabIndex = 14 - $labelSoftwareUpdates.Text = 'Software Updates' - # - # buttonInstallApp - # - $buttonInstallApp.Anchor = 'Bottom, Left' - $buttonInstallApp.Location = '362, 157' - $buttonInstallApp.Name = 'buttonInstallApp' - $buttonInstallApp.Size = '75, 23' - $buttonInstallApp.TabIndex = 13 - $buttonInstallApp.Text = '&Install App' - $buttonInstallApp.TextImageRelation = 'ImageBeforeText' - $buttonInstallApp.UseVisualStyleBackColor = $True - $buttonInstallApp.add_Click($buttonInstallApp_Click) - # - # comboboxAPP - # - $comboboxAPP.FormattingEnabled = $True - $comboboxAPP.Location = '11, 157' - $comboboxAPP.Name = 'comboboxAPP' - $comboboxAPP.Size = '308, 21' - $comboboxAPP.TabIndex = 12 - $comboboxAPP.add_SelectedIndexChanged($comboboxAPP_SelectedIndexChanged) - # - # labelApplications - # - $labelApplications.AutoSize = $True - $labelApplications.Font = 'Microsoft Sans Serif, 9pt, style=Bold' - $labelApplications.Location = '11, 139' - $labelApplications.Name = 'labelApplications' - $labelApplications.Size = '85, 15' - $labelApplications.TabIndex = 11 - $labelApplications.Text = 'Applications' - # - # labelOSDTaskSequence - # - $labelOSDTaskSequence.AutoSize = $True - $labelOSDTaskSequence.Font = 'Microsoft Sans Serif, 9pt, style=Bold' - $labelOSDTaskSequence.Location = '14, 72' - $labelOSDTaskSequence.Name = 'labelOSDTaskSequence' - $labelOSDTaskSequence.Size = '138, 15' - $labelOSDTaskSequence.TabIndex = 10 - $labelOSDTaskSequence.Text = 'OSD Task Sequence' - $labelOSDTaskSequence.add_Click($labelOSDTaskSequence_Click) - # - # comboboxOSD - # - $comboboxOSD.FormattingEnabled = $True - $comboboxOSD.Location = '11, 90' - $comboboxOSD.Name = 'comboboxOSD' - $comboboxOSD.Size = '308, 21' - $comboboxOSD.TabIndex = 9 - $comboboxOSD.add_SelectedIndexChanged($comboboxOSD_SelectedIndexChanged) - # - # statusbar1 - # - $statusbar1.Location = '0, 349' - $statusbar1.Name = 'statusbar1' - $statusbar1.Size = '475, 22' - $statusbar1.TabIndex = 8 - # - # picturebox1 - # - $picturebox1.BackColor = 'Transparent' - $picturebox1.Location = '0, 320' - $picturebox1.Name = 'picturebox1' - $picturebox1.Size = '25, 27' - $picturebox1.TabIndex = 7 - $picturebox1.TabStop = $False - # - # buttonInstallOSD - # - $buttonInstallOSD.Anchor = 'Bottom, Left' - $buttonInstallOSD.ImageList = $imagelistButtonBusyAnimation - $buttonInstallOSD.Location = '362, 90' - $buttonInstallOSD.Name = 'buttonInstallOSD' - $buttonInstallOSD.Size = '75, 23' - $buttonInstallOSD.TabIndex = 0 - $buttonInstallOSD.Text = '&Install OSD' - $buttonInstallOSD.TextImageRelation = 'ImageBeforeText' - $buttonInstallOSD.UseVisualStyleBackColor = $True - $buttonInstallOSD.add_Click($buttonInstallOSD_Click) - # - # textboxComputername - # - $textboxComputername.Anchor = 'Top, Left, Right' - $textboxComputername.Location = '13, 15' - $textboxComputername.Name = 'textboxComputername' - $textboxComputername.Size = '118, 20' - $textboxComputername.TabIndex = 0 - $textboxComputername.add_TextChanged($textboxComputername_TextChanged) - $textboxComputername.add_KeyDown($textboxComputername_KeyDown) - # - # buttonConnect - # - $buttonConnect.Anchor = 'Top, Right' - $buttonConnect.Location = '150, 12' - $buttonConnect.Name = 'buttonConnect' - $buttonConnect.Size = '75, 23' - $buttonConnect.TabIndex = 1 - $buttonConnect.Text = '&Connect' - $buttonConnect.UseVisualStyleBackColor = $True - $buttonConnect.add_Click($buttonConnect_Click) - # - # buttonExit - # - $buttonExit.Anchor = 'Bottom, Right' - $buttonExit.Location = '362, 320' - $buttonExit.Name = 'buttonExit' - $buttonExit.Size = '75, 23' - $buttonExit.TabIndex = 4 - $buttonExit.Text = 'E&xit' - $buttonExit.UseVisualStyleBackColor = $True - $buttonExit.add_Click($buttonExit_Click) - # - # timerJobTracker - # - $timerJobTracker.add_Tick($timerJobTracker_Tick) - # - # imagelistButtonBusyAnimation - # - $Formatter_binaryFomatter = New-Object System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - #region Binary Data - $System_IO_MemoryStream = New-Object System.IO.MemoryStream (,[byte[]][System.Convert]::FromBase64String(' -AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAu -MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAA -ACZTeXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkD -AAAADwMAAAB2CgAAAk1TRnQBSQFMAgEBCAEAAbgBAAG4AQABEAEAARABAAT/ASEBAAj/AUIBTQE2 -BwABNgMAASgDAAFAAwABMAMAAQEBAAEgBgABMP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ -AP8AugADwgH/AzUB/wM1Af8DwgH/MAADwgH/A1UB/wOCAf8DwgH/sAADNQH/AwAB/wMAAf8DNQH/ -MAADggH/AzUB/wM1Af8DVQH/gAADwgH/AzUB/wM1Af8DwgH/IAADNQH/AwAB/wMAAf8DNQH/A8IB -/wNVAf8DggH/A8IB/xAAA8IB/wM1Af8DNQH/A8IB/wNVAf8DNQH/AzUB/wNVAf8EAAOSAf8DkgH/ -A8IB/3AAAzUB/wMAAf8DAAH/AzUB/yAAA8IB/wM1Af8DNQH/A8IB/wOCAf8DNQH/AzUB/wOCAf8Q -AAM1Af8DAAH/AwAB/wM1Af8DwgH/A1UB/wOCAf8DwgH/A5IB/wOCAf8DggH/A5IB/3AAAzUB/wMA -Af8DAAH/AzUB/zAAA1UB/wM1Af8DNQH/A1UB/xAAAzUB/wMAAf8DAAH/AzUB/xAAA5IB/wOSAf8D -kgH/A8IB/3AAA8IB/wM1Af8DNQH/A8IB/zAAA8IB/wNVAf8DggH/A8IB/xAAA8IB/wM1Af8DNQH/ -A8IB/xAAA8IB/wOSAf8DkgH/A8IB/zgAA8IB/wM1Af8DNQH/A8IB/zAAA8IB/wOCAf8DVQH/A8IB -/zAAA8IB/wPCAf8DkgH/A8IB/zQAA8IB/wPCAf80AAM1Af8DAAH/AwAB/wM1Af8wAANVAf8DNQH/ -AzUB/wNVAf8wAAOSAf8DggH/A4IB/wOSAf8wAAPCAf8DwgH/A8IB/wPCAf8wAAM1Af8DAAH/AwAB -/wM1Af8wAAOCAf8DNQH/AzUB/wOCAf8wAAPCAf8DggH/A5IB/wOSAf8wAAPCAf8DwgH/A8IB/wPC -Af8wAAPCAf8DNQH/AzUB/wPCAf8wAAPCAf8DggH/A1UB/wPCAf8wAAPCAf8DkgH/A5IB/wPCAf80 -AAPCAf8DwgH/EAADwgH/A8IB/xQAA8IB/wOCAf8DVQH/A8IB/zAAA8IB/wOSAf8DkgH/A8IB/zQA -A8IB/wPCAf9UAAPCAf8DwgH/A8IB/wPCAf8QAANVAf8DNQH/AzUB/wNVAf8wAAOSAf8DggH/A5IB -/wOSAf8wAAPCAf8DwgH/A8IB/wPCAf9QAAPCAf8DwgH/A8IB/wPCAf8DwgH/A8IB/wOSAf8DwgH/ -A4IB/wM1Af8DNQH/A4IB/yQAA8IB/wPCAf8EAAPCAf8DggH/A5IB/wOSAf8wAAPCAf8DwgH/A8IB -/wPCAf9UAAPCAf8DwgH/BAADkgH/A4IB/wOCAf8DkgH/A8IB/wOCAf8DVQH/A8IB/yAAA8IB/wPC -Af8DwgH/A8IB/wPCAf8DkgH/A5IB/wPCAf80AAPCAf8DwgH/ZAADkgH/A5IB/wOSAf8DkgH/MAAD -wgH/A8IB/wPCAf8DwgH/sAADwgH/A5IB/wOSAf8DwgH/NAADwgH/A8IB/7QAA8IB/wPCAf8DkgH/ -A8IB/zQAA8IB/wPCAf+0AAOSAf8DggH/A4IB/wOSAf8wAAPCAf8DwgH/A8IB/wPCAf+gAAPCAf8D -VQH/A4IB/wPCAf8DkgH/A5IB/wOSAf8DwgH/BAADwgH/A8IB/xQAA8IB/wPCAf8DkgH/A8IB/wPC -Af8DwgH/A8IB/wPCAf8kAAPCAf8DwgH/dAADggH/AzUB/wM1Af8DggH/A8IB/wOSAf8DkgH/A8IB -/wPCAf8DwgH/A8IB/wPCAf8QAAOSAf8DggH/A4IB/wOSAf8EAAPCAf8DwgH/JAADwgH/A8IB/wPC -Af8DwgH/cAADVQH/AzUB/wM1Af8DggH/EAADwgH/A8IB/wPCAf8DwgH/EAADkgH/A5IB/wOSAf8D -kgH/MAADwgH/A8IB/wPCAf8DwgH/cAADwgH/A1UB/wNVAf8DwgH/FAADwgH/A8IB/xQAA8IB/wOS -Af8DkgH/A8IB/zQAA8IB/wPCAf9sAAPCAf8DNQH/AzUB/wPCAf8wAAPCAf8DVQH/A4IB/wPCAf8w -AAPCAf8DwgH/A5IB/wPCAf80AAPCAf8DwgH/NAADNQH/AwAB/wMAAf8DNQH/MAADggH/AzUB/wM1 -Af8DVQH/MAADkgH/A4IB/wOCAf8DkgH/MAADwgH/A8IB/wPCAf8DwgH/MAADNQH/AwAB/wMAAf8D -NQH/MAADVQH/AzUB/wM1Af8DggH/MAADkgH/A5IB/wOSAf8DkgH/MAADwgH/A8IB/wPCAf8DwgH/ -MAADwgH/AzUB/wM1Af8DwgH/MAADwgH/A1UB/wNVAf8DwgH/MAADwgH/A5IB/wOSAf8DwgH/NAAD -wgH/A8IB/3wAA8IB/wM1Af8DNQH/A8IB/zAAA8IB/wNVAf8DggH/A8IB/zAAA8IB/wPCAf8DkgH/ -A8IB/xAAA8IB/wM1Af8DNQH/A8IB/1AAAzUB/wMAAf8DAAH/AzUB/zAAA4IB/wM1Af8DNQH/A1UB -/zAAA5IB/wOCAf8DggH/A5IB/xAAAzUB/wMAAf8DAAH/AzUB/1AAAzUB/wMAAf8DAAH/AzUB/zAA -A1UB/wM1Af8DNQH/A4IB/wOSAf8DNQH/AzUB/wPCAf8gAAOSAf8DkgH/A5IB/wOSAf8DwgH/A1UB -/wOCAf8DwgH/AzUB/wMAAf8DAAH/AzUB/1AAA8IB/wM1Af8DNQH/A8IB/zAAA8IB/wOCAf8DVQH/ -A8IB/wM1Af8DAAH/AwAB/wM1Af8gAAPCAf8DkgH/A5IB/wPCAf8DggH/AzUB/wM1Af8DVQH/A8IB -/wM1Af8DNQH/A8IB/6AAAzUB/wMAAf8DAAH/AzUB/zAAA1UB/wM1Af8DNQH/A4IB/7AAA8IB/wM1 -Af8DNQH/A8IB/zAAA8IB/wOCAf8DVQH/A8IB/xgAAUIBTQE+BwABPgMAASgDAAFAAwABMAMAAQEB -AAEBBQABgAEBFgAD/4EABP8B/AE/AfwBPwT/AfwBPwH8AT8D/wHDAfwBAwHAASMD/wHDAfwBAwHA -AQMD/wHDAf8DwwP/AcMB/wPDAf8B8AH/AfAB/wHwAf8B+QH/AfAB/wHwAf8B8AH/AfAB/wHwAf8B -8AH/AfAB/wHwAf8B8AH/AfAB/wHwAf8B+QHnAcMB/wHDAf8B5wL/AsMB/wHDAf8BwwL/AcABAwH+ -AUMB/wHDAv8B5AEDAfwBAwH/AecC/wH8AT8B/AE/BP8B/AE/Af4BfwT/AfwBPwH+AX8E/wH8AT8B -/AE/BP8BwAEnAcABPwHnA/8BwAEDAcIBfwHDA/8DwwH/AcMD/wHDAecBwwH/AecD/wEPAf8BDwH/ -AQ8B/wGfAf8BDwH/AQ8B/wEPAf8BDwH/AQ8B/wEPAf8BDwH/AQ8B/wEPAf8BDwH/AQ8B/wGfA/8B -wwH/AcMB/wLDAv8BwwH/AcMB/wLDAv8BwwH/AcABPwHAAQMC/wHDAf8BwAE/AcABAwT/AfwBPwH8 -AT8E/wH8AT8B/AE/Cw==')) - #endregion - $imagelistButtonBusyAnimation.ImageStream = $Formatter_binaryFomatter.Deserialize($System_IO_MemoryStream) - $Formatter_binaryFomatter = $null - $System_IO_MemoryStream = $null - $imagelistButtonBusyAnimation.TransparentColor = 'Transparent' - $formMain.ResumeLayout() - #endregion Generated Form Code - - #---------------------------------------------- - - #Save the initial state of the form - $InitialFormWindowState = $formMain.WindowState - #Init the OnLoad event to correct the initial state of the form - $formMain.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $formMain.add_FormClosed($Form_Cleanup_FormClosed) - #Store the control values when form is closing - $formMain.add_Closing($Form_StoreValues_Closing) - #Show the Form - return $formMain.ShowDialog() - -} -#endregion Source: MainForm.psf - -#Start the application -Main ($CommandLine) diff --git a/dump/Remotely Restart-SCCMSyncCycle Using Powershell.website b/dump/Remotely Restart-SCCMSyncCycle Using Powershell.website deleted file mode 100644 index 1697574..0000000 --- a/dump/Remotely Restart-SCCMSyncCycle Using Powershell.website +++ /dev/null @@ -1,13 +0,0 @@ -[{000214A0-0000-0000-C000-000000000046}] -Prop3=19,11 -Prop4=31,Remotely Restart-SCCMSyncCycle Using Powershell -[InternetShortcut] -IDList= -URL=https://thesysadminchannel.com/remotely-restart-sccmsynccycle-using-powershell/ -IconFile=https://thesysadminchannel.com/wp-content/uploads/2018/03/favicon.png -IconIndex=1 -[{A7AF692E-098D-4C08-A225-D433CA835ED0}] -Prop5=3,0 -Prop9=19,0 -[{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}] -Prop5=8,Microsoft.Website.16B02C56.2527D155 diff --git a/dump/Remotely Restart-SCCMSyncCycle.ps1 b/dump/Remotely Restart-SCCMSyncCycle.ps1 deleted file mode 100644 index 601e178..0000000 --- a/dump/Remotely Restart-SCCMSyncCycle.ps1 +++ /dev/null @@ -1,129 +0,0 @@ -Function Restart-SCCMSyncCycle { -<# -.Synopsis - Remotely restarts sccm service cycles. - - -.DESCRIPTION - This function restarts all sccm policies on a remote client so that the client can immediately get any pending software updates or inventory. - - -.NOTES - Name: Restart-SCCMSyncCycle - Author: theSysadminChannel - Version: 1 - DateCreated: 2017-02-09 - - -.LINK - https://thesysadminchannel.com/remotely-restart-sccmsynccycle-using-powershell - - - -.PARAMETER ComputerName - The computer to which connectivity will be checked - - -.EXAMPLE - Restart-SCCMSyncCycle -Computername Pactest-1 - - Description: - Will restart all sccm services on a remote machine. - -.EXAMPLE - Restart-SCCMSyncCycle -ComputerName pactest-1, pactest-2, pactest-3 - - Description: - Will generate a list of installed programs on pactest-1, pactest-2 and pactest-3 - -#> - - - [CmdletBinding()] - param( - [Parameter( - ValueFromPipeline=$true, - ValueFromPipelineByPropertyName=$true, - Position=0)] - [string[]] $ComputerName = $env:COMPUTERNAME - - ) - - Foreach ($Computer in $ComputerName ) { - try { - - Write-Host "=====================================================================" - Write-Output "$Computer : Machine Policy Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000022}" -ErrorAction Stop | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Application Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000121}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Discovery Data Collection Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000003}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : File Collection Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000010}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Hardware Inventory Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000001}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Machine Policy Retrieval Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000021}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Inventory Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000002}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Software Metering Usage Report Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000031}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Update Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000114}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : Software Update Scan Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000113}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : State Message Refresh" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000111}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Retrieval Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000026}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Evaluation Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000027}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Windows Installers Source List Update Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000032}" | select -ExpandProperty PSComputerName | Out-Null - - sleep 1 - } - - catch { - Write-Host $Computer.toUpper() "is not online or Account is locked out" -ForegroundColor:Red - Write-Host - Write-Host - - } - } -} - - -# Restart-SCCMSyncCycle pver001 -# Restart-SCCMSyncCycle - -# Restart-SCCMSyncCycle $DeviceCollection_ServerNames.name - -# Restart-SCCMSyncCycle $Script:ALL_Patch_Servers.Server - diff --git a/dump/SCCM Deployment Dashboard - PowerBI Version.URL b/dump/SCCM Deployment Dashboard - PowerBI Version.URL deleted file mode 100644 index 818b3d1..0000000 --- a/dump/SCCM Deployment Dashboard - PowerBI Version.URL +++ /dev/null @@ -1,6 +0,0 @@ -[InternetShortcut] -URL=https://gallery.technet.microsoft.com/systemcenter/SCCM-Deployment-Dashboard-f2b395f5 -IDList= -HotKey=0 -IconFile=C:\Users\nnazmat\AppData\Local\Mozilla\Firefox\Profiles\20v5hisb.default-release\shortcutCache\wiVy1vvHEfWoHxaKfKs0sQ==.ico -IconIndex=0 diff --git a/dump/SCCM Deployment Dashboard.pbix b/dump/SCCM Deployment Dashboard.pbix deleted file mode 100644 index 3ab2319..0000000 Binary files a/dump/SCCM Deployment Dashboard.pbix and /dev/null differ diff --git a/dump/SCCM-Logs-Description.txt b/dump/SCCM-Logs-Description.txt deleted file mode 100644 index 63b16dc..0000000 --- a/dump/SCCM-Logs-Description.txt +++ /dev/null @@ -1,44 +0,0 @@ -Software Updates Client Computer Log Files - -* CAS.log - Provides information about the process of downloading software updates to the local cache and cache management. - -* CIAgent.log - Provides information about processing configuration items, including software updates. - -* LocationServices.log - Provides information about the location of the WSUS server when a scan is initiated on the client. - -* PatchDownloader.log - Provides information about the process for downloading software updates from the update source to the download destination on the site server. This log is only on the client computer configured as the synchronization host for the Inventory Tool for Microsoft Updates. - -* PolicyAgent.log - Provides information about the process for downloading, compiling, and deleting policies on client computers. - -* PolicyEvaluator - Provides information about the process for evaluating policies on client computers, including policies from software updates. - -* RebootCoordinator.log - Provides information about the process for coordinating system restarts on client computers after software update installations. - -* ScanAgent.log - Provides information about the scan requests for software updates, what tool is requested for the scan, the WSUS location, and so on. - -* ScanWrapper - Provides information about the prerequisite checks and the scan process initialization for the Inventory Tool for Microsoft Updates on Systems Management Server (SMS) 2003 clients. - -* SdmAgent.log - Provides information about the process for verifying and decompressing packages that contain configuration item information for software updates. - -* ServiceWindowManager.log - Provides information about the process for evaluating configured maintenance windows. - -* smscliUI.log - Provides information about the Configuration Manager Control Panel user interactions, such as initiating a Software Updates Scan Cycle from the Configuration Manager Properties dialog box, opening the Program Download Monitor, and so on. - -* SmsWusHandler - Provides information about the scan process for the Inventory Tool for Microsoft Updates on SMS 2003 client computers. - -* StateMessage.log - Provides information about when software updates state messages are created and sent to the management point. - -* UpdatesDeployment.log - Provides information about the deployment on the client, including software update activation, evaluation, and enforcement. Verbose logging shows additional information about the interaction with the client user interface. - -* UpdatesHandler.log - Provides information about software update compliance scanning and about the download and installation of software updates on the client. - -* UpdatesStore.log - Provides information about the compliance status for the software updates that were assessed during the compliance scan cycle. - -* WUAHandler.log - Provides information about when the Windows Update Agent on the client searches for software updates. - -* WUSSyncXML.log - Provides information about the Inventory Tool for the Microsoft Updates synchronization process. This log is only on the client computer configured as the synchronization host for the Inventory Tool for Microsoft Updates. - -* Windows Update Agent Log File - - -* WindowsUpdate.log - Provides information about when the Windows Update Agent connects to the WSUS server and retrieves the software updates for compliance assessment and whether there are updates to the agent components. \ No newline at end of file diff --git a/dump/SCCM-Powershell.txt b/dump/SCCM-Powershell.txt deleted file mode 100644 index fd08935..0000000 --- a/dump/SCCM-Powershell.txt +++ /dev/null @@ -1,11 +0,0 @@ - - Right-click the Windows PowerShell icon and choose "Run as administrator". - Type CD 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin' and hit enter. - Type Import-Module .\ConfigurationManager.psd1 and run it. - Here's the crucial missing step. Enter New-PSDrive -Name [yoursitecode] -PSProvider "AdminUI.PS.Provider\CMSite" -Root "[your SCCM server's FQDN]" -Description "SCCM Site" - Now we can connect to the site. Enter CD ABC:, where ABC is your site code. The colon is necessary! - - -============================================================================================================================================= -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" diff --git a/dump/SCCM-Reports.txt b/dump/SCCM-Reports.txt deleted file mode 100644 index 12533b2..0000000 --- a/dump/SCCM-Reports.txt +++ /dev/null @@ -1,8 +0,0 @@ -Report Names: - -- States 5 - States for an update in a deployment(secondary) -- States 4 - Computers in a specific state for a deployment(secondary) -- Software 02D - Computers with specific software installed -- Software 01A - Summary of installed software in a specific collection -- IP - All subnets by subnet mask -- \ No newline at end of file diff --git a/dump/SCCM-Tool/Current-Collection-Servers.csv b/dump/SCCM-Tool/Current-Collection-Servers.csv deleted file mode 100644 index a295f3b..0000000 --- a/dump/SCCM-Tool/Current-Collection-Servers.csv +++ /dev/null @@ -1,3 +0,0 @@ -"Server","ClientInstalled","CollectionName" -"W2012A","True","Nabil - Test Collection" -"W2012B","True","Nabil - Test Collection" diff --git a/dump/SCCM-Tool/Forms/Combobox.ps1 b/dump/SCCM-Tool/Forms/Combobox.ps1 deleted file mode 100644 index c785442..0000000 Binary files a/dump/SCCM-Tool/Forms/Combobox.ps1 and /dev/null differ diff --git a/dump/SCCM-Tool/Forms/Datagrid.ps1 b/dump/SCCM-Tool/Forms/Datagrid.ps1 deleted file mode 100644 index f437e7d..0000000 Binary files a/dump/SCCM-Tool/Forms/Datagrid.ps1 and /dev/null differ diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Combobox-Final-2.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Combobox-Final-2.ps1 deleted file mode 100644 index 90f45a7..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Combobox-Final-2.ps1 +++ /dev/null @@ -1,218 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: b24654a3-c952-4b96-8e01-c56d9800c4a7 -# Source File: FirstForm4-tabs.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -UwsAAB+LCAAAAAAABADFVl1vmzAUfZ+0/2DxzELIR9NIBKkhjVStXasl6/ZWGbhJvBo7sk0T9utn -B5Lla4VKaSokBPY5Pvf6XF/wvkPEX0BkA6ww0g+ScNazGjXX8j9/Qsi7F2RKGKZDQuEbTsAfEiHV -kIuk9UXhUNbmcuI5B6icG/6GSCGVzaFnjTKpIKn9JCzmC1kzK+R3Gx2bstFjEUyrVjeXjYKUqlRA -j0GqBKY2ekhDSqKvkI35M7Be2OngdtS+cLvNFtQvuxZiOpSeNdHruRaKZoTGQuOsgDMlOJV5ijrQ -B8HnIFRWEK5SxUcRpjAgCTAThIZe2Mhtes4aWka94zFY/lArlXICSoCpEfmjCd22TvSi1SolmV22 -/FVqpdgxLJWJRSSH0OsXrV3gbjmOizWfzLPnrGbX0HI7A56EvM+X725pZIRCvnzV1iPuUMoXAz1m -+WORwsFuHDJM4FgpwqbXDIcU4srMG53/VigaYEZ2d2+khF7ZRomMuKAkPMUO+fdMh2e0PkB7vOAf -pz0TsJ95BZ9ueYSVlrZ8t3Wpz16nAucOL00VDfiCFTY36hVo+Znd1G4FRt4U3IZro0YV/BiHNyyG -peYcQ28f9hFQfZohXuGDGWZTU9yb4J6Oze81BCfvCNX7Qz9VirN37w7hSuaNveFfHTTr3Yp1kBta -yFW2s9PWbh5+Sl5zs0p15V2+ejA/JDwSmWI6UhmFPo6eA065+E+D2zF79+VKSki0MSDX2GIk8094 -wD1ns+q+Sl5O59A4ecmWK5ofs/MICbxYdeW3a9Wbk/akM3HduF3HTVyu9SuhZ8kp4AJOL7R5zUve -c7Z/ov2/L8SajlMLAAA=#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.124 - Generated on: 7/21/2016 3:30 PM - Generated by: administrator - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2016 -#> -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Call-FirstForm4-tabs_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $combobox1 = New-Object 'System.Windows.Forms.ComboBox' - $button1 = New-Object 'System.Windows.Forms.Button' - $button_ComboBoxSelection = New-Object 'System.Windows.Forms.Button' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - $TextBox_Display = New-Object 'System.Windows.Forms.TextBox' - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $combobox1_SelectedIndexChanged={ - #TODO: Place custom script here - - - } - - $form1_Load={ - #TODO: Place custom script here - - } - - $button1_Click={ - #TODO: Place custom script here - - Ba - } - - $button_ComboBoxSelection_Click={ - - $TextBox_Display.text = $Combobox1.SelectedItem - } - - $TextBox_Display_TextChanged={ - - } - - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $combobox1.remove_SelectedIndexChanged($combobox1_SelectedIndexChanged) - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - } - catch [Exception] - { } - } - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - $form1.SuspendLayout() - # - # form1 - # - $form1.Controls.Add($combobox1) - $form1.Controls.Add($button1) - $form1.Controls.Add($button_ComboBoxSelection) - $form1.Controls.Add($TextBox_Display) - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '950, 644' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - # - # combobox1 - # - $combobox1.AllowDrop = $True - $combobox1.FormattingEnabled = $True - #$combobox1.Items.AddRange("") -<# - [void]$combobox1.Items.Add('One') - [void]$combobox1.Items.Add('Two') - [void]$combobox1.Items.Add('Three') - -#> - # - # - $TextBox_Display.Location = '278, 120' - $TextBox_Display.Name = 'VCenterUserPassword' - $TextBox_Display.Size = '132, 20' - $TextBox_Display.TabIndex = 8 - $TextBox_Display.add_TextChanged($TextBox_Display_TextChanged) - - # - $combobox1.Location = '148, 67' - #$combobox1.MaxDropDownItems = 20 - $Combobox1.Text="- Select -" - $combobox1.Name = 'combobox1' - $combobox1.Size = '121, 21' - $combobox1.TabIndex = 1 - $combobox1.add_SelectedIndexChanged($combobox1_SelectedIndexChanged) - # - # button1 - # - $button1.Location = '309, 67' - $button1.Name = 'button1' - $button1.Size = '75, 23' - $button1.TabIndex = 0 - $button1.Text = 'button1' - $button1.UseVisualStyleBackColor = $True - $form1.ResumeLayout() - $button1.add_Click($button1_Click) - #endregion Generated Form Code - # - # button_ComboBoxSelection - $button_ComboBoxSelection.Location = '309, 40' - $button_ComboBoxSelection.Name = 'button_ComboBoxSelection' - $button_ComboBoxSelection.Size = '75, 23' - $button_ComboBoxSelection.TabIndex = 1 - $button_ComboBoxSelection.Text = 'Select Item' - $button_ComboBoxSelection.add_Click($button_ComboBoxSelection_Click) - - - # - - - #---------------------------------------------- - - - #Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - - -Function Ba { - -#$combobox1.Items.Add('a') - -$combobox1.Items.Clear() - -$P = Get-Process | select -ExpandProperty ProcessName - -$P | % { $combobox1.Items.Add($_) } - -} - - -#Call the form -Call-FirstForm4-tabs_psf | Out-Null diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Combobox-Final.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Combobox-Final.ps1 deleted file mode 100644 index 9c732a6..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Combobox-Final.ps1 +++ /dev/null @@ -1,222 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: b24654a3-c952-4b96-8e01-c56d9800c4a7 -# Source File: FirstForm4-tabs.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -UwsAAB+LCAAAAAAABADFVl1vmzAUfZ+0/2DxzELIR9NIBKkhjVStXasl6/ZWGbhJvBo7sk0T9utn -B5Lla4VKaSokBPY5Pvf6XF/wvkPEX0BkA6ww0g+ScNazGjXX8j9/Qsi7F2RKGKZDQuEbTsAfEiHV -kIuk9UXhUNbmcuI5B6icG/6GSCGVzaFnjTKpIKn9JCzmC1kzK+R3Gx2bstFjEUyrVjeXjYKUqlRA -j0GqBKY2ekhDSqKvkI35M7Be2OngdtS+cLvNFtQvuxZiOpSeNdHruRaKZoTGQuOsgDMlOJV5ijrQ -B8HnIFRWEK5SxUcRpjAgCTAThIZe2Mhtes4aWka94zFY/lArlXICSoCpEfmjCd22TvSi1SolmV22 -/FVqpdgxLJWJRSSH0OsXrV3gbjmOizWfzLPnrGbX0HI7A56EvM+X725pZIRCvnzV1iPuUMoXAz1m -+WORwsFuHDJM4FgpwqbXDIcU4srMG53/VigaYEZ2d2+khF7ZRomMuKAkPMUO+fdMh2e0PkB7vOAf -pz0TsJ95BZ9ueYSVlrZ8t3Wpz16nAucOL00VDfiCFTY36hVo+Znd1G4FRt4U3IZro0YV/BiHNyyG -peYcQ28f9hFQfZohXuGDGWZTU9yb4J6Oze81BCfvCNX7Qz9VirN37w7hSuaNveFfHTTr3Yp1kBta -yFW2s9PWbh5+Sl5zs0p15V2+ejA/JDwSmWI6UhmFPo6eA065+E+D2zF79+VKSki0MSDX2GIk8094 -wD1ns+q+Sl5O59A4ecmWK5ofs/MICbxYdeW3a9Wbk/akM3HduF3HTVyu9SuhZ8kp4AJOL7R5zUve -c7Z/ov2/L8SajlMLAAA=#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.124 - Generated on: 7/21/2016 3:30 PM - Generated by: administrator - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2016 -#> -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Call-FirstForm4-tabs_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $combobox1 = New-Object 'System.Windows.Forms.ComboBox' - $button1 = New-Object 'System.Windows.Forms.Button' - $button_ComboBoxSelection = New-Object 'System.Windows.Forms.Button' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - $TextBox_Display = New-Object 'System.Windows.Forms.TextBox' - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $combobox1_SelectedIndexChanged={ - #TODO: Place custom script here - - - } - - $form1_Load={ - #TODO: Place custom script here - - } - - - - - - $button1_Click={ - #TODO: Place custom script here - - Ba - } - - $button_ComboBoxSelection_Click={ - - $TextBox_Display.text = $Combobox1.SelectedItem - } - - $TextBox_Display_TextChanged={ - - } - - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $combobox1.remove_SelectedIndexChanged($combobox1_SelectedIndexChanged) - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - } - catch [Exception] - { } - } - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - $form1.SuspendLayout() - # - # form1 - # - $form1.Controls.Add($combobox1) - $form1.Controls.Add($button1) - $form1.Controls.Add($button_ComboBoxSelection) - $form1.Controls.Add($TextBox_Display) - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '950, 644' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - # - # combobox1 - # - $combobox1.AllowDrop = $True - $combobox1.FormattingEnabled = $True - #$combobox1.Items.AddRange("") -<# - [void]$combobox1.Items.Add('One') - [void]$combobox1.Items.Add('Two') - [void]$combobox1.Items.Add('Three') - -#> - # - # - $TextBox_Display.Location = '278, 120' - $TextBox_Display.Name = 'VCenterUserPassword' - $TextBox_Display.Size = '132, 20' - $TextBox_Display.TabIndex = 8 - $TextBox_Display.add_TextChanged($TextBox_Display_TextChanged) - - # - $combobox1.Location = '148, 67' - #$combobox1.MaxDropDownItems = 20 - $Combobox1.Text="- Select -" - $combobox1.Name = 'combobox1' - $combobox1.Size = '121, 21' - $combobox1.TabIndex = 1 - $combobox1.add_SelectedIndexChanged($combobox1_SelectedIndexChanged) - # - # button1 - # - $button1.Location = '309, 67' - $button1.Name = 'button1' - $button1.Size = '75, 23' - $button1.TabIndex = 0 - $button1.Text = 'button1' - $button1.UseVisualStyleBackColor = $True - $form1.ResumeLayout() - $button1.add_Click($button1_Click) - #endregion Generated Form Code - # - # button_ComboBoxSelection - $button_ComboBoxSelection.Location = '309, 40' - $button_ComboBoxSelection.Name = 'button_ComboBoxSelection' - $button_ComboBoxSelection.Size = '75, 23' - $button_ComboBoxSelection.TabIndex = 1 - $button_ComboBoxSelection.Text = 'Select Item' - $button_ComboBoxSelection.add_Click($button_ComboBoxSelection_Click) - - - # - - - #---------------------------------------------- - - - #Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - - -Function Ba { - -#$combobox1.Items.Add('a') - -$combobox1.Items.Clear() - -$P = Get-Process w* | select -ExpandProperty ProcessName - -$P | % { $combobox1.Items.Add($_) } - -} - - -#Call the form -Call-FirstForm4-tabs_psf | Out-Null diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Combobox.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Combobox.ps1 deleted file mode 100644 index bcf1acd..0000000 Binary files a/dump/SCCM-Tool/Forms/Form-Examples/Combobox.ps1 and /dev/null differ diff --git a/dump/SCCM-Tool/Forms/Form-Examples/FirstForm4-tabs.Export-10.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/FirstForm4-tabs.Export-10.ps1 deleted file mode 100644 index 3248a3d..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/FirstForm4-tabs.Export-10.ps1 +++ /dev/null @@ -1,1032 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: b24654a3-c952-4b96-8e01-c56d9800c4a7 -# Source File: FirstForm4-tabs.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -PxYAAB+LCAAAAAAABADNWNtu2kAQfa/Uf7D8TAEbg4kElhJS1KpJgwpN+xat7YFss/ai9ToJ/fqO -L0QBfCVAIxDyZWbP7JyzMyMGP8DhjyBWl0QSBS8Cyv2hqjc11fr4QVEGN4IuqE/YmDL4TjywxlQE -csyFZ3ySxA6ay2A+aO1YJb72H3CkIldLGKrTVSDBa/6ivsufgma0QvLbULJeNZTbNBij2Y4+DWUU -MhkKGPoQSkFYQ5mENqPON1jN+AP4Q9s0Sdfp9rSzjgHt/pmq+BjKUJ3jepqqOPeUuQLt1BH3peAs -SLaIgU4EX4KQq9ThPJR86hAGl9QDPwoCTXsNResMWmvTMtdr7oJqjRGp1GfEKPhySv+ig6mZDcXo -GaVOUZZVK95aqe0MnmUUi/B2TT8/InZqd8WJm655F10PWvHbtWk5nTNip7k9OqmXX0aTIk53s3DF -HSIRW7U0HbnUd3KRl+QIqoLxFBimB9yvvgvPqtWu4hJz3jvrIOdGFQdMcNHylRiakAUcnR4sDUvE -KTx2xSQZDUXP4iiPpTViJZcJcV3qL1QLM59+K/mlhPW7SJi2e0jrU5Z3WHM0t2v+M4BbGoSETeWK -wQVxHkaccaFaMxFC9grlKrkiNhz/CLMIJdroFAR2npjGErnkFNyYldwNF5aCqKxnayZPaBlhV/RP -4tTaemYrKZNPZY8XASlJhEpuiNi4Yy3UU0cEcMGfT1Lig3gHiFZfGZsk62Ytkjewa9KLW9azz3oR -vdm1bqtDR6kf3RN/Ae5WjHevXm327f2Jvgil5P7RebZjGCTVx3jexHOnj6nv1iJ6A7wW0SY2Ab3+ -Ma5abJJjXC+w+s1gS184ijoPW0m5ix8eSlOnKh43oVyGb1JT1Bkq83uNYVJG/Xp9KJFgEmot7fVM -HFn0flWpl80gRVUmia5medl98O5GU/3ko2k1l/8ymlabmpOSVGs3e4ynGfVoDZlbit5ZLyvVVmEX -6xoRhXt0sdwR4pD9q/JkE4ulXmCH7V/5cikpVxu3mzfnQQAeKgGCtW36ZGV5gcMFo/YB1DRovay6 -jZLo9xQYBz8j5YjRn5CnARLkCYvsPljtzrw7N+ea5nbbpEPKsX577CR7GnEBhwd6uU0kP2i9/sPY -+gcZbzYwPxYAAA==#> -#endregion - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Call-FirstForm4-tabs_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $DHCP = New-Object 'System.Windows.Forms.TabControl' - $tabpage1 = New-Object 'System.Windows.Forms.TabPage' - $flowlayoutControls1 = New-Object 'System.Windows.Forms.FlowLayoutPanel' - $labelDHCPServerName = New-Object 'System.Windows.Forms.Label' - $labelVcenterServerName = New-Object 'System.Windows.Forms.Label' - $labelVCenterUserName = New-Object 'System.Windows.Forms.Label' - $labelVCenterPassword = New-Object 'System.Windows.Forms.Label' - $DHCPserverBox = New-Object 'System.Windows.Forms.TextBox' - $VCenterServerBox = New-Object 'System.Windows.Forms.TextBox' - # $VCenterUserName = New-Object 'System.Windows.Forms.TextBox' - # $VCenterUserPassword = New-Object 'System.Windows.Forms.TextBox' - # $CheckBoxUseWindowsLogin = New-Object 'System.Windows.Forms.CheckBox' - $buttonConnect = New-Object 'System.Windows.Forms.Button' - $buttonVMHostInfo = New-Object 'System.Windows.Forms.Button' - $ButtonScopeStats = New-Object 'System.Windows.Forms.Button' - # $ButtonScopes1 = New-Object 'System.Windows.Forms.Button' - $ButtonTest = New-Object 'System.Windows.Forms.Button' - $Output = New-Object 'System.Windows.Forms.TextBox' - $tabpage2 = New-Object 'System.Windows.Forms.TabPage' - $panel1 = New-Object 'System.Windows.Forms.Panel' - $Connect = New-Object 'System.Windows.Forms.Button' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - $comboboxScopes = New-Object 'System.Windows.Forms.ComboBox' - $ButtonSelect = New-Object 'System.Windows.Forms.Button' - $labelScopeSelected = New-Object 'System.Windows.Forms.Label' - $labelCurrentScope = New-Object 'System.Windows.Forms.Label' - $labelConnectedDHCPServer = New-Object 'System.Windows.Forms.Label' - $labelDHCPServerStatus = New-Object 'System.Windows.Forms.Label' - $radioDisplay = New-Object 'System.Windows.Forms.RadioButton' - $radioGridview = New-Object 'System.Windows.Forms.RadioButton' - $radioCSV = New-Object 'System.Windows.Forms.RadioButton' - $ButtonAvailableIPAddresses = New-Object 'System.Windows.Forms.Button' - $ButtonExclusionList = New-Object 'System.Windows.Forms.Button' - $ButtonReservationList = New-Object 'System.Windows.Forms.Button' - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - #$DefaultCompName = $env:COMPUTERNAME - #$Output.Text = $DefaultCompName - $Global:DisplayType = "OnScreen" - NA-VCconn - #NA-TestOutput - } -#################################################################################################################################### - $flowlayoutControls1_Paint=[System.Windows.Forms.PaintEventHandler]{ - #Event Argument: $_ = [System.Windows.Forms.PaintEventArgs] - #TODO: Place custom script here - - } -#################################################################################################################################### - $Output_TextChanged={ - #TODO: Place custom script here - - } -#################################################################################################################################### - $comboboxScopes_SelectedIndexChanged={ - #TODO: Place custom script here - - - } -#################################################################################################################################### - $labelCurrentScope_Click={ - - } -#################################################################################################################################### - $labelConnectedDHCPServer_Click={} -#################################################################################################################################### - $labelDHCPServerStatus_Click={} -#################################################################################################################################### - $DHCPserverBox_TextChanged={ - #TODO: Place custom script here - } -#################################################################################################################################### - $VCenterServerBox_TextChanged={} -#################################################################################################################################### -<# - $VCenterUserName_TextChanged={ - - } - - $VCenterUserPassword_TextChanged={ - - } - - $CheckBoxUseWindowsLogin_CheckedChanged={ - - If ($CheckBoxUseWindowsLogin.Checked -eq $true) { - $Output.Text = "Checkbox Checked" - } - } -#> - $buttonConnect_Click={ - #TODO: Place custom script here - If (!$DHCPserverBox.Text) { - $Output.Text = "###### Please enter DHCP server name in the Box ###### " - } - - Else { - $Output.Text = "**** Locating DHCP Server: $($DHCPserverBox.text.ToUpper()) ****" - $PingDHCPServer = Test-Connection -ComputerName $DHCPserverBox.text -Count 1 -ErrorAction SilentlyContinue - If (!$PingDHCPServer) { $Output.Text = "#### DHCP Server: $($DHCPserverBox.text.ToUpper()) is not accessible - Please Check the Name! ####" } - Else { - NA-Server-Connection 1 ($DHCPserverBox.text) - NA-GetScopes - } - } - - - } - -#################################################################################################################################### - $ButtonAvailableIPAddresses_Click={ - If ($labelScopeSelected.Text -ne $Global:ScopeValue) { - If (Get-PSSession) { - NA-Get-DHCPinfo -Option AvailableIPAddresses -ScopeSend ($labelScopeSelected.Text) -DisplayOption $Global:DisplayType - } - Else { $Output.Text = "### Not Connected to DHCP Server - Please enter DHCP server name and Connect ###" } - } - } -#################################################################################################################################### - $ButtonExclusionList_Click={ - - #$Output.Text = $Global:DisplayType - If ($labelScopeSelected.Text -ne $Global:ScopeValue) { - If (Get-PSSession) { - NA-Get-DHCPinfo -Option ExclusionList -ScopeSend ($labelScopeSelected.Text) -DisplayOption $Global:DisplayType - } - Else { $Output.Text = "### Not Connected to DHCP Server - Please enter DHCP server name and Connect ###" } - } - Else { $Output.Text = "### Scope Not Found! -- Please Select a Scope from the List ###"} - - } -#################################################################################################################################### - $ButtonReservationList_Click={ - - If ($labelScopeSelected.Text -ne $Global:ScopeValue) { - If (Get-PSSession) { - NA-Get-DHCPinfo -Option ReservationList -ScopeSend ($labelScopeSelected.Text) -DisplayOption $Global:DisplayType - } - Else { $Output.Text = "### Not Connected to DHCP Server - Please enter DHCP server name and Connect ###" } - } - Else { $Output.Text = "### Scope Not Found! -- Please Select a Scope from the List ###"} - - }#end Button - -#################################################################################################################################### - $buttonVMHostInfo_Click={ - - If ( $Global:VCenterConnectionStatus -eq $False) { $Output.Text = "### Please Connect to VCenter Server First ###" } - - Else { - $Output.Text = "Geting VM Host Information ...... Please wait!" - $VMHostInformation = Get-VMHost | select name,build,model,@{Name="MemoryTotalGB";Expression={"{0:N2}" -f $_.memorytotalgb}},@{Name="MemoryUsageGB";Expression={"{0:N2}" -f $_.memoryusageGb}} | FT -AutoSize | Out-String - $Output.Text = $VMHostInformation - } - } - - -#################################################################################################################################### - $ButtonScopeStats_Click={ - - If (Get-PSSession) { - - Invoke-Command -Session $Global:Session { $Get_dhcpScopeStats = Get-DhcpServerV4ScopeStatistics } - $DhcpScopeStats = Invoke-Command -Session $Global:Session { $Get_dhcpScopeStats } - - If ($radioGridview.Checked) { - $Output.Text = $DhcpScopeStats | select ScopeID,Free,InUse,@{n="PercentageInUse";e={[Math]::Round($_.PercentageInUse,2)}},Reserved,Pending,SuperScopeName | Out-GridView #ft -AutoSize | Out-String - } - Else { - $Output.Text = $DhcpScopeStats | select ScopeID,Free,InUse,@{n="PercentageInUse";e={[Math]::Round($_.PercentageInUse,2)}},Reserved,Pending,SuperScopeName | ft -AutoSize | Out-String - } - }#end If - - Else { - $Output.Text = "No Connection to DHCP exists - Cannot proceed!" - }#end Else - - } -#################################################################################################################################### - - $ButtonSelect_Click={ - [Bool]$Yes = $False - $Global:Scope | % { $IP = $_; $CmboIP = $comboboxScopes.Text; If ($IP -eq $CmboIP) { $Yes = $True } } - - If ($Yes) { - $labelScopeSelected.Text = $comboboxScopes.Text - } - Else { $Output.Text = "Invalid IP Selection - Try Again!"} - # NA-GetScopes - } -#################################################################################################################################### - -<# - $ButtonScopes1_Click={ - - $Output.Text = "Hello" - #NA-GetScopes - } -#> - - - -#################################################################################################################################### - $radioDisplay_SelectedIndexChanged={ - $Global:DisplayType = "OnScreen" - #$Output.Text = $DisplayType - } -#################################################################################################################################### - $radioGridview_SelectedIndexChanged={ - $Global:DisplayType = "GridView" - - #$Output.Text = $DisplayType - } -#################################################################################################################################### - $radioCSV_SelectedIndexChanged={ - $Global:DisplayType = "CSV" - #$Output.Text = $DisplayType - } -#################################################################################################################################### - $tabpage2_SelectedIndexChanged={ - #TODO: Place custom script here -[System.Windows.Forms.MessageBox]::Show("This is Error","Error Window",'OK', 'Error') - } -#################################################################################################################################### - $tabpage1_SelectedIndexChanged={ - - } -#################################################################################################################################### - $Connect_Click={ - #TODO: Place custom script here - #$Output.Text = $VCenterUserName.Text - - $Global:VC = $VCenterServerBox.Text - #$VCuser = $VCenterUserName.Text - #$VCpwd = $VCenterUserPassword.text - - NA-AddPSsnapin - - If (!$VCenterServerBox.text) { $Output.Text = "###### Please Enter VCenter Server Name in the Box ######!!!!"} - - Else { - $CheckVCenterConnection = Test-Connection -ComputerName $VCenterServerBox.text -Count 1 -ErrorAction SilentlyContinue - - If (!$CheckVCenterConnection) { $Output.Text = "VCenter Server: $VC is not accessible. Please Check Server Name!"} - - Else { - NA-VCenterConnection -VCenterServer $Global:VC -ConnState Connect - - }#end Else - }#end Else - - - #$Test = Get-VM Catlbi01 | select * - #$Output.text = $Test | Out-String - - }#End $Connect_Click -#################################################################################################################################### - - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $DHCPserverBox.remove_TextChanged($DHCPserverBox_TextChanged) - $flowlayoutControls1.remove_Paint($flowlayoutControls1_Paint) - $VCenterServerBox.remove_TextChanged($VCenterServerBox_TextChanged) - # $VCenterUserName.remove_TextChanged($VCenterUserName_TextChanged) - # $VCenterUserPassword.remove_TextChanged($VCenterUserPassword_TextChanged) - # $CheckBoxUseWindowsLogin.remove_TextChanged($CheckBoxUseWindowsLogin_CheckedChanged) - $buttonConnect.remove_Click($buttonConnect_Click) - $ButtonAvailableIPAddresses.remove_Click($ButtonAvailableIPAddresses_Click) - $ButtonExclusionList.remove_Click($ButtonExclusionList_Click) - $ButtonReservationList.remove_Click($ButtonReservationList_Click) - $buttonVMHostInfo.remove_Click($buttonVMHostInfo_Click) - $ButtonScopeStats.remove_Click($ButtonScopeStats_Click) - $ButtonSelect.remove_Click($ButtonSelect_Click) - # $ButtonScopes1.remove_Click($ButtonScopes_Click) - $Output.remove_TextChanged($Output_TextChanged) - $Connect.remove_Click($Connect_Click) - $tabpage2.remove_Click($tabpage2_Click) - $panel1.remove_Paint($panel1_Paint) - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - $comboboxScopes.remove_SelectedIndexChanged($comboboxScopes_SelectedIndexChanged) - $radioDisplay.remove_CheckedChanged($radioDisplay_SelectedIndexChanged) - $radioGridview.remove_CheckedChanged($radioGridview_SelectedIndexChanged) - $radioCSV.remove_CheckedChanged($radioCSV_SelectedIndexChanged) - #$Output.Text = "Closing Connection to DHCP Server" - NA-Server-Connection 0 - NA-VCenterConnection -ConnState Disconnect - NA-ClearGlobalVariables - #Write-Host "bye bye" - # Close VCenter connection - } - catch [Exception] - { } - } - - $panel1_Paint=[System.Windows.Forms.PaintEventHandler]{ - #Event Argument: $_ = [System.Windows.Forms.PaintEventArgs] - #TODO: Place custom script here - - } - - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - $form1.SuspendLayout() - $DHCP.SuspendLayout() - $tabpage1.SuspendLayout() - $tabpage2.SuspendLayout() - $flowlayoutControls1.SuspendLayout() - # - # form1 - # - $form1.Controls.Add($DHCP) - $form1.Controls.Add($Output) - $form1.Controls.Add($flowlayoutControls1) - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '921, 644' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - # - # DHCP - # - $DHCP.Controls.Add($tabpage1) - $DHCP.Controls.Add($tabpage2) - $DHCP.Location = '139, 10' - $DHCP.Name = 'DHCP' - $DHCP.SelectedIndex = 0 - $DHCP.Size = '754, 237' - $DHCP.TabIndex = 0 - # - # tabpage1 - # - $tabpage1.Controls.Add($labelDHCPServerName) - $tabpage1.Controls.Add($labelScopeSelected) - $tabpage1.Controls.Add($labelCurrentScope) - $tabpage1.Controls.Add($labelConnectedDHCPServer) - $tabpage1.Controls.Add($labelDHCPServerStatus) - $tabpage1.Controls.Add($DHCPserverBox) - $tabpage1.Controls.Add($buttonConnect) - $tabpage1.Controls.Add($ButtonScopeStats) - $tabpage1.Controls.Add($ButtonSelect) - $tabpage1.Controls.Add($comboboxScopes) - $tabpage1.Controls.Add($radioDisplay) - $tabpage1.Controls.Add($radioGridview) - $tabpage1.Controls.Add($radioCSV) - $tabpage1.Controls.Add($flowlayoutControls1) - $tabpage1.Controls.Add($ButtonReservationList) - # $tabpage1.Controls.Add($ButtonScopes1) - # $tabpage1.Controls.Add($Output) - $tabpage1.Location = '4, 22' - $tabpage1.Name = 'tabpage1' - $tabpage1.Padding = '3, 3, 3, 3' - $tabpage1.Size = '754, 237' - $tabpage1.TabIndex = 0 - $tabpage1.Text = 'DHCP' - $tabpage1.UseVisualStyleBackColor = $True - # - # flowlayoutpanel1 - # - $flowlayoutControls1.Controls.Add($ButtonAvailableIPAddresses) - $flowlayoutControls1.Controls.Add($ButtonExclusionList) - $flowlayoutControls1.Controls.Add($ButtonReservationList) - $flowlayoutControls1.BackColor = 'InactiveCaption' - $flowlayoutControls1.BorderStyle = 'FixedSingle' - $flowlayoutControls1.Location = '393, 7' - $flowlayoutControls1.Name = 'flowlayoutpanel1' - $flowlayoutControls1.Padding = '4, 4, 4, 4' - $flowlayoutControls1.Size = '200, 190' - $flowlayoutControls1.TabIndex = 0 - $flowlayoutControls1.add_Paint($flowlayoutControls1_Paint) - # - # labelDHCPServerName - # - $labelDHCPServerName.AutoSize = $True - $labelDHCPServerName.Location = '16, 11' - $labelDHCPServerName.Name = 'labelDHCPServerName' - $labelDHCPServerName.Size = '102, 13' - $labelDHCPServerName.TabIndex = 3 - $labelDHCPServerName.Text = 'DHCP Server Name' - # - # labelScopeSelected - # - $labelScopeSelected.AutoSize = $True - $labelScopeSelected.Location = '310, 31' - $labelScopeSelected.Name = 'ScopeSelected' - $labelScopeSelected.Size = '102, 13' - $labelScopeSelected.TabIndex = 12 - #$labelScopeSelected.Text = '----' - $Global:ScopeValue = "----" - $labelScopeSelected.Text = $Global:ScopeValue - # - # labelCurrentScoope - # - $labelCurrentScope.AutoSize = $True - $labelCurrentScope.Location = '230, 31' - $labelCurrentScope.Name = 'CurrentScope' - $labelCurrentScope.Size = '102, 13' - $labelCurrentScope.TabIndex = 13 - $labelCurrentScope.Text = 'Current Scope:' - $labelCurrentScope.add_Click($labelCurrentScope_Click) - # - # labelConnectedDHCPServer - # - $labelConnectedDHCPServer.AutoSize = $True - $labelConnectedDHCPServer.Location = '230, 11' - $labelConnectedDHCPServer.Name = 'DHCPServer' - $labelConnectedDHCPServer.Size = '102, 13' - $labelConnectedDHCPServer.TabIndex = 13 - $labelConnectedDHCPServer.Text = 'DHCP Server:' - $labelConnectedDHCPServer.add_Click($labelConnectedDHCPServer_Click) - # - # labelDHCPServerStatus - # - $labelDHCPServerStatus.AutoSize = $True - $labelDHCPServerStatus.Location = '310, 11' - $labelDHCPServerStatus.Name = 'DHCPServerStatus' - $labelDHCPServerStatus.Size = '102, 13' - $labelDHCPServerStatus.TabIndex = 14 - $labelDHCPServerStatus.Text = '----' - $labelDHCPServerStatus.add_Click($labelDHCPServerStatus_Click) - # - # DHCPserverBox - # - $DHCPserverBox.Location = '20, 30' - $DHCPserverBox.Name = 'DHCPserverBox' - $DHCPserverBox.Size = '100, 20' - $DHCPserverBox.TabIndex = 2 - $DHCPserverBox.add_TextChanged($DHCPserverBox_TextChanged) - # - # comboboxScopes - - - $comboboxScopes.Location = '6, 107' - #$combobox1.MaxDropDownItems = 20 - $comboboxScopes.Text="----" - $comboboxScopes.Name = 'combobox1' - $comboboxScopes.Size = '121, 21' - $comboboxScopes.TabIndex = 1 - $comboboxScopes.add_SelectedIndexChanged($comboboxScopes_SelectedIndexChanged) - $comboboxScopes.AllowDrop = $True - $comboboxScopes.FormattingEnabled = $True - # - # $ButtonSelect - $ButtonSelect.Location = '138, 106' - $ButtonSelect.Name = 'ButtonSelect' - $ButtonSelect.Size = '75, 23' - $ButtonSelect.TabIndex = 13 - $ButtonSelect.Text = 'Select' - $ButtonSelect.UseVisualStyleBackColor = $True - $ButtonSelect.add_Click($ButtonSelect_Click) - # - # radioDisplay - # - $radioDisplay.Location = '6, 135' - $radioDisplay.Checked = $True - $radioDisplay.Name = 'Display' - $radioDisplay.Size = '77, 24' - $radioDisplay.TabIndex = 14 - $radioDisplay.TabStop = $True - $radioDisplay.Text = 'OnScreen' - $radioDisplay.UseVisualStyleBackColor = $True - $radioDisplay.add_CheckedChanged($radioDisplay_SelectedIndexChanged) - $form1.ResumeLayout() - # - # radioGridview - # - $radioGridview.Location = '84, 135' - $radioGridview.Name = 'Gridview' - $radioGridview.Size = '77, 24' - $radioGridview.TabIndex = 15 - $radioGridview.TabStop = $True - $radioGridview.Text = 'GridView' - $radioGridview.UseVisualStyleBackColor = $True - $radioGridview.add_CheckedChanged($radioGridview_SelectedIndexChanged) - # - # radioCSV - # - $radioCSV.Location = '162, 135' - $radioCSV.Name = 'CSV' - $radioCSV.Size = '77, 24' - $radioCSV.TabIndex = 16 - $radioCSV.TabStop = $True - $radioCSV.Text = 'CSV' - $radioCSV.UseVisualStyleBackColor = $True - $radioCSV.add_CheckedChanged($radioCSV_SelectedIndexChanged) - # - # ButtonAvailableIPAddresses - # - $ButtonAvailableIPAddresses.Location = '7, 7' - $ButtonAvailableIPAddresses.Name = 'AvailableIPAddresses' - $ButtonAvailableIPAddresses.Size = '126, 23' - $ButtonAvailableIPAddresses.TabIndex = 16 - $ButtonAvailableIPAddresses.Text = "Available IPs" - $ButtonAvailableIPAddresses.UseVisualStyleBackColor = $True - $ButtonAvailableIPAddresses.add_Click($ButtonAvailableIPAddresses_Click) - $flowlayoutControls1.ResumeLayout() - # - # ButtonExclusionList - # - $ButtonExclusionList.Location = '7, 36' - $ButtonExclusionList.Name = 'ExclusionList' - $ButtonExclusionList.Size = '126, 23' - $ButtonExclusionList.TabIndex = 17 - $ButtonExclusionList.Text = "Exclusion List" - $ButtonExclusionList.UseVisualStyleBackColor = $True - $ButtonExclusionList.add_Click($ButtonExclusionList_Click) - $flowlayoutControls1.ResumeLayout() - # - # ButtonReservationList - $ButtonReservationList.Location = '7, 66' - $ButtonReservationList.Name = 'Reservations' - $ButtonReservationList.Size = '126, 23' - $ButtonReservationList.TabIndex = 18 - $ButtonReservationList.Text = "Reservations" - $ButtonReservationList.add_Click($ButtonReservationList_Click) - $ButtonReservationList.UseVisualStyleBackColor = $True - $flowlayoutControls1.ResumeLayout() - # - # - # VCenterServerBox - # - $VCenterServerBox.Location = '8, 26' - $VCenterServerBox.Name = 'VCenterServerBox' - $VCenterServerBox.Size = '100, 20' - $VCenterServerBox.TabIndex = 6 - $VCenterServerBox.add_TextChanged($VCenterServerBox_TextChanged) - # - # VCenterUserName - <# - $VCenterUserName.Location = '140, 28' - $VCenterUserName.Name = 'VCenterUserName' - $VCenterUserName.Size = '132, 20' - $VCenterUserName.TabIndex = 7 - $VCenterUserName.add_TextChanged($VCenterUserName_TextChanged) - #> - # VCenterUserPassword - <# - $VCenterUserPassword.Location = '278, 28' - $VCenterUserPassword.Name = 'VCenterUserPassword' - $VCenterUserPassword.Size = '132, 20' - $VCenterUserPassword.TabIndex = 8 - $VCenterUserPassword.add_TextChanged($VCenterUserPassword_TextChanged) - #> - # CheckBoxUseWindowsLogin - <# - $CheckBoxUseWindowsLogin.Location = '518, 30' - $CheckBoxUseWindowsLogin.Name = 'CheckBoxUseWindowsLogin' - $CheckBoxUseWindowsLogin.Size = '123, 17' - $CheckBoxUseWindowsLogin.TabIndex = 9 - $CheckBoxUseWindowsLogin.Text = 'Use Windows Login' - $CheckBoxUseWindowsLogin.add_TextChanged($CheckBoxUseWindowsLogin_CheckedChanged) - #> - # buttonConnect - # - $buttonConnect.Location = '138, 28' - $buttonConnect.Name = 'buttonConnect' - $buttonConnect.Size = '75, 23' - $buttonConnect.TabIndex = 1 - $buttonConnect.Text = 'Connect' - $buttonConnect.UseVisualStyleBackColor = $True - $buttonConnect.add_Click($buttonConnect_Click) - # - # ButtonScopeStats - $ButtonScopeStats.Location = '138, 60' - $ButtonScopeStats.Name = 'ButtonScopeStats' - $ButtonScopeStats.Size = '75, 23' - $ButtonScopeStats.TabIndex = 2 - $ButtonScopeStats.Text = 'Scope Stats' - $ButtonScopeStats.UseVisualStyleBackColor = $True - $ButtonScopeStats.add_Click($ButtonScopeStats_Click) - # - - <# ButtonScopes - $ButtonScopes1.Location = '138, 92' - $ButtonScopes1.Name = 'ButtonScopes' - $ButtonScopes1.Size = '75, 23' - $ButtonScopes1.TabIndex = 4 - $ButtonScopes1.Text = 'Get-Scopes' - $ButtonScopes1.UseVisualStyleBackColor = $True - $ButtonScopes1.add_Click($ButtonScopes1_Click) - #> - - - - - # Output - # - $Output.Location = '139, 280' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'Both' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.Size = '754, 335' - $Output.TabIndex = 0 - $Output.add_TextChanged($Output_TextChanged) - # - # tabpage2 - # - $tabpage2.Controls.Add($Connect) - $tabpage2.Controls.Add($buttonVMHostInfo) - $tabpage2.Controls.Add($panel1) - $tabpage2.Controls.Add($labelVcenterServerName) - $tabpage2.Controls.Add($VCenterServerBox) - #$tabpage2.Controls.Add($VCenterUserName) - #$tabpage2.Controls.Add($VCenterUserPassword) - #$tabpage2.Controls.Add($CheckBoxUseWindowsLogin) - $tabpage2.Controls.Add($labelVCenterUserName) - $tabpage2.Controls.Add($labelVCenterPassword) - - $tabpage2.Location = '4, 22' - $tabpage2.Name = 'tabpage2' - $tabpage2.Padding = '3, 3, 3, 3' - $tabpage2.Size = '754, 237' - $tabpage2.TabIndex = 1 - $tabpage2.Text = 'VCenter' - $tabpage2.UseVisualStyleBackColor = $True - $tabpage2.add_Click($tabpage2_Click) - # - # labelDHCPServerName - # - $labelVcenterServerName.AutoSize = $True - $labelVcenterServerName.Location = '8, 6' - $labelVcenterServerName.Name = 'labelVcenterServerName' - $labelVcenterServerName.Size = '100, 20' - $labelVcenterServerName.TabIndex = 3 - $labelVcenterServerName.Text = 'VCenter Server:' - # - - # - <# labelVCenterUserName - # - $labelVCenterUserName.AutoSize = $True - $labelVCenterUserName.Location = '138, 11' - $labelVCenterUserName.Name = 'labelVCenterUserName' - $labelVCenterUserName.Size = '99, 13' - $labelVCenterUserName.TabIndex = 4 - $labelVCenterUserName.Text = 'Domain\Username:' - #> - <# labelVCenterPassword - # - $labelVCenterPassword.AutoSize = $True - $labelVCenterPassword.Location = '275, 11' - $labelVCenterPassword.Name = 'labelVCenterPassword' - $labelVCenterPassword.Size = '56, 13' - $labelVCenterPassword.TabIndex = 5 - $labelVCenterPassword.Text = 'Password:' - #> - - # Connect - # - $Connect.Location = '122, 30' - $Connect.Name = 'Connect' - $Connect.Size = '75, 23' - $Connect.TabIndex = 0 - $Connect.Text = 'Connect' - $Connect.UseVisualStyleBackColor = $True - $Connect.add_Click($Connect_Click) - # - $tabpage2.ResumeLayout() - $tabpage1.ResumeLayout() - $DHCP.ResumeLayout() - $form1.ResumeLayout() - #endregion Generated Form Code - # - # buttonVMHostInfo - $buttonVMHostInfo.Location = '188, 81' - $buttonVMHostInfo.Name = 'VMHost_Info' - $buttonVMHostInfo.Size = '75, 23' - $buttonVMHostInfo.TabIndex = 9 - $buttonVMHostInfo.Text = 'VMHost Info' - $buttonVMHostInfo.add_Click($buttonVMHostInfo_Click) - - # - #---------------------------------------------- - - # panel1 - # - $panel1.Controls.Add($labelVcenterServerName) - $panel1.Controls.Add($VCenterServerBox) - $panel1.Controls.Add($VCenterUserName) - $panel1.Controls.Add($VCenterUserPassword) - $panel1.Controls.Add($CheckBoxUseWindowsLogin) - $panel1.Controls.Add($labelVCenterUserName) - $panel1.Controls.Add($labelVCenterPassword) - $panel1.BackColor = 'LightSteelBlue' - $panel1.Location = '6, 6' - $panel1.Name = 'panel1' - $panel1.Size = '198, 56' - $panel1.TabIndex = 0 - $panel1.add_Paint($panel1_Paint) - $tabpage2.ResumeLayout() - $tabpage1.ResumeLayout() - $DHCP.ResumeLayout() - $form1.ResumeLayout() - #endregion Generated Form Code - - #---------------------------------------------- - - #Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function Call-FirstForm4-tabs_psf - - #################################################################################################################################### - Function NA-GetScopes { - - Invoke-Command -Session $Global:Session { $Get_Scope = Get-DhcpServerv4Scope | select -ExpandProperty ScopeID} - $Global:Scope = Invoke-Command -Session $Global:Session { $Get_Scope } - - $comboboxScopes.Items.Clear() - - # $Global:Scope = Get-Process | select -ExpandProperty ProcessName - - $Global:Scope | % { $comboboxScopes.Items.Add($_) } - - } - - #################################################################################################################################### - Function NA-AddPSsnapin { - - $CheckPsSnapIn = Get-PSSnapin vmw* -ErrorAction SilentlyContinue - - If (!($CheckPsSnapIn)) { - - $Output.Text = "Adding PowerCLI Snap-in - Please Wait ...." - Add-PSSnapin vmw* - $CheckPsSnapIn = Get-PSSnapin vmw* -ErrorAction SilentlyContinue - - If ($CheckPsSnapIn) { - - $Output.Text = "Done!" - }#end If - }#end If - - } - #################################################################################################################################### - Function NA-VCconn { - $Global:VCenterConnectionStatus = $False - #$Output.Text = $Global:VCenterConnectionStatus - $Output.Text = "Welcome" - } - #################################################################################################################################### - Function NA-TestOutput { - $Output.Text = "This is Working!!!" - } - #################################################################################################################################### - Function NA-VCenterConnection ($VCenterServer, $ConnState) { - - #If (Get-VMHost -ErrorAction SilentlyContinue) { $Output.text = "Checking Status of VCenter Connection.....!" ;$Output.text = "Already Connected to VCenter: $VCenterServer" } - - Switch($ConnState) { - Connect { $T = $DefaultVIServer | select -ExpandProperty IsConnected - If ($T -eq $True) { $Output.text = "Checking Status of VCenter Connection.....!" ;$Output.text = "Already Connected to VCenter: $VCenterServer"; Break } - - Else { - $Output.text = "Connecting to VCenter ..... Please Wait!" - $Cred = Get-Credential -Credential (Get-WMIObject -class Win32_ComputerSystem | select -ExpandProperty username) - - Connect-VIServer -Server $VCenterServerBox.Text -Credential $Cred - - $T = $DefaultVIServer | select -ExpandProperty IsConnected - - If ($T -eq $True) { $Output.text = "Successfully Connected to VCenter: $VCenterServer" - $Global:VCenterConnectionStatus = $True } - - Else { $Output.text = "Failed to Connect to VCenter $VCenterServer - Please Try Again!" } - }#end Else - } - - Disconnect { If ($Global:VCenterConnectionStatus -eq $True) { $Global:VCenterConnectionStatus = $False ;Disconnect-VIServer -Server $Global:VC -Force -Confirm:$false} - Else { Break } - } - - }#end Switch - - - - }#end Function -#################################################################################################################################### - Function NA-Get-DHCPinfo ($Option,$ScopeSend,$DisplayOption) { - - Begin { } - - Process { - Switch($Option) - { - ExclusionList { $PickScope = $ScopeSend #$labelScopeSelected.Text #$comboboxScopes.Text - #$Output.Text = $PickScope - Invoke-Command -Session $Global:Session { Param($PickScope) $Get_Exclusion = Get-DhcpServerV4ExclusionRange -ScopeID $PickScope | sort StartRange } -ArgumentList $PickScope - $Exclusion = Invoke-Command -Session $Global:Session { $Get_Exclusion } - - If ($Exclusion) { - - Switch($DisplayOption) { - "OnScreen" { $Output.Text = $Exclusion | select ScopeID,StartRange,EndRange | ft -AutoSize | Out-String } - "GridView" { $Output.Text = $Exclusion | select ScopeID,StartRange,EndRange | Out-GridView } - "CSV" { $Output.Text = "This Option is not yet Available!!!!!!!!!!" } - }#end Switch - - - }#end If - - Else { $Output.Text = "#### No Exclusions Found for the Scope: $PickScope ####" } - - }#end ExclusionList - - ReservationList { $PickScope = $ScopeSend - Invoke-Command -Session $Global:Session { Param($PickScope) $Get_Reservation = Get-DhcpServerV4Reservation -ScopeID $PickScope | Sort IPAddress } -ArgumentList $PickScope - $Res = Invoke-Command -Session $Global:Session { $Get_Reservation } - # - If ($Res) { - - Switch($DisplayOption) { - "OnScreen" { $Output.Text = $Res | Select IPAddress,ClientID,Name,Description | Ft -AutoSize | Out-String } - "GridView" { $Output.Text = $Res | Select IPAddress,ClientID,Name,Description | Out-GridView } - "CSV" { $Output.Text = "This Option is not yet Available!!!!!!!!!!" } - }#end Switch - - - }#end If - - Else { $Output.Text = "#### No Reservations Found for the Scope: $PickScope ####" } - - - - - - - }#end ReservationList - - - AddDHCPreservation { $PickScope = $ScopeSend - NA-CollectDHCPReservationInfo - - $Res_Name = $Global:SendDHCPreservationInfo[0] - $Res_MAC = $Global:SendDHCPreservationInfo[1] - $Res_IP = $Global:SendDHCPreservationInfo[2] - $Res_Description = $Global:SendDHCPreservationInfo[3] - - Invoke-Command -Session $Global:Session { Param($PickScope,$Res_Name,$Res_MAC,$Res_IP,$Res_Description) $ADD_Reservation = Add-DhcpServerv4Reservation -ScopeID $PickScope -IPAddress $Res_IP -ClientID $Res_MAC -Name $Res_Name -Description $Res_Description } -ArgumentList $PickScope,$Res_Name,$Res_MAC,$Res_IP,$Res_Description - - Write-Host "" - NA-Verify -VerifyCode VerifyDHCPreservation -DHCPscope $PickScope - - NA-ClearGlobalVariables - NA-RunAgain - } - - - DHCPscopes { NA-Get-CurrentIPv4Scopes - Invoke-Command -Session $Global:Session { Param($PickScope) $Get_Scope = Get-DhcpServerv4Scope -ScopeID $PickScope } - $Global:Scope = Invoke-Command -Session $Global:Session { $Get_Scope } - #Write-Host "Current Scope on DHCP Server:" - $Scope | select scopeid,subnetmask,name,state,startrange,endrange,leaseduration | ft -AutoSize - NA-ClearGlobalVariables - NA-RunAgain - } - - AvailableIPAddresses { $PickScope = $ScopeSend - Invoke-Command -Session $Global:Session { Param($PickScope) $Get_AvailableIPs = Get-DhcpServerV4FreeIPAddress -ScopeID $PickScope -NumAddress 254 } -ArgumentList $PickScope - $FreeIP = Invoke-Command -Session $Global:Session { $Get_AvailableIPs } - $FreeIPCount = $FreeIP.count - #P - - If ($FreeIP) { - Switch($DisplayOption) { - "OnScreen" { $Output.Text = $FreeIP | ft -AutoSize | Out-String } - "GridView" { $Output.Text = $FreeIP | Out-GridView } - "CSV" { $Output.Text = "This Option is not yet Available!!!!!!!!!!" } - }#end Switch - } - Else { $Output.Text = "#### No Available IP Addresses Found for the Scope: $PickScope ####" } - - } - - DhcpLease { NA-Get-CurrentIPv4Scopes - $PickScope = $Global:SendScope - Invoke-Command -Session $Global:Session { Param($PickScope) $Get_dhcpLease = Get-DhcpserverV4Lease -ScopeID $PickScope } -ArgumentList $PickScope - $DhcpLease = Invoke-Command -Session $Global:Session { $Get_dhcpLease } - $DhcpLease | Select IPAddress,ScopeID,ClientID,Hostname,AddressState, LeaseExpiryTime | Ft -Wrap - NA-ClearGlobalVariables - NA-RunAgain - } - DhcpScopeStats { Invoke-Command -Session $Global:Session { $Get_dhcpScopeStats = Get-DhcpServerV4ScopeStatistics } - $DhcpScopeStats = Invoke-Command -Session $Global:Session { $Get_dhcpScopeStats } - $DhcpScopeStats | select ScopeID,Free,InUse,@{n="PercentageInUse";e={[Math]::Round($_.PercentageInUse,2)}},Reserved,Pending,SuperScopeName | Ft -AutoSize - NA-ClearGlobalVariables - NA-RunAgain - } - DhcpServerStats { Invoke-Command -Session $Global:Session {$Get_DhcpServerStats = Get-DhcpServerV4Statistics } - $DhcpServerStats = Invoke-Command -Session $Global:Session { $Get_DhcpServerStats } - $DhcpServerStats | Fl - NA-ClearGlobalVariables - NA-RunAgain - } - - PingDHCPexclusion { Write-Host "This option is not yet available ....!!" -ForegroundColor Red -BackgroundColor White - #NA-Verify -VerifyCode VerifyDHCPreservation -DHCPscope '172.27.144.0' - NA-Menu - } - - Test { Invoke-Command -Session $Global:Session { $Name = $env:COMPUTERNAME } - $N = Invoke-Command -Session $Global:Session { $Name } - } - test2 { $Loc = Get-Location - Set-Location "H:\Documents\Scripts-Nabil\PowerShell\_Forms-Test" - .\temp-form.ps1 - Set-Location $Loc - NA-RunAgain} - - - }#end Switch - }#end Process - }#end Function - -################################################################################################################## - Function NA-Server-Connection ($SvrConn,$Server) { - Switch($SvrConn) { - 0 { Write-Debug "Closing Connection"; Get-PSSession | Remove-PSSession - Write-Host "Good Bye !" -ForegroundColor Cyan } - - 1 { $Output.text = "Creating Connection to Server: $Server" | Out-String; $Global:Session = New-PSSession -ComputerName $Server - Invoke-Command -Session $Global:Session { Import-Module dhcpserver } - - If (Get-Pssession) { - $Output.Text = "Successfully Connected to Server: $Server" - $labelDHCPServerStatus.Text = $Server - }#end If - - }#end 1 - - }#end Switch - }#end Function -################################################################################################################### - Function NA-ClearGlobalVariables { - $Global:DisplayType = "" - $Global:Session = "" - $Global:Scope = "" - $Global:VCenterConnectionStatus = "" - $Global:VC = "" - $VCuser = "" - $VCpwd = "" - - } -################################################################################################################### - - -#Call the form -Call-FirstForm4-tabs_psf | Out-Null diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-Calendar.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-Calendar.ps1 deleted file mode 100644 index e332957..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-Calendar.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - -$objForm = New-Object Windows.Forms.Form - -$objForm.Text = "Select a Date" -$objForm.Size = New-Object Drawing.Size @(490,250) -$objForm.StartPosition = "CenterScreen" - -$objForm.KeyPreview = $True - -$objForm.Add_KeyDown({ - if ($_.KeyCode -eq "Enter") - { - $script:dtmDate=$objCalendar.SelectionStart - $objForm.Close() - } - }) - -$objForm.Add_KeyDown({ - if ($_.KeyCode -eq "Escape") - { - $objForm.Close() - } - }) - -$objCalendar = New-Object System.Windows.Forms.MonthCalendar -$objCalendar.Text = "Start" -$objCalendar.ShowTodayCircle = $False -$objCalendar.MaxSelectionCount = 1 -$objForm.Controls.Add($objCalendar) - -$objForm.Topmost = $True - -$objForm.Add_Shown({$objForm.Activate()}) -[void] $objForm.ShowDialog() - -if ($dtmDate) - { - Write-Host "Date selected: $dtmDate" - } - -$objForm.Dispose() \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-1.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-1.ps1 deleted file mode 100644 index d116880..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-1.ps1 +++ /dev/null @@ -1,489 +0,0 @@ -############################# -# Developed by Tinniam V Ganesh -# Date 24 Apr 2012 -# Powershell GUI generated by Primal Forms CE from Sapien Technologies (http://www.sapien.com/) -######################################################################################################### -function Get-SysInfo ($strComputer) -{ - write-host “reached here” - $statusBar1.Text =”Working …” - if ($radiobutton1.checked -eq $True) - { - $wmi = Get-WmiObject Win32_ComputerSystem -Namespace “root\CIMV2" -ComputerName $strComputer|Export-csv -force “test.csv” - } - else - { - $wmi =Get-WmiObject Win32_ComputerSystem -Namespace “root\CIMV2" -ComputerName $strComputer|ConvertTo-Html|out-file -append “test.html” - } - - $statusBar1.Text =”Done.” -} - -#*============================================================================= -Function Get-BIOSInfo ($strComputer) -{ - $statusBar1.Text =”Working …” - if ($radiobutton1.checked -eq $True) - { - $wmi = Get-WmiObject Win32_BIOS -Namespace “root\CIMV2" -computername $strComputer|Export-csv -force “test.csv” - } - else - { - $wmi = Get-WmiObject Win32_BIOS -Namespace “root\CIMV2" -computername $strComputer|ConvertTo-Html|out-file -append “test.html” - } - - $statusBar1.Text =”Done.” - } - -Function Get-OSInfo { - $statusBar1.Text =”Working …” - if ($radiobutton1.checked -eq $True) - { - $wmi = Get-WmiObject Win32_OperatingSystem -Namespace “root\CIMV2" -Computername $strComputer|Export-csv -force “test.csv” - } - else - { - $wmi = Get-WmiObject Win32_OperatingSystem -Namespace “root\CIMV2" -Computername $strComputer|out-file -append “test.html” - } - - $statusBar1.Text =”Done.” -} - -Function Get-CPUInfo { - $statusBar1.Text =”Working …” - if ($radiobutton1.checked -eq $True) - { - $wmi = Get-WmiObject Win32_Processor -Namespace “root\CIMV2" -Computername $strComputer|Export-csv -force “test.csv” - } - else - { - $wmi = Get-WmiObject Win32_Processor -Namespace “root\CIMV2" -Computername $strComputer|out-file -append “test.html” - } - - $statusBar1.Text =”Done.” -} - -Function Get-DiskInfo { - - $statusBar1.Text =”Working …” - if ($radiobutton1.checked -eq $True) - { - $wmi = Get-WmiObject Win32_DiskDrive -Namespace “root\CIMV2" -ComputerName $strComputer|Export-csv -force “test.csv” - } - else - { - $wmi = Get-WmiObject Win32_DiskDrive -Namespace “root\CIMV2" -ComputerName $strComputer|out-file -append “test.html” - } - - $statusBar1.Text =”Done.” -} - -Function Get-NetworkInfo { - - $statusBar1.Text =”Working …” - if ($radiobutton1.checked -eq $True) - { - $wmi = Get-WmiObject Win32_NetworkAdapterConfiguration -Namespace “root\CIMV2" -ComputerName $strComputer | where{$_.IPEnabled -eq “True”}|Export-csv -noclobber “test.csv” - } - else - { - $wmi = Get-WmiObject Win32_NetworkAdapterConfiguration -Namespace “root\CIMV2" -ComputerName $strComputer | where{$_.IPEnabled -eq “True”}|out-file -append “test.html” - } - - $statusBar1.Text =”Done.” -} - -#Generated Form Function -function GenerateForm { -######################################################################## -# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0 -# Generated On: 4/24/2012 2:46 PM -# Generated By: tvganesh -######################################################################## - -#region Import the Assemblies -[reflection.assembly]::loadwithpartialname(“System.Windows.Forms”) | Out-Null -[reflection.assembly]::loadwithpartialname(“System.Drawing”) | Out-Null -#endregion - -#region Generated Form Objects -$form1 = New-Object System.Windows.Forms.Form -$statusBar1 = New-Object System.Windows.Forms.StatusBar -$label2 = New-Object System.Windows.Forms.Label -$button3 = New-Object System.Windows.Forms.Button -$button2 = New-Object System.Windows.Forms.Button -$tabControl1 = New-Object System.Windows.Forms.TabControl -$tabControl = New-Object System.Windows.Forms.TabPage -$groupBox1 = New-Object System.Windows.Forms.GroupBox -$radioButton2 = New-Object System.Windows.Forms.RadioButton -$radioButton1 = New-Object System.Windows.Forms.RadioButton -$label1 = New-Object System.Windows.Forms.Label -$textBox1 = New-Object System.Windows.Forms.TextBox -$comboBox1 = New-Object System.Windows.Forms.ComboBox -$Database = New-Object System.Windows.Forms.TabPage -$tabPage1 = New-Object System.Windows.Forms.TabPage -$tabPage2 = New-Object System.Windows.Forms.TabPage -$button1 = New-Object System.Windows.Forms.Button -$fontDialog1 = New-Object System.Windows.Forms.FontDialog -$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState -#endregion Generated Form Objects - -#———————————————- -#Generated Event Script Blocks -#———————————————- -#Provide Custom Code for events specified in PrimalForms. -$button3_OnClick= -{ - $form1.Close() - -} - -$button2_OnClick= -{ - $textBox1.text=”" - # Set to the first item - $comboBox1.SelectedIndex = 0; - -} - -$handler_button1_Click= -{ - $x = $textbox1.text - $vals = $x.split(“,”) - forEach($strComputer in $vals) -{ -switch($combobox1.selectedItem) - { - “SysInfo” {Get-SysInfo ($strComputer)} - “BiosInfo” {Get-BiosInfo($strComputer)} - “CPUInfo” {Get-cpuInfo($strComputer)} - “DiskInfo” {Get-diskInfo($strComputer)} - “OSInfo” {Get-OSInfo($strCOmputer)} - “NetworkInfo” {Get-NetworkInfo($strComputer)} - } -} -} - -$OnLoadForm_StateCorrection= -{#Correct the initial state of the form to prevent the .Net maximized form issue -$form1.WindowState = $InitialFormWindowState -} - -#———————————————- -#region Generated Form Code -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 444 -$System_Drawing_Size.Width = 704 -$form1.ClientSize = $System_Drawing_Size -$form1.DataBindings.DefaultDataSourceUpdateMode = 0 -$form1.Name = “form1" -$form1.Text = “Primal Form” - -$statusBar1.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 0 -$System_Drawing_Point.Y = 422 -$statusBar1.Location = $System_Drawing_Point -$statusBar1.Name = “statusBar1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 22 -$System_Drawing_Size.Width = 704 -$statusBar1.Size = $System_Drawing_Size -$statusBar1.TabIndex = 8 -$statusBar1.Text = “Ready” - -$form1.Controls.Add($statusBar1) - -$label2.DataBindings.DefaultDataSourceUpdateMode = 0 -$label2.Font = New-Object System.Drawing.Font(“Microsoft Sans Serif”,14.25,1,3,1) - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 205 -$System_Drawing_Point.Y = 22 -$label2.Location = $System_Drawing_Point -$label2.Name = “label2" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 34 -$System_Drawing_Size.Width = 341 -$label2.Size = $System_Drawing_Size -$label2.TabIndex = 7 -$label2.Text = “Windows Resource Management” - -$form1.Controls.Add($label2) -$button3.DataBindings.DefaultDataSourceUpdateMode = 0 - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 439 -$System_Drawing_Point.Y = 343 -$button3.Location = $System_Drawing_Point -$button3.Name = “button3" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 23 -$System_Drawing_Size.Width = 75 -$button3.Size = $System_Drawing_Size -$button3.TabIndex = 6 -$button3.Text = “Exit” -$button3.UseVisualStyleBackColor = $True -$button3.add_Click($button3_OnClick) - -$form1.Controls.Add($button3) -$button2.DataBindings.DefaultDataSourceUpdateMode = 0 - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 330 -$System_Drawing_Point.Y = 343 -$button2.Location = $System_Drawing_Point -$button2.Name = “button2" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 23 -$System_Drawing_Size.Width = 75 -$button2.Size = $System_Drawing_Size -$button2.TabIndex = 5 -$button2.Text = “Cancel” -$button2.UseVisualStyleBackColor = $True -$button2.add_Click($button2_OnClick) - -$form1.Controls.Add($button2) - -$tabControl1.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 136 -$System_Drawing_Point.Y = 83 -$tabControl1.Location = $System_Drawing_Point -$tabControl1.Name = “tabControl1" -$tabControl1.SelectedIndex = 0 -$tabControl1.ShowToolTips = $True -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 231 -$System_Drawing_Size.Width = 453 -$tabControl1.Size = $System_Drawing_Size -$tabControl1.TabIndex = 4 - -$form1.Controls.Add($tabControl1) -$tabControl.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 4 -$System_Drawing_Point.Y = 22 -$tabControl.Location = $System_Drawing_Point -$tabControl.Name = “tabControl” -$System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding -$System_Windows_Forms_Padding.All = 3 -$System_Windows_Forms_Padding.Bottom = 3 -$System_Windows_Forms_Padding.Left = 3 -$System_Windows_Forms_Padding.Right = 3 -$System_Windows_Forms_Padding.Top = 3 -$tabControl.Padding = $System_Windows_Forms_Padding -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 205 -$System_Drawing_Size.Width = 445 -$tabControl.Size = $System_Drawing_Size -$tabControl.TabIndex = 0 -$tabControl.Text = “Basic Commands” -$tabControl.UseVisualStyleBackColor = $True - -$tabControl1.Controls.Add($tabControl) - -$groupBox1.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 271 -$System_Drawing_Point.Y = 123 -$groupBox1.Location = $System_Drawing_Point -$groupBox1.Name = “groupBox1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 49 -$System_Drawing_Size.Width = 124 -$groupBox1.Size = $System_Drawing_Size -$groupBox1.TabIndex = 3 -$groupBox1.TabStop = $False -$groupBox1.Text = “Save As” - -$tabControl.Controls.Add($groupBox1) - -$radioButton2.DataBindings.DefaultDataSourceUpdateMode = 0 - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 48 -$System_Drawing_Point.Y = 19 -$radioButton2.Location = $System_Drawing_Point -$radioButton2.Name = “radioButton2" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 24 -$System_Drawing_Size.Width = 104 -$radioButton2.Size = $System_Drawing_Size -$radioButton2.TabIndex = 1 -$radioButton2.TabStop = $True -$radioButton2.Text = “HTML” -$radioButton2.UseVisualStyleBackColor = $True - -$groupBox1.Controls.Add($radioButton2) -$radioButton1.DataBindings.DefaultDataSourceUpdateMode = 0 - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 6 -$System_Drawing_Point.Y = 19 -$radioButton1.Location = $System_Drawing_Point -$radioButton1.Name = “radioButton1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 24 -$System_Drawing_Size.Width = 104 -$radioButton1.Size = $System_Drawing_Size -$radioButton1.TabIndex = 0 -$radioButton1.TabStop = $True -$radioButton1.Text = “CSV” -$radioButton1.UseVisualStyleBackColor = $True -$radioButton1.checked =$True - -$groupBox1.Controls.Add($radioButton1) -$label1.DataBindings.DefaultDataSourceUpdateMode = 0 - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 6 -$System_Drawing_Point.Y = 26 -$label1.Location = $System_Drawing_Point -$label1.Name = “label1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 20 -$System_Drawing_Size.Width = 192 -$label1.Size = $System_Drawing_Size -$label1.TabIndex = 2 -$label1.Text = “Enter comma separated server list” - -$tabControl.Controls.Add($label1) - -$textBox1.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 220 -$System_Drawing_Point.Y = 26 -$textBox1.Location = $System_Drawing_Point -$textBox1.Name = “textBox1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 20 -$System_Drawing_Size.Width = 203 -$textBox1.Size = $System_Drawing_Size -$textBox1.TabIndex = 1 - -$tabControl.Controls.Add($textBox1) - -$comboBox1.DataBindings.DefaultDataSourceUpdateMode = 0 -$comboBox1.FormattingEnabled = $True -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 220 -$System_Drawing_Point.Y = 79 -$comboBox1.Location = $System_Drawing_Point -$comboBox1.Name = “comboBox1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 21 -$System_Drawing_Size.Width = 200 -$comboBox1.Size = $System_Drawing_Size -$comboBox1.TabIndex = 0 - -$commands = @(“SysInfo”,”BIOSInfo”,”OSInfo”,”CPUInfo”,”DiskInfo”,”NetworkInfo”) -ForEach ($command in $commands){ -$comboBox1.items.add($command) -} -$tabControl.Controls.Add($comboBox1) - -# Set to the first item -$comboBox1.SelectedIndex = 0; -$Database.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 4 -$System_Drawing_Point.Y = 22 -$Database.Location = $System_Drawing_Point -$Database.Name = “Database” -$System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding -$System_Windows_Forms_Padding.All = 3 -$System_Windows_Forms_Padding.Bottom = 3 -$System_Windows_Forms_Padding.Left = 3 -$System_Windows_Forms_Padding.Right = 3 -$System_Windows_Forms_Padding.Top = 3 -$Database.Padding = $System_Windows_Forms_Padding -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 205 -$System_Drawing_Size.Width = 445 -$Database.Size = $System_Drawing_Size -$Database.TabIndex = 1 -$Database.Text = “Database” -$Database.UseVisualStyleBackColor = $True - -$tabControl1.Controls.Add($Database) - -$tabPage1.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 4 -$System_Drawing_Point.Y = 22 -$tabPage1.Location = $System_Drawing_Point -$tabPage1.Name = “tabPage1" -$System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding -$System_Windows_Forms_Padding.All = 3 -$System_Windows_Forms_Padding.Bottom = 3 -$System_Windows_Forms_Padding.Left = 3 -$System_Windows_Forms_Padding.Right = 3 -$System_Windows_Forms_Padding.Top = 3 -$tabPage1.Padding = $System_Windows_Forms_Padding -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 205 -$System_Drawing_Size.Width = 445 -$tabPage1.Size = $System_Drawing_Size -$tabPage1.TabIndex = 2 -$tabPage1.Text = “Active Directory” -$tabPage1.UseVisualStyleBackColor = $True - -$tabControl1.Controls.Add($tabPage1) - -$tabPage2.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 4 -$System_Drawing_Point.Y = 22 -$tabPage2.Location = $System_Drawing_Point -$tabPage2.Name = “tabPage2" -$System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding -$System_Windows_Forms_Padding.All = 3 -$System_Windows_Forms_Padding.Bottom = 3 -$System_Windows_Forms_Padding.Left = 3 -$System_Windows_Forms_Padding.Right = 3 -$System_Windows_Forms_Padding.Top = 3 -$tabPage2.Padding = $System_Windows_Forms_Padding -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 205 -$System_Drawing_Size.Width = 445 -$tabPage2.Size = $System_Drawing_Size -$tabPage2.TabIndex = 3 -$tabPage2.Text = “Backup & Restore” -$tabPage2.UseVisualStyleBackColor = $True - -$tabControl1.Controls.Add($tabPage2) - -$button1.DataBindings.DefaultDataSourceUpdateMode = 0 - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 226 -$System_Drawing_Point.Y = 343 -$button1.Location = $System_Drawing_Point -$button1.Name = “button1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 23 -$System_Drawing_Size.Width = 75 -$button1.Size = $System_Drawing_Size -$button1.TabIndex = 0 -$button1.Text = “Submit” -$button1.UseVisualStyleBackColor = $True -$button1.add_Click($handler_button1_Click) - -$form1.Controls.Add($button1) - -$fontDialog1.ShowHelp = $True - -#endregion Generated Form Code - -#Save the initial state of the form -$InitialFormWindowState = $form1.WindowState -#Init the OnLoad event to correct the initial state of the form -$form1.add_Load($OnLoadForm_StateCorrection) -#Show the Form -$form1.ShowDialog()| Out-Null - -} #End Function - -#Call the Function -GenerateForm \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-2.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-2.ps1 deleted file mode 100644 index c3fa090..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-2.ps1 +++ /dev/null @@ -1,144 +0,0 @@ -# Show message box popup. -Add-Type -AssemblyName System.Windows.Forms -$result = [System.Windows.Forms.MessageBox]::Show("My message", "Window Title", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::None) - -# Show input box popup. -Add-Type -AssemblyName Microsoft.VisualBasic -$inputText = [Microsoft.VisualBasic.Interaction]::InputBox("Enter some value:", "Window Title", "Default value") - -# Show an Open File Dialog and return the file selected by the user. -function Read-OpenFileDialog([string]$InitialDirectory, [switch]$AllowMultiSelect) -{ - Add-Type -AssemblyName System.Windows.Forms - $openFileDialog = New-Object System.Windows.Forms.OpenFileDialog - $openFileDialog.initialDirectory = $InitialDirectory - $openFileDialog.filter = "All files (*.*)| *.*" - if ($AllowMultiSelect) { $openFileDialog.MultiSelect = $true } - $openFileDialog.ShowDialog() > $null - if ($allowMultiSelect) { return $openFileDialog.Filenames } else { return $openFileDialog.Filename } -} - - -# Show an Open Folder Dialog and return the directory selected by the user. -function Read-FolderBrowserDialog([string]$InitialDirectory) -{ - Add-Type -AssemblyName System.Windows.Forms - $openFolderDialog = New-Object System.Windows.Forms.FolderBrowserDialog - $openFolderDialog.ShowNewFolderButton = $true - $openFolderDialog.RootFolder = $InitialDirectory - $openFolderDialog.ShowDialog() - return $openFolderDialog.SelectedPath -} - -# Prompt for multi-line user input: -function Read-MultiLineInputDialog([string]$Message, [string]$WindowTitle, [string]$DefaultText) -{ -<# - .SYNOPSIS - Prompts the user with a multi-line input box and returns the text they enter, or null if they cancelled the prompt. - - .DESCRIPTION - Prompts the user with a multi-line input box and returns the text they enter, or null if they cancelled the prompt. - - .PARAMETER Message - The message to display to the user explaining what text we are asking them to enter. - - .PARAMETER WindowTitle - The text to display on the prompt window's title. - - .PARAMETER DefaultText - The default text to show in the input box. - - .EXAMPLE - $userText = Read-MultiLineInputDialog "Input some text please:" "Get User's Input" - - Shows how to create a simple prompt to get mutli-line input from a user. - - .EXAMPLE - # Setup the default multi-line address to fill the input box with. - $defaultAddress = @' - John Doe - 123 St. - Some Town, SK, Canada - A1B 2C3 - '@ - - $address = Read-MultiLineInputDialog "Please enter your full address, including name, street, city, and postal code:" "Get User's Address" $defaultAddress - if ($address -eq $null) - { - Write-Error "You pressed the Cancel button on the multi-line input box." - } - - Prompts the user for their address and stores it in a variable, pre-filling the input box with a default multi-line address. - If the user pressed the Cancel button an error is written to the console. - - .EXAMPLE - $inputText = Read-MultiLineInputDialog -Message "If you have a really long message you can break it apart`nover two lines with the powershell newline character:" -WindowTitle "Window Title" -DefaultText "Default text for the input box." - - Shows how to break the second parameter (Message) up onto two lines using the powershell newline character (`n). - If you break the message up into more than two lines the extra lines will be hidden behind or show ontop of the TextBox. - - .NOTES - Name: Show-MultiLineInputDialog - Author: Daniel Schroeder (originally based on the code shown at http://technet.microsoft.com/en-us/library/ff730941.aspx) - Version: 1.0 -#> - Add-Type -AssemblyName System.Drawing - Add-Type -AssemblyName System.Windows.Forms - - # Create the Label. - $label = New-Object System.Windows.Forms.Label - $label.Location = New-Object System.Drawing.Size(10,10) - $label.Size = New-Object System.Drawing.Size(280,20) - $label.AutoSize = $true - $label.Text = $Message - - # Create the TextBox used to capture the user's text. - $textBox = New-Object System.Windows.Forms.TextBox - $textBox.Location = New-Object System.Drawing.Size(10,40) - $textBox.Size = New-Object System.Drawing.Size(575,200) - $textBox.AcceptsReturn = $true - $textBox.AcceptsTab = $false - $textBox.Multiline = $true - $textBox.ScrollBars = 'Both' - $textBox.Text = $DefaultText - - # Create the OK button. - $okButton = New-Object System.Windows.Forms.Button - $okButton.Location = New-Object System.Drawing.Size(510,250) - $okButton.Size = New-Object System.Drawing.Size(75,25) - $okButton.Text = "OK" - $okButton.Add_Click({ $form.Tag = $textBox.Text; $form.Close() }) - - # Create the Cancel button. - $cancelButton = New-Object System.Windows.Forms.Button - $cancelButton.Location = New-Object System.Drawing.Size(415,250) - $cancelButton.Size = New-Object System.Drawing.Size(75,25) - $cancelButton.Text = "Cancel" - $cancelButton.Add_Click({ $form.Tag = $null; $form.Close() }) - - # Create the form. - $form = New-Object System.Windows.Forms.Form - $form.Text = $WindowTitle - $form.Size = New-Object System.Drawing.Size(600,310) - $form.FormBorderStyle = 'FixedSingle' - $form.StartPosition = "CenterScreen" - $form.AutoSizeMode = 'GrowAndShrink' - $form.Topmost = $True - $form.AcceptButton = $okButton - $form.CancelButton = $cancelButton - $form.ShowInTaskbar = $true - - # Add all of the controls to the form. - $form.Controls.Add($label) - $form.Controls.Add($textBox) - $form.Controls.Add($okButton) - $form.Controls.Add($cancelButton) - - # Initialize and show the form. - $form.Add_Shown({$form.Activate()}) - $form.ShowDialog() > $null # Trash the text of the button that was clicked. - - # Return the text that the user entered. - return $form.Tag -} \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-3.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-3.ps1 deleted file mode 100644 index 0880409..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-Example-3.ps1 +++ /dev/null @@ -1,114 +0,0 @@ -$ErrorActionPreference = "SilentlyContinue" -Import-Module ActiveDirectory -#Generated Form Function -function GenerateForm { -######################################################################## -# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0 -# Generated On: 8/20/2013 12:23 AM -# Generated By: Subsun -######################################################################## - -#region Import the Assemblies -[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null -[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null -#endregion - -#region Generated Form Objects -$form1 = New-Object System.Windows.Forms.Form -$richTextBox1 = New-Object System.Windows.Forms.RichTextBox -$Find = New-Object System.Windows.Forms.Button -$textBox1 = New-Object System.Windows.Forms.TextBox -$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState -#endregion Generated Form Objects - -#---------------------------------------------- -#Generated Event Script Blocks -#---------------------------------------------- -#Provide Custom Code for events specified in PrimalForms. -$handler_Find_Click= -{ -#TODO: Place custom script here -$User = Get-Aduser $textBox1.Text -Properties Name,homeDirectory,SamAccountName,CanonicalName | Select Name,homeDirectory,SamAccountName,CanonicalName -If ($User) { -$richTextBox1.Text = $User | FL Name,homeDirectory,SamAccountName,CanonicalName | Out-String -}Else { -$richTextBox1.Text = "Error in finding $($textBox1.Text)" -} -} - -$OnLoadForm_StateCorrection= -{#Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState -} - -#---------------------------------------------- -#region Generated Form Code -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 212 -$System_Drawing_Size.Width = 477 -$form1.ClientSize = $System_Drawing_Size -$form1.DataBindings.DefaultDataSourceUpdateMode = 0 -$form1.Name = "form1" -$form1.Text = "ADFind" - -$richTextBox1.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 12 -$System_Drawing_Point.Y = 38 -$richTextBox1.Location = $System_Drawing_Point -$richTextBox1.Name = "richTextBox1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 162 -$System_Drawing_Size.Width = 450 -$richTextBox1.Size = $System_Drawing_Size -$richTextBox1.TabIndex = 2 -$richTextBox1.font = "Courier New" -$richTextBox1.Text = "" - -$form1.Controls.Add($richTextBox1) - - -$Find.DataBindings.DefaultDataSourceUpdateMode = 0 - -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 353 -$System_Drawing_Point.Y = 8 -$Find.Location = $System_Drawing_Point -$Find.Name = "Find" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 23 -$System_Drawing_Size.Width = 109 -$Find.Size = $System_Drawing_Size -$Find.TabIndex = 1 -$Find.Text = "Find" -$Find.UseVisualStyleBackColor = $True -$Find.add_Click($handler_Find_Click) - -$form1.Controls.Add($Find) - -$textBox1.DataBindings.DefaultDataSourceUpdateMode = 0 -$System_Drawing_Point = New-Object System.Drawing.Point -$System_Drawing_Point.X = 12 -$System_Drawing_Point.Y = 12 -$textBox1.Location = $System_Drawing_Point -$textBox1.Name = "textBox1" -$System_Drawing_Size = New-Object System.Drawing.Size -$System_Drawing_Size.Height = 20 -$System_Drawing_Size.Width = 320 -$textBox1.Size = $System_Drawing_Size -$textBox1.TabIndex = 0 -$form1.Controls.Add($textBox1) - -#endregion Generated Form Code - -#Save the initial state of the form -$InitialFormWindowState = $form1.WindowState -#Init the OnLoad event to correct the initial state of the form -$form1.add_Load($OnLoadForm_StateCorrection) -#Show the Form -$form1.ShowDialog()| Out-Null - -} #End Function - -#Call the Function -GenerateForm diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-1.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-1.ps1 deleted file mode 100644 index 1176695..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-1.ps1 +++ /dev/null @@ -1,50 +0,0 @@ -Add-Type -AssemblyName System.Windows.Forms - -$Form = New-Object system.Windows.Forms.Form -$Form.Text = "Sample Form" -$Form.AutoScroll = $True -$Form.width = 500 -$Form.height = 300 -$Form.AutoSize = $True -#$Form.AutoSizeMode = "GrowAndShrink" - # or GrowOnly - -$Form.MinimizeBox = $False -$Form.MaximizeBox = $False -$Form.WindowState = "Normal" - # Maximized, Minimized, Normal - -$Form.SizeGripStyle = "Hide" - # Auto, Hide, Show - -$Form.ShowInTaskbar = $False -#$Form.Opacity = 0.7 - # 1.0 is fully opaque; 0.0 is invisible - -$Form.BackColor = "Lime" - # color names are static properties of System.Drawing.Color - # you can also use ARGB values, such as "#FFFFEBCD" - -$Form.StartPosition = "CenterScreen" - # CenterScreen, Manual, WindowsDefaultLocation, WindowsDefaultBounds, CenterParent - -$Form.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($PSHome + "\powershell.exe") -#$Font = New-Object System.Drawing.Font("Times New Roman",24,[System.Drawing.FontStyle]::Italic) - # Font styles are: Regular, Bold, Italic, Underline, Strikeout - -#$Form.Font = $Font -$Label = New-Object System.Windows.Forms.Label -$Label.Text = "This form is very simple." -$Label.AutoSize = $True - -$Form.Controls.Add($Label) - -$OKButton = New-Object System.Windows.Forms.Button -$OKButton.Location = New-Object System.Drawing.Size(75,120) -$OKButton.Size = New-Object System.Drawing.Size(75,23) -$OKButton.Text = "Get Service" -$OKButton.Add_Click({$Form.Close()}) -$Form.Controls.Add($OKButton) - - -$Form.ShowDialog() \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-button-2.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-button-2.ps1 deleted file mode 100644 index cb71cf4..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-button-2.ps1 +++ /dev/null @@ -1,91 +0,0 @@ -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - -$Form = New-Object System.Windows.Forms.Form -$Form.Size = New-Object System.Drawing.Size(600,400) - -############################################## Start functions - -function pingInfo { -$wks=$InputBox.text; -$pingResult=Test-Connection -ComputerName $wks -Count 1 | out-string; -$outputBox.text=$pingResult - } #end pingInfo - -############################################## end functions -Function NA-GetHardDriveInfo { - $Computer = $InputBox.Text - $HDInfo = Gwmi Win32_logicaldisk -ComputerName $Computer -Filter "Drivetype = '3'" | ft -AutoSize | Out-String - $outputBox.Text = $HDInfo - - -} - -############################################## Start text fields -Function NA-GetProcess { - $Computer = $InputBox.Text - - $Proc = Get-Process -ComputerName $Computer | % { - - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Handles -Value $_.handles - $Obj | Add-Member -MemberType NoteProperty -Name NPM -Value $_.npm - $Obj | Add-Member -MemberType NoteProperty -Name PM -Value $_.pm - $Obj | Add-Member -MemberType NoteProperty -Name WS -Value $_.WS - $Obj | Add-Member -MemberType NoteProperty -Name VM -Value $_.vm - $Obj | Add-Member -MemberType NoteProperty -Name CPU -Value $_.cpu - $Obj | Add-Member -MemberType NoteProperty -Name ID -Value $_.ID - $Obj | Add-Member -MemberType NoteProperty -Name ProcessName -Value $_.ProcessName - $Obj - - } - $outputBox.Text = $Proc -} -############################################## end functions - -$InputBox = New-Object System.Windows.Forms.TextBox -$InputBox.Location = New-Object System.Drawing.Size(20,50) -$InputBox.Size = New-Object System.Drawing.Size(150,20) -$Form.Controls.Add($InputBox) - -$outputBox = New-Object System.Windows.Forms.TextBox -$outputBox.Location = New-Object System.Drawing.Size(10,150) -$outputBox.Size = New-Object System.Drawing.Size(565,200) -$outputBox.MultiLine = $True -$outputBox.ScrollBars = "Vertical" -$Form.Controls.Add($outputBox) - -############################################## end text fields - -############################################## Start buttons - -$Button = New-Object System.Windows.Forms.Button -$Button.Location = New-Object System.Drawing.Size(400,30) -$Button.Size = New-Object System.Drawing.Size(80,20) -$Button.Text = "Ping" -$Button.Add_Click({pingInfo}) -$Form.Controls.Add($Button) - -############################################## end buttons - - -$Button_HDrive = New-Object System.Windows.Forms.Button -$Button_HDrive.Location = New-Object System.Drawing.Size(400,50) -$Button_HDrive.Size = New-Object System.Drawing.Size(80,20) -$Button_HDrive.Text = "Hard Drive" -$Button_HDrive.Add_Click({NA-GetHardDriveInfo}) -$Form.Controls.Add($Button_HDrive) - -############################################## end button_HDrive - -$Button_Proc = New-Object System.Windows.Forms.Button -$Button_Proc.Location = New-Object System.Drawing.Size(400,70) -$Button_Proc.Size = New-Object System.Drawing.Size(80,20) -$Button_Proc.Text = "Processes" -$Button_Proc.Add_Click({NA-GetProcess}) -$Form.Controls.Add($Button_Proc) - - - -$Form.Add_Shown({$Form.Activate()}) -[void] $Form.ShowDialog() \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-button.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-button.ps1 deleted file mode 100644 index e8f226a..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-Test-button.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") -[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - -$Form = New-Object System.Windows.Forms.Form -$Form.Size = New-Object System.Drawing.Size(600,400) - -############################################## Start functions - -function pingInfo { -$wks=$InputBox.text; -$pingResult=ping $wks | fl | out-string; -$outputBox.text=$pingResult - } #end pingInfo - -############################################## end functions - -############################################## Start text fields - -$InputBox = New-Object System.Windows.Forms.TextBox -$InputBox.Location = New-Object System.Drawing.Size(20,50) -$InputBox.Size = New-Object System.Drawing.Size(150,20) -$Form.Controls.Add($InputBox) - -$outputBox = New-Object System.Windows.Forms.TextBox -$outputBox.Location = New-Object System.Drawing.Size(10,150) -$outputBox.Size = New-Object System.Drawing.Size(565,200) -$outputBox.MultiLine = $True -$outputBox.ScrollBars = "Vertical" -$Form.Controls.Add($outputBox) - -############################################## end text fields - -############################################## Start buttons - -$Button = New-Object System.Windows.Forms.Button -$Button.Location = New-Object System.Drawing.Size(400,30) -$Button.Size = New-Object System.Drawing.Size(110,80) -$Button.Text = "Ping" -$Button.Add_Click({pingInfo}) -$Form.Controls.Add($Button) - -############################################## end buttons - -$Form.Add_Shown({$Form.Activate()}) -[void] $Form.ShowDialog() \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/Form-Examples/Form-WebBrowser.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/Form-WebBrowser.ps1 deleted file mode 100644 index 0e77d71..0000000 --- a/dump/SCCM-Tool/Forms/Form-Examples/Form-WebBrowser.ps1 +++ /dev/null @@ -1,165 +0,0 @@ -#======================================================================== -# Code Generated By: SAPIEN Technologies, Inc., PowerShell Studio 2012 v3.1.13 -# Generated On: 12/18/2012 2:15 PM -# Generated By: James Vierra -# Organization: Designed Systems & Services -#======================================================================== -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- -function OnApplicationLoad { - #Note: This function is not called in Projects - #Note: This function runs before the form is created - #Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path - #Note: To get the console output in the Packager (Windows Mode) use: $ConsoleOutput (Type: System.Collections.ArrayList) - #Important: Form controls cannot be accessed in this function - #TODO: Add snapins and custom code to validate the application load - - return $true #return true for success or false for failure -} -function OnApplicationExit { - #Note: This function is not called in Projects - #Note: This function runs after the form is closed - #TODO: Add custom code to clean up and unload snapins when the application exits - - $script:ExitCode = 0 #Set the exit code for the Packager -} -#endregion Application Functions -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Call-Demo-WebBrowserCtl_pff { - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms") - [void][reflection.assembly]::Load("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") - [void][reflection.assembly]::Load("System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") - [void][reflection.assembly]::Load("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") - [void][reflection.assembly]::Load("System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") - [void][reflection.assembly]::Load("System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") - [void][reflection.assembly]::Load("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") - #endregion Import Assemblies - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $buttonGetElement = New-Object 'System.Windows.Forms.Button' - $webbrowser1 = New-Object 'System.Windows.Forms.WebBrowser' - $buttonOK = New-Object 'System.Windows.Forms.Button' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - #endregion Generated Form Objects - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - - - - - - - $FormEvent_Load={ - #TODO: Initialize Form Controls here - $webbrowser1.navigate("http://www.google.com") - } - - $buttonGetElement_Click={ - #TODO: Place custom script here - $el=$webbrowser1.Document.GetElementById('gstyle') - [System.Windows.Forms.MessageBox]::Show($el.InnerHtml) - - } - - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $buttonGetElement.remove_Click($buttonGetElement_Click) - $form1.remove_Load($FormEvent_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - } - catch [Exception] - { } - } - #endregion Generated Events - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - $form1.Controls.Add($buttonGetElement) - $form1.Controls.Add($webbrowser1) - $form1.Controls.Add($buttonOK) - $form1.AcceptButton = $buttonOK - $form1.ClientSize = '520, 475' - $form1.FormBorderStyle = 'FixedDialog' - $form1.MaximizeBox = $False - $form1.MinimizeBox = $False - $form1.Name = "form1" - $form1.StartPosition = 'CenterScreen' - $form1.Text = "Form" - $form1.add_Load($FormEvent_Load) - # - # buttonGetElement - # - $buttonGetElement.Location = '50, 438' - $buttonGetElement.Name = "buttonGetElement" - $buttonGetElement.Size = '84, 24' - $buttonGetElement.TabIndex = 2 - $buttonGetElement.Text = "Get Element" - $buttonGetElement.UseVisualStyleBackColor = $True - $buttonGetElement.add_Click($buttonGetElement_Click) - # - # webbrowser1 - # - $webbrowser1.Location = '39, 127' - $webbrowser1.MinimumSize = '20, 20' - $webbrowser1.Name = "webbrowser1" - $webbrowser1.Size = '569, 385' - $webbrowser1.TabIndex = 1 - # - # buttonOK - # - $buttonOK.Anchor = 'Bottom, Right' - $buttonOK.DialogResult = 'OK' - $buttonOK.Location = '433, 440' - $buttonOK.Name = "buttonOK" - $buttonOK.Size = '75, 23' - $buttonOK.TabIndex = 0 - $buttonOK.Text = "OK" - $buttonOK.UseVisualStyleBackColor = $True - #endregion Generated Form Code - #---------------------------------------------- - #Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() -} #End Function -#Call OnApplicationLoad to initialize -if((OnApplicationLoad) -eq $true) -{ - #Call the form - Call-Demo-WebBrowserCtl_pff | Out-Null - #Perform cleanup - OnApplicationExit -} \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/Form-Examples/ListView.ps1 b/dump/SCCM-Tool/Forms/Form-Examples/ListView.ps1 deleted file mode 100644 index 08f98e4..0000000 Binary files a/dump/SCCM-Tool/Forms/Form-Examples/ListView.ps1 and /dev/null differ diff --git a/dump/SCCM-Tool/Forms/Services-Tool-18.ps1 b/dump/SCCM-Tool/Forms/Services-Tool-18.ps1 deleted file mode 100644 index 82949d0..0000000 --- a/dump/SCCM-Tool/Forms/Services-Tool-18.ps1 +++ /dev/null @@ -1,1041 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: cfd5eaf9-beed-4b19-b790-f40186f5782a -# Source File: test-tools.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -Gw8AAB+LCAAAAAAABADVl19v2jAUxd8n7TtEeWZAApQyhUglbaVp7VqNrtsbcpxL69WxkeO0ZJ9+ -dgKUQWicliJNSCh/jnOP/Ts3VrzvgPkjiOwUSWSpg4RwNrTdpmP7Hz9YlnclyB1hiJ4TCt9QDL6E -RH6SnNOkOUumXmtLUAwLfwOWlsxmMLTHWSIhbv4kLOJPSfOci7j4b1hltxrW7cJHt9nWv4YVpFSm -AoYMUikQbVjXaUgJ/grZDX8ANgz7fdTDvSNn0OlC+3hgW0xZGdpT9TzHtvA9oZFQOjvgTArlvZid -Mnot+AyEzBYDTlLJxxhROCUxMG1CSY8altPxWktp1dBLHoHtn6tKlWMCSoDJMfmjBvSdbsPqOm7l -IL3Ktp9PrVJ7A3OpvYh4W3r2qGovdBccRYtnTvSx18rvLqXVOC9QCPTdeY5BqIy+BHQHl3yFb0QK -W8uwPeCCYySVXdt3XEV+G8guJIU7A3lhp+uU5qoEIgq/sAjmKokm6hx54eVzmX6duwogfliqJ/nZ -BvpWwd48Cbr+iM/fPQtXqZylsl4WNtB22wbrean8EUqYeYCKNBT+TNKAlWk6QkIZH3F5bxygo4Fa -PrdjEtDnCPWqIqH5BfeI3UG0nMRk7dr/Eo8i0jmKN0TEHdTsfn1sDNBpa4AmIXzmV7IR1WYQ8Djk -h4CAdaGQz1/cg7dnq20gKQm7O2MopDqI9d/dg04tfCur5vRc9QJ3TfTP9Ep7db37xkAVPIhy/aoN -V+YmZfff2pKjVErODtKRBL++HZ2+Wu7jWv2oyhnj7Gua9bZjI/ar7djMzI8EbkmSIjqWGYURwg8B -p1zs7oAd27mqVrmf/3tykiQQK5KQLLWLK5kfJ5gLSsI9pMFrrZ66WaXI3yFq7D3j1RX1B9ZhCgn0 -pN6cr6nV7kx70/7UcaJeG3VQda1fMT3InAIuYP+FVqdF5L3W+sew/xcQ1MXoGw8AAA==#> -#endregion - -<# - .NOTES - - .DESCRIPTION - GUI script generated by PowerShell Studio 2016 -#> -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-test-tools_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $panel1 = New-Object 'System.Windows.Forms.Panel' - - $Progressbar = New-Object 'System.Windows.Forms.ProgressBar' - $Services = New-Object 'System.Windows.Forms.Label' - $Output = New-Object 'System.Windows.Forms.TextBox' - $ServerName = New-Object 'System.Windows.Forms.TextBox' - $combobox1 = New-Object 'System.Windows.Forms.ComboBox' - $ButtonConnectServer = New-Object 'System.Windows.Forms.Button' - $ButtonDisplayServices = New-Object 'System.Windows.Forms.Button' - $ButtonServiceStatus = New-Object 'System.Windows.Forms.Button' - $ButtonServiceStart = New-Object 'System.Windows.Forms.Button' - $ButtonServiceStop = New-Object 'System.Windows.Forms.Button' - $ButtonServiceRestart = New-Object 'System.Windows.Forms.Button' - $ButtonServiceAutomatic = New-Object 'System.Windows.Forms.Button' - $ButtonServiceDisabled = New-Object 'System.Windows.Forms.Button' - $ButtonServiceManual = New-Object 'System.Windows.Forms.Button' - $labelServerOS = New-Object 'System.Windows.Forms.Label' - $labelDisplayOS = New-Object 'System.Windows.Forms.Label' - $labelServerIP = New-Object 'System.Windows.Forms.Label' - $labelDisplayIP = New-Object 'System.Windows.Forms.Label' - $labelServerDomain = New-Object 'System.Windows.Forms.Label' - $labelDisplayDomain = New-Object 'System.Windows.Forms.Label' - $labelServerType = New-Object 'System.Windows.Forms.Label' - $labelDisplayServerInfo = New-Object 'System.Windows.Forms.Label' - $labelFilterService = New-Object 'System.Windows.Forms.Label' - $ComboboxServiceStartMode = New-Object 'System.Windows.Forms.ComboBox' - $ComboboxServiceState = New-Object 'System.Windows.Forms.ComboBox' - - $labelProcProcesses = New-Object 'System.Windows.Forms.Label' - $ButtonProcDisplay = New-Object 'System.Windows.Forms.Button' - $ButtonProcStatus = New-Object 'System.Windows.Forms.Button' - $ButtonKillProcess = New-Object 'System.Windows.Forms.Button' - $ComboboxProc = New-Object 'System.Windows.Forms.ComboBox' - $ComboboxProcSort = New-Object 'System.Windows.Forms.ComboBox' - - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - $Global:ServerName = "" - $Global:ServiceStatus = "" - $Global:Serv = "" - $Global:Proc = "" - $Global:ProcessStatus = "" - $Global:StartMode = "" - - #NA-ClearGlobalVariables - #$Output.text = $Global:proc | ft -AutoSize | Out-String - #$combobox1.Text = $env:COMPUTERNAME | Out-String - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $Progressbar_Click={} - - $combobox1_SelectedIndexChanged={ - #TODO: Place custom script here - - } - $ComboboxServiceStartMode_SelectedIndexChanged={ - NA-Load-Service - $Global:StartMode = $Global:Serv | select DisplayName,Name,ProcessID,StartMode,State,Status | ? { $_.StartMode -eq $ComboboxServiceStartMode.text } - - NA-Populate-DropDowns -DropDownName ServiceState - - $Output.Text = $Global:Serv | select DisplayName,Name,ProcessID,StartMode,State,Status | ? { $_.StartMode -eq $ComboboxServiceStartMode.text } |ft -AutoSize | Out-String - - } - $ComboboxServiceState_SelectedIndexChanged={ - $Output.Text = $Global:StartMode | ? {$_.state -eq $ComboboxServiceState.Text } | ft -AutoSize | Out-String - #$Output.Text = $ComboboxServiceState.Text - } -################################################################################################################################################################################### - $ButtonConnectServer_Click={ - - $combobox1.Items.Clear() - $combobox1.Refresh() - $ComboboxProc.Items.Clear() - $ComboboxServiceStartMode.Items.Clear() - # $Progressbar.Visible = $True - If ($ServerName.Text -ne "-*-" -or $ServerName.Text -ne "") { - - $Global:ServerName = $ServerName.Text - $CheckConn = NA-TestConnection -Computer $ServerName.Text - - If ($CheckConn -eq '1') - { - NA-Populate-DropDowns -DropDownName Service - NA-Populate-DropDowns -DropDownName Process - NA-Populate-DropDowns -DropDownName Sort - NA-Populate-DropDowns -DropDownName FilterStartMode - #NA-Load-Service - #NA-Load-Process - NA-ServerInfo - - } - Else - { - $Global:ServerName = "" - NA-Messages -MessageType ServerNotFound - #$Output.Text = "Server NOT Found. Please Check Server Name ...... !" | Out-String - } - }#end If - Else { NA-Messages -MessageType ServerNotFound } - $Progressbar.Visible = $False - } -################################################################################################################################################################################### - $ButtonDisplayServices_Click={ - - If ($Global:ServerName) { - - NA-Load-Service - #$Output.Text = $Global:Serv | select PsComputerName,Name,ProcessID,StartMode,State,Status | ft -AutoSize| Out-String - } - Else { NA-Messages -MessageType ConnectServer } - } - - $ButtonServiceStatus_Click={ - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - NA-Service-Status - #$Output.Text = $Global:ServiceStatus | ft -AutoSize | Out-String - } - Else { NA-Messages -MessageType ServiceStatus } - } - - - $ButtonServiceStart_Click={ - - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - NA-StartService - } - Else { NA-Messages -MessageType ServiceStatus } - } - - $ButtonServiceStop_Click={ - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - NA-Service-Status - NA-Service-State -State Stopped - } - Else { NA-Messages -MessageType ServiceStatus } - } - - $ButtonServiceRestart_Click={ - NA-Service-Status - If ($Global:ServiceStatus.state -eq "Running") { - $Output.Text = "Re-Starting Service: $($combobox1.Text) ...... Please Wait! " - Restart-Service $combobox1.Text - Start-Sleep -Seconds 3 - $Output.Text = Gwmi Win32_Service -ComputerName $Global:ServerName | ? {$_.DisplayName -eq $combobox1.Text} | select name,displayname,state,startmode | ft -AutoSize | Out-String - } - Elseif ($Global:ServiceStatus.startmode -eq "Disabled") { - $Output.Text = "The Service: $($Global:ServiceStatus.name) is currently Disabled.....!!" - } - Elseif ($Global:ServiceStatus.state -eq "Stopped") { - $Output.Text = "The Service: $($Global:ServiceStatus.name) is currently NOT Running.....!!" - } - Else { NA-Messages -MessageType ServiceStatus} - - } - - $ButtonServiceAutomatic_Click={ - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - NA-Service-State -State Automatic - } - Else { NA-Messages -MessageType ServiceStatus } - } - - $ButtonServiceDisabled_Click={ - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - NA-Service-State -State Disabled - } - Else { NA-Messages -MessageType ServiceStatus } - } - $ButtonServiceManual_Click={ - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - NA-Service-State -State Manual - } - Else { NA-Messages -MessageType ServiceStatus } - } - - $labelServerOS_Click={} - $labelDisplayOS_Click={} - $labelServerIP_Click={} - $labelDisplayIP_Click={} - $labelServerDomain_Click={} - $labelDisplayDomain_Click={} - $labelServerType_Click={} - $labelDisplayServerInfo_Click={} - $labelFilterService_Click={} - - - $form1_Load={ - #TODO: Place custom script here - - } - - $ServerName1_Click={ - #TODO: Place custom script here - - } - - $Server_Click={ - #TODO: Place custom script here - - } - - $Output_TextChanged={ - #TODO: Place custom script here - - } - -######################################################################################################################################### - $labelProcProcesses_Click={} - - $ButtonProcDisplay_Click={ - If ($Global:ServerName) { - NA-Load-Process - #$Output.Text = $Global:Proc | ft -AutoSize | Out-String - } - Else { NA-Messages -MessageType ConnectServer } - } - - $ButtonProcStatus_Click={ NA-Process-Status <#; $Output.Text = $Global:ProcessStatus | ft -AutoSize | Out-String #>} - - $ButtonKillProcess_Click={ - If ($ComboboxProc.Text -ne "" -and $ComboboxProc.Text -notlike "--*" -and ($Global:ServerName)) { - NA-KillProcess -ProcessSelected ($ComboboxProc.text)} - Else { NA-Messages -MessageType ProcessStatus } - } - - $ComboboxProc_SelectedIndexChanged={} - $ComboboxProcSort_SelectedIndexChanged={ $Output.text = $Global:Proc | sort $ComboboxProcSort.text | ft -AutoSize | Out-String} - - -######################################################################################################################################### - function NA-ServerInfo - { - $OS = Gwmi win32_Operatingsystem -ComputerName $Global:ServerName | select -ExpandProperty caption - $labelDisplayOS.Text = $OS | Out-String - - $IP = Test-Connection -ComputerName $Global:ServerName -Count 1 -ErrorAction SilentlyContinue | select -ExpandProperty IPV4Address - $labelDisplayIP.text = $IP.IPAddressToString | Out-String - - $GetMachineInfo = Gwmi win32_Computersystem -ComputerName $Global:ServerName | Select model,domain - - $Domain = ($GetMachineInfo.domain).toupper() - $labelDisplayDomain.Text = $Domain | Out-String - - Switch -Wildcard ($GetMachineInfo.model) { - "Vmware*" { $labelDisplayServerInfo.Text = "VMWare VM"} - "Virtual*" { $labelDisplayServerInfo.Text = "Hyper-V VM"} - Default { $labelDisplayServerInfo.Text = "Physical Server"} - } - - - } -######################################################################################################################################### - function NA-Load-Service - { - #Param ($Computer) - #$combobox1.Items.Clear() - #$Global:Serv = "" - #$Global:Serv = Get-Service -ComputerName $Global:ServerName | sort displayname # | select -ExpandProperty displayname - #$Global:Serv = Gwmi Win32_Service -ComputerName $Global:ServerName | sort displayname - - $Output.Text = $Global:Serv | select PsComputerName,Name,ProcessID,StartMode,State,Status | ft -AutoSize| Out-String - - #$Global:Serv | % { $combobox1.Items.Add($_.displayname) } - - - - } -######################################################################################################################################### - function NA-Service-Status - { - - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - - $Global:ServiceStatus = Gwmi Win32_Service -ComputerName $Global:ServerName | ? {$_.DisplayName -eq $combobox1.Text} - - $Output.Text = $Global:ServiceStatus | select PsComputerName,Name,ProcessID,StartMode,State,Status | ft -AutoSize | Out-String - } - Else { - NA-Messages -MessageType ServiceStatus - #$Output.Text = "Please Select a Service or Connect to a Server ... !" - } - } -######################################################################################################################################### - function NA-Service-State - { - Param($State) - - #$SelectedService = Get-Service -ComputerName $Global:ServerName -DisplayName $combobox1.Text | select -ExpandProperty name - - - #$Global:ServiceStatus - - Switch($State) - { - Automatic { $Global:ServiceStatus.changestartmode("Automatic") } - Manual { $Global:ServiceStatus.changestartmode("Manual") } - Disabled { $Global:ServiceStatus.stopservice();$Global:ServiceStatus.changestartmode("Disabled") } - Stopped { $Global:ServiceStatus.stopservice() } - } - - - NA-Service-Status - $Output.Text = $Global:ServiceStatus | select name,displayname,state,startmode | ft -AutoSize | Out-String - } - -######################################################################################################################################### -######################################################################################################################################### - function NA-Load-Process { - - <# - $ComboboxProc.Items.Clear() - $Global:Proc = Invoke-Command -ComputerName $Global:ServerName { Get-Process } - - #$temp = $Global:Proc | select processname,id - - $i = 0 - $Q = @() - - foreach ($P in $Global:Proc) { - $Q += $Global:Proc[$i].ProcessName + " -- ID = " + "$($Global:Proc[$i].ID)" - #$Q += $P[$i].ProcessName - # $Q[$i] - $ComboboxProc.Items.Add($Q[$i]) - $i++ - } - #> - $Output.Text = $Global:Proc | ft -AutoSize | Out-String - #$Output.Text = $Q | Out-String - - } -######################################################################################################################################### - function NA-Process-Status { - - If ($ComboboxProc.Text -ne "" -and $ComboboxProc.Text -notlike "--*" -and ($Global:ServerName)) { - NA-GlobalProcess - $Output.Text = $Global:ProcessStatus | ft -AutoSize | Out-String - # $Output.Text = "You select $($ComboboxProc.text)" - } - Else { - NA-Messages -MessageType ProcessStatus - #$Output.Text = "Please Select a Process or Connect to a Server ... !" - } - } - -######################################################################################################################################### - function NA-KillProcess { - Param($ProcessSelected) - - $output.Text = "Killing Process: $ProcessSelected --- Please Wait..." - - $ProcessSelectedID = ($ProcessSelected.split("="))[-1] - - $TerminateProcess = Gwmi Win32_Process -ComputerName $Global:ServerName -Filter "ProcessID=$ProcessSelectedID" - $TerminateProcess.terminate() | Out-Null - - Start-Sleep -Seconds 3 - - $output.Text = "Done ! -- Re-Loading Process List..." - Start-Sleep -Seconds 3 - - NA-Load-Process - $Output.Text = $Global:Proc | ft -AutoSize | Out-String - } - -######################################################################################################################################### - function NA-GlobalProcess { - #$Proc = $ComboboxProc.text - $Proc = ($ComboboxProc.text.split("="))[-1] - #$output.Text = $Proc - $Global:ProcessStatus = Invoke-Command -ComputerName $Global:ServerName { Param($Proc) Gwmi Win32_Process | ? { $_.ProcessID -eq $Proc} } -ArgumentList $Proc - - } -######################################################################################################################################### -######################################################################################################################################### - function NA-TestConnection - { - param ($Computer) - - If (!$Computer) {$Output.Text = "Please Enter Server Name in the Box!!" | Out-String} - - Else { - $TConn = Test-Connection -ComputerName $Computer -Count 1 -ErrorAction SilentlyContinue - } - If ($TConn) - { - $Output.Text = "Getting information from server: $Computer " - Write-Output '1' - } - Else - { - Write-Output '0' - } - } -######################################################################################################################################### - function NA-StartService - { - - # $SvcStatus = Gwmi Win32_Service -ComputerName $Global:ServerName | ? {$_.DisplayName -eq $combobox1.Text} | select name,displayname,state,startmode - NA-Service-Status - - #$Output.Text = "Starting Service: $($Global:ServiceStatus.displayname) on $Global:ServerName" | Out-String - $Output.Text = "Global Server Name: $($Global:Servername) ---- Global Service Status: $($Global:ServiceStatus.displayname)" | Out-String - - - #$ServiceStatus = Get-Service -Name $ServiceName -ComputerName $Global:ServerName - #$ServiceSelected = $combobox1.text - #NA-GlobalService - - Switch($Global:ServiceStatus.startmode) { - #Switch($ServiceStatus.startmode) { - #Restart { $Output.Text = "Re-starting Service: $($Global:ServiceStatus.displayname) ..... please wait"; Restart-Service -DisplayName $Global:ServiceStatus.displayname } - #Manual { Start-Service -DisplayName $Global:ServiceStatus.displayname } - Disabled { $Output.Text = "Starting Service ..... please wait"; NA-Service-State -State Manual; $Global:ServiceStatus.StartService() <# Get-Service -Name $Global:ServiceStatus.name -ComputerName $Global:ServerName | Start-Service #>} - Default { $Global:ServiceStatus.StartService() } - #Disabled { $Output.Text = "Disabled" } - #Default { $Output.Text = "Manual"} - } - - #$CurrentService = Get-Service -DisplayName $ServiceSelected - #Get-Service -DisplayName $($combobox1.text) -ComputerName $Global:ServerName | Start-Service | Out-String - Start-Sleep -Seconds 4 - #$Output.Text = Get-Service -DisplayName $ServiceSelected | ft -AutoSize | Out-String - NA-Service-Status - - $Output.Text = $Global:ServiceStatus | select name,displayname,state,startmode | ft -AutoSize | Out-String - } -######################################################################################################################################### - function NA-ClearGlobalVariables - { - $Global:ServerName = "" - $Global:ServiceStatus = "" - $Global:Serv = "" - $Global:Proc = "" - $Global:ProcessStatus ="" - } -######################################################################################################################################### - Function NA-Populate-DropDowns { - Param($DropDownName) - - Switch($DropDownName) { - Service { $Global:Serv = Gwmi Win32_Service -ComputerName $Global:ServerName | sort displayname - $Global:Serv | % { $combobox1.Items.Add($_.displayname) } - }#endService - Process { $ComboboxProc.Items.Clear() - $Global:Proc = Invoke-Command -ComputerName $Global:ServerName { Get-Process } - - $i = 0 - $Q = @() - - foreach ($P in $Global:Proc) { - $Q += $Global:Proc[$i].ProcessName + " -- ID = " + "$($Global:Proc[$i].ID)" - #$Q += $P[$i].ProcessName - # $Q[$i] - $ComboboxProc.Items.Add($Q[$i]) - $i++ - }#endForeach - }#endProcess - Sort { $Items = "CPU","VM","ProcessName" - $ComboboxProcSort.items.Clear() - $Items | % { $ComboboxProcSort.Items.Add($_) } - } - FilterStartMode { $Items = "Auto","Manual","Disabled" - $ComboboxServiceStartMode.items.Clear() - $Items | % { $ComboboxServiceStartMode.Items.Add($_) }} - ServiceState { $ComboboxServiceStateItems = "Stopped","Running" - $ComboboxServiceState.items.Clear() - $ComboboxServiceStateItems | % { $ComboboxServiceState.Items.Add($_) }} - }#endSwitch - }#endFunction - -######################################################################################################################################### - function xNA-GlobalService { - - #$Global:ServiceStatus = "" - If ($combobox1.Text -ne "" -and $combobox1.Text -notlike "--*" -and ($Global:ServerName)) { - - $Global:ServiceStatus = Gwmi Win32_Service -ComputerName $Global:ServerName | ? {$_.DisplayName -eq $combobox1.Text} | select displayname,name,state,startmode - #$Global:ServiceStatus = Get-Service -ComputerName $Global:ServerName -DisplayName $combobox1.Text - } - Else { $Output.Text = "Please Connect to a Server or Select a Service from the Drop down ... !"} - - } -######################################################################################################################################### - function NA-Messages { - Param($MessageType) - - Switch($MessageType) { - ConnectServer { $Output.Text = "Server NOT Found. Please Check Server Name and Connect ...... !!" } - ServerNotFound { $Output.Text = "Cannot Connect to Server. Please Check Server Name and Connect ......!!"} - ServiceStatus { $Output.Text = "Please Select a Service or Connect to a Server ... !!" } - ProcessStatus { $Output.Text = "Please Select a Process or Connect to a Server ... !!" } - - - }#end Switch - - - } -######################################################################################################################################### - - - - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $Progressbar.remove_Click($Progressbar_Click) - $Services.remove_Click($Services_Click) - $Output.remove_TextChanged($Output_TextChanged) - $combobox1.remove_SelectedIndexChanged($combobox1_SelectedIndexChanged) - $ComboboxServiceStartMode.remove_SelectedIndexChanged($ComboboxServiceStartMode_SelectedIndexChanged) - $ComboboxServiceState.remove_SelectedIndexChanged($ComboboxServiceState_SelectedIndexChanged) - $ButtonDisplayServices.remove_Click($ButtonDisplayServices_Click) - $ButtonServiceStatus.remove_Click($ButtonServiceStatus_Click) - $ButtonConnectServer.remove_Click($ButtonConnectServer_Click) - $ButtonServiceStart.remove_Click($ButtonServiceStart_Click) - $ButtonServiceStop.remove_Click($ButtonServiceStop_Click) - $ButtonServiceRestart.remove_Click($ButtonServiceRestart_Click) - $ButtonServiceAutomatic.remove_Click($ButtonServiceAutomatic_Click) - $ButtonServiceDisabled.remove_Click($ButtonService_Click) - $ButtonServiceManual.remove_Click($ButtonServiceManual_Click) - $labelServerOS.remove_Click($labelServerOS_Click) - $labelDisplayOS.remove_Click($labelDisplayOS_Click) - $labelServerIP.remove_Click($labelServer_Click) - $labelDisplayIP.remove_Click($labelDisplayIP_Click) - $labelServerDomain.remove_Click($labelServer_Click) - $labelDisplayDomain.remove_Click($labelDisplayDomain_Click) - $labelServerType.remove_Click($labelServer_Click) - $labelDisplayServerInfo.remove_Click($labelDisplayServerInfo_Click) - $labelFilterService.remove_Click($labelFilterService_Click) - - $labelProcProcesses.remove_Click($labelProcProcesses_Click) - $ButtonProcDisplay.remove_Click($ButtonProcDisplay_Click) - $ButtonProcStatus.remove_Click($ButtonProcStatus_Click) - $ButtonKillProcess.remove_Click($ButtonKillProcess_Click) - $ComboboxProc.remove.SelectedIndexChanged($ComboboxProc_SelectedIndexChanged) - $ComboboxProcSort.remove.SelectedIndexChanged($ComboboxProcSort_SelectedIndexChanged) - - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - NA-ClearGlobalVariables - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - $form1.SuspendLayout() - $panel1.SuspendLayout() - - # - # form1 - # - $form1.Controls.Add($Progressbar) - $form1.Controls.Add($Services) - $form1.Controls.Add($panel1) - - $form1.Controls.Add($Output) - $form1.Controls.Add($ServerName) - $form1.Controls.Add($combobox1) - $form1.Controls.Add($ComboboxServiceStartMode) - $form1.Controls.Add($ComboboxServiceState) - $form1.Controls.Add($ButtonDisplayServices) - $form1.Controls.Add($ButtonServiceStatus) - $form1.Controls.Add($ButtonConnectServer) - $form1.Controls.Add($ButtonServiceStart) - $form1.Controls.Add($ButtonServiceStop) - $form1.Controls.Add($ButtonServiceRestart) - $form1.Controls.Add($ButtonServiceAutomatic) - $form1.Controls.Add($ButtonServiceDisabled) - $form1.Controls.Add($ButtonServiceManual) - $form1.Controls.Add($labelServerOS) - $form1.Controls.Add($labelDisplayOS) - $form1.Controls.Add($labelServerIP) - $form1.Controls.Add($labelDisplayIP) - $form1.Controls.Add($labelServerDomain) - $form1.Controls.Add($labelDisplayDomain) - $form1.Controls.Add($labelServerType) - $form1.Controls.Add($labelDisplayServerInfo) - $form1.Controls.Add($labelFilterService) - - $form1.Controls.Add($labelProcProcesses) - $form1.Controls.Add($ButtonProcDisplay) - $form1.controls.Add($ButtonProcStatus) - $form1.Controls.Add($ButtonKillProcess) - $form1.Controls.Add($ComboboxProc) - $form1.Controls.Add($ComboboxProcSort) - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '990, 660' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - # - # panel1 - # - $panel1.Controls.Add($ServerName) - $panel1.Controls.Add($labelServerOS) - $panel1.Controls.Add($labelDisplayOS) - $panel1.Controls.Add($labelServerIP) - $panel1.Controls.Add($labelDisplayIP) - $panel1.Controls.Add($labelServerDomain) - $panel1.Controls.Add($labelDisplayDomain) - $panel1.Controls.Add($labelServerType) - $panel1.controls.Add($labelDisplayServerInfo) - $panel1.Controls.Add($ButtonConnectServer) - $panel1.BackColor = 'ActiveCaption' - $panel1.ForeColor = 'ControlText' - $panel1.Location = '12, 12' - $panel1.Name = 'panel1' - $panel1.Size = '965, 34' - $panel1.TabIndex = 7 - # - # - # Progressbar - # - $Progressbar.Location = '60, 111' - $Progressbar.Maximum = $Global:Serv.count - $Progressbar.Step = 1 - $Progressbar.Value = 0 - $Progressbar.Style="Continuous" - $Progressbar.Name = 'Progressbar' - $Progressbar.Size = '600, 23' - $Progressbar.TabIndex = 9 - $Progressbar.add_Click($Progressbar_Click) - $Progressbar.Visible = $False - # - # Services - # - $Services.AutoSize = $True - $Services.Location = '12, 60' - $Services.Name = 'Services' - $Services.Size = '41, 13' - $Services.TabIndex = 6 - $Services.Text = 'Service:' - $Services.add_Click($Services_Click) - # - # labelFilterService - # - $labelFilterService.AutoSize = $True - $labelFilterService.Location = '88, 90' - $labelFilterService.Name = 'Filter' - $labelFilterService.Size = '41, 13' - $labelFilterService.TabIndex = 6 - $labelFilterService.Text = 'Filter:' - $labelFilterService.add_Click($labelFilterService_Click) - # - # labelProcProcesses - # - $labelProcProcesses.AutoSize = $True - $labelProcProcesses.Location = '12, 120' - $labelProcProcesses.Name = 'Proceses' - $labelProcProcesses.Size = '41, 13' - $labelProcProcesses.Text = 'Processes:' - $labelProcProcesses.add_Click($labelProcProcesses_Click) - # - # labelServerOS - # - $labelServerOS.AutoSize = $True - $labelServerOS.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelServerOS.ForeColor = 'DarkGreen' - $labelServerOS.TextAlign = 'MiddleRight' - $labelServerOS.Location = '264, 3' - $labelServerOS.Name = 'OS' - $labelServerOS.Size = '41, 13' - $labelServerOS.TabIndex = 6 - $labelServerOS.Text = 'O/S:' - $labelServerOS.add_Click($labelServerOS_Click) - # - # labelDisplayOS - # - $labelDisplayOS.AutoSize = $True - $labelDisplayOS.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelDisplayOS.ForeColor = 'DarkGreen' - $labelDisplayOS.TextAlign = 'MiddleRight' - $labelDisplayOS.Location = '295, 3' - $labelDisplayOS.Name = 'DisplayOS' - $labelDisplayOS.Size = '41, 13' - $labelDisplayOS.TabIndex = 7 - $labelDisplayOS.Text = '-----' - $labelDisplayOS.add_Click($labelDisplayOS_Click) - # - # labelServerIP - # - $labelServerIP.AutoSize = $True - $labelServerIP.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelServerIP.TextAlign = 'MiddleRight' - $labelServerIP.Location = '272, 17' - $labelServerIP.Name = 'IP' - $labelServerIP.Size = '41, 13' - $labelServerIP.TabIndex = 6 - $labelServerIP.Text = 'IP:' - $labelServerIP.add_Click($labelServerIP_Click) - # - # labelDisplayIP - # - $labelDisplayIP.AutoSize = $True - $labelDisplayIP.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelDisplayIP.TextAlign = 'MiddleRight' - $labelDisplayIP.Location = '295, 17' - $labelDisplayIP.Name = 'DisplayIP' - $labelDisplayIP.Size = '41, 13' - $labelDisplayIP.TabIndex = 8 - $labelDisplayIP.Text = '-----' - $labelDisplayIP.add_Click($labelDisplayIP_Click) - # - # labelServerDomain - # - $labelServerDomain.AutoSize = $True - $labelServerDomain.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelServerDomain.Location = '530, 3' - $labelServerDomain.Name = 'Domain' - $labelServerDomain.Size = '41, 13' - $labelServerDomain.TabIndex = 10 - $labelServerDomain.Text = 'Domain:' - $labelServerDomain.add_Click($labelServerDomain_Click) - # - # labelDisplayDomain - $labelDisplayDomain.AutoSize = $True - $labelDisplayDomain.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelDisplayDomain.Location = '580, 3' - $labelDisplayDomain.Name = 'DisplayDomain' - $labelDisplayDomain.Size = '41, 13' - $labelDisplayDomain.TabIndex = 9 - $labelDisplayDomain.Text = '-----' - $labelDisplayDomain.add_Click($labelDisplayDomain_Click) - # - # labelServerType - # - $labelServerType.AutoSize = $True - $labelServerType.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelServerType.Location = '542, 17' - $labelServerType.Name = 'Type' - $labelServerType.Size = '41, 13' - $labelServerType.TabIndex = 6 - $labelServerType.Text = 'Type:' - $labelServerType.add_Click($labelServerType_Click) - # - # labelDisplayServerInfo - # - $labelDisplayServerInfo.AutoSize = $True - $labelDisplayServerInfo.Font = 'Microsoft Sans Serif, 7.50pt, style=Bold' - $labelDisplayServerInfo.Location = '580, 17' - $labelDisplayServerInfo.Name = 'ServerType' - $labelDisplayServerInfo.Size = '41, 13' - $labelDisplayServerInfo.TabIndex = 11 - $labelDisplayServerInfo.Text = '-----' - $labelDisplayServerInfo.add_Click($labelDisplayServerInfo_Click) - # - # Output - # - $Output.Location = '12, 280' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'both' - $Output.Size = '790, 360' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.TabIndex = 5 - $Output.add_TextChanged($Output_TextChanged) - # - # ServerName - # - $ServerName.BackColor = '255, 255, 192' - $ServerName.Font = 'Microsoft Sans Serif, 12pt, style=Bold' - $ServerName.Location = '4, 4' - $ServerName.Text = "--ServerName--" - $ServerName.Name = 'ServerName' - $ServerName.BackColor = '255, 255, 192' - $ServerName.TextAlign = 'Center' - $ServerName.Size = '130, 20' - $ServerName.TabIndex = 3 - # - # combobox1 - # - $combobox1.FormattingEnabled = $True - $combobox1.Location = '286, 55' - $combobox1.Name = 'combobox1' - $combobox1.Size = '165, 21' - $combobox1.TabIndex = 2 - $combobox1.Text = '---Select Service---' - $combobox1.add_SelectedIndexChanged($combobox1_SelectedIndexChanged) - # - # ComboboxServiceStartMode - # - $ComboboxServiceStartMode.FormattingEnabled = $True - $ComboboxServiceStartMode.Location = '125, 86' - $ComboboxServiceStartMode.Name = 'ComboboxServiceStartMode' - $ComboboxServiceStartMode.Size = '90, 21' - $ComboboxServiceStartMode.TabIndex = 2 - $ComboboxServiceStartMode.Text = '--Start Mode--' - $ComboboxServiceStartMode.add_SelectedIndexChanged($ComboboxServiceStartMode_SelectedIndexChanged) - # - # ComboboxServiceState - # - $ComboboxServiceState.FormattingEnabled = $True - $ComboboxServiceState.Location = '225, 86' - $ComboboxServiceState.Name = 'ComboboxServiceState' - $ComboboxServiceState.Size = '90, 21' - $ComboboxServiceState.TabIndex = 2 - $ComboboxServiceState.Text = '--State--' - $ComboboxServiceState.add_SelectedIndexChanged($ComboboxServiceState_SelectedIndexChanged) - # - # ComboboxProc - # - $ComboboxProc.FormattingEnabled = $True - $ComboboxProc.Location = '286, 115' - $ComboboxProc.Name = 'ComboboxProc' - $ComboboxProc.Size = '165, 21' - $ComboboxProc.TabIndex = 2 - $ComboboxProc.Text = '---Select Process---' - $ComboboxProc.add_SelectedIndexChanged($ComboboxProc_SelectedIndexChanged) - # - # ComboboxProcSort - # - $ComboboxProcSort.FormattingEnabled = $True - $ComboboxProcSort.Location = '547, 115' - $ComboboxProcSort.Name = 'SortBy' - $ComboboxProcSort.Size = '90, 21' - $ComboboxProcSort.TabIndex = 2 - $ComboboxProcSort.Text = '---Sort By---' - $ComboboxProcSort.add_SelectedIndexChanged($ComboboxProcSort_SelectedIndexChanged) - # - # ButtonDisplayServices - # - $ButtonDisplayServices.Location = '88, 54' - $ButtonDisplayServices.Name = 'DisplayService' - $ButtonDisplayServices.Size = '100, 23' - $ButtonDisplayServices.TabIndex = 1 - $ButtonDisplayServices.Text = 'Display Services' - $ButtonDisplayServices.UseVisualStyleBackColor = $True - $ButtonDisplayServices.add_Click($ButtonDisplayServices_Click) - # - # ButtonProcDisplay - # - $ButtonProcDisplay.Location = '88, 114' - $ButtonProcDisplay.Name = 'DisplayProcess' - $ButtonProcDisplay.Size = '105, 23' - $ButtonProcDisplay.TabIndex = 1 - $ButtonProcDisplay.Text = 'Display Processes' - $ButtonProcDisplay.UseVisualStyleBackColor = $True - $ButtonProcDisplay.add_Click($ButtonProcDisplay_Click) - # - # Service - # - $ButtonServiceStatus.Location = '199, 54' - $ButtonServiceStatus.Name = 'ServiceStatus' - $ButtonServiceStatus.Size = '80, 23' - $ButtonServiceStatus.TabIndex = 1 - $ButtonServiceStatus.Text = 'Status' - $ButtonServiceStatus.UseVisualStyleBackColor = $True - $ButtonServiceStatus.add_Click($ButtonServiceStatus_Click) - # - # ButtonProcStatus - $ButtonProcStatus.Location = '199, 114' - $ButtonProcStatus.Name = 'ProcessStatus' - $ButtonProcStatus.Size = '80, 23' - $ButtonProcStatus.TabIndex = 1 - $ButtonProcStatus.Text = 'Status' - $ButtonProcStatus.UseVisualStyleBackColor = $True - $ButtonProcStatus.add_Click($ButtonProcStatus_Click) - # - # ButtonKillProcess - # - $ButtonKillProcess.Location = '460, 115' - $ButtonKillProcess.Name = 'KillProcess' - $ButtonKillProcess.Size = '80, 23' - $ButtonKillProcess.TabIndex = 1 - $ButtonKillProcess.Text = 'Kill Process' - $ButtonKillProcess.UseVisualStyleBackColor = $True - $ButtonKillProcess.add_Click($ButtonKillProcess_Click) - # - # ButtonConnectServer - # - $ButtonConnectServer.Location = '156, 6' - $ButtonConnectServer.Name = 'ConnectServer' - $ButtonConnectServer.Text = 'Connect' - $ButtonConnectServer.UseVisualStyleBackColor = $True - $ButtonConnectServer.add_Click($ButtonConnectServer_Click) - # - # - - $form1.ResumeLayout() - $panel1.ResumeLayout() - - # - # ButtonServiceStart - # - $ButtonServiceStart.Location = '458, 54' - $ButtonServiceStart.Name = 'StartService' - $ButtonServiceStart.Size = '65, 23' - $ButtonServiceStart.TabIndex=2 - $ButtonServiceStart.Text = 'Start' - $ButtonServiceStart.UseVisualStyleBackColor = $True - $ButtonServiceStart.add_Click($ButtonServiceStart_Click) - $ButtonServiceStart.ResumeLayout() - # - # $ButtonServiceStop - # - $ButtonServiceStop.Location = '530, 54' - $ButtonServiceStop.Name = 'StopService' - $ButtonServiceStop.Size = '65, 23' - $ButtonServiceStop.TabIndex = 3 - $ButtonServiceStop.Text = 'Stop' - $ButtonServiceStop.UseVisualStyleBackColor = $True - $ButtonServiceStop.add_Click($ButtonServiceStop_Click) - $ButtonServiceStop.ResumeLayout() - # - # ButtonServiceRestart - # - $ButtonServiceRestart.Location = '602, 54' - $ButtonServiceRestart.Name = 'RestartService' - $ButtonServiceRestart.Size = '65, 23' - $ButtonServiceRestart.TabIndex = 3 - $ButtonServiceRestart.Text = 'Restart' - $ButtonServiceRestart.UseVisualStyleBackColor = $True - $ButtonServiceRestart.add_Click($ButtonServiceRestart_Click) - $ButtonServiceRestart.ResumeLayout() - # - # ButtonServiceAutomatic - # - $ButtonServiceAutomatic.Location = '674, 54' - $ButtonServiceAutomatic.Name = 'AutomaticService' - $ButtonServiceAutomatic.Size = '65, 23' - $ButtonServiceAutomatic.TabIndex = 3 - $ButtonServiceAutomatic.Text = 'Automatic' - $ButtonServiceAutomatic.UseVisualStyleBackColor = $True - $ButtonServiceAutomatic.add_Click($ButtonServiceAutomatic_Click) - $ButtonServiceAutomatic.ResumeLayout() - # - # ButtonServiceDisabled - # - $ButtonServiceDisabled.Location = '818, 54' - $ButtonServiceDisabled.Name = 'DisabledService' - $ButtonServiceDisabled.Size = '65, 23' - $ButtonServiceDisabled.TabIndex = 3 - $ButtonServiceDisabled.Text = 'Disabled' - $ButtonServiceDisabled.UseVisualStyleBackColor = $True - $ButtonServiceDisabled.add_Click($ButtonServiceDisabled_Click) - $ButtonServiceDisabled.ResumeLayout() - # - # - # - $ButtonServiceManual.Location = '746, 54' - $ButtonServiceManual.Name = 'ManualService' - $ButtonServiceManual.Size = '65, 23' - $ButtonServiceManual.TabIndex = 3 - $ButtonServiceManual.Text = 'Manual' - $ButtonServiceManual.UseVisualStyleBackColor = $True - $ButtonServiceManual.add_Click($ButtonServiceManual_Click) - $ButtonServiceManual.ResumeLayout() - # - #endregion Generated Form Code - - #---------------------------------------------- - - #Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-test-tools_psf | Out-Null diff --git a/dump/SCCM-Tool/Forms/_FORMS-DESIGNER.ps1 b/dump/SCCM-Tool/Forms/_FORMS-DESIGNER.ps1 deleted file mode 100644 index 88f4bf1..0000000 --- a/dump/SCCM-Tool/Forms/_FORMS-DESIGNER.ps1 +++ /dev/null @@ -1,432 +0,0 @@ -Add-Type -AssemblyName System.Windows.Forms -Add-Type -AssemblyName System.Drawing - -function mouseDown { - - $Global:mCurFirstX = ([System.Windows.Forms.Cursor]::Position.X ) - $Global:mCurFirstY = ([System.Windows.Forms.Cursor]::Position.Y ) - -} - -function mouseMove ($mControlName) { - - $mCurMoveX = ([System.Windows.Forms.Cursor]::Position.X ) - $mCurMoveY = ([System.Windows.Forms.Cursor]::Position.Y ) - - if ($Global:mCurFirstX -ne 0 -and $Global:mCurFirstY -ne 0){ - - $mDifX = $Global:mCurFirstX - $mCurMoveX - $mDifY = $Global:mCurFirstY - $mCurMoveY - - $this.Left = $this.Left - $mDifX - $this.Top = $this.Top - $mDifY - - $Global:mCurFirstX = $mCurMoveX - $Global:mCurFirstY = $mCurMoveY - - } - - -} - -function mouseUP ($mControlObj) { - - $mCurUpX = ([System.Windows.Forms.Cursor]::Position.X ) - $mCurUpY = ([System.Windows.Forms.Cursor]::Position.Y ) - - $Global:mCurFirstX = 0 - $Global:mCurFirstY = 0 - - - Foreach ($mElement In $Global:mFormObj.Elements){ - - if ($mElement.Name -eq $this.name){ - - foreach( $mProp in $mElement.Properties){ - - Switch($mProp.Name){ - - 'Top'{ $mProp.Value = $this.Top} - 'Left'{$mProp.Value = $this.Left} - - } - } - } - } - - renewGrids -} - -Function renewGrids { - - $mList = New-Object System.Collections.ArrayList - [array]$mElementsArr = $mFormObj.Elements | select Name,Type - $mList.AddRange($mElementsArr) - $mElemetnsGrid.DataSource = $mList - $mElemetnsGrid.Columns[1].ReadOnly = $true - - $mList2 = New-Object System.Collections.ArrayList - [array]$mPropertyArr = $mFormObj.Elements[$mElemetnsGrid.CurrentRow.Index].Properties - $mList2.AddRange($mPropertyArr) - $mPropertiesGrid.DataSource = $mList2 - $mPropertiesGrid.Columns[0].ReadOnly=$true - -} - -Function DeleteElement { - - $Global:mFormObj.Elements = $mFormObj.Elements | ?{$_.Name -notlike $mFormObj.Elements[$mElemetnsGrid.CurrentRow.Index].Name} - renewGrids - -} - -Function AddProperty ($mName,$mValue){ - - $mPropertyObj = New-Object PSCustomObject - $mPropertyObj | Add-Member -Name 'Name' -MemberType NoteProperty -Value $mName - $mPropertyObj | Add-Member -Name 'Value' -MemberType NoteProperty -Value $mValue - return $mPropertyObj - -} - -Function ElementsChanged{ - - $mList2 = New-Object System.Collections.ArrayList - [array]$mPropertyArr = $mFormObj.Elements[$mElemetnsGrid.CurrentRow.Index].Properties - $mList2.AddRange($mPropertyArr) - $mPropertiesGrid.DataSource = $mList2 - -} - -function ElementsEndEdit { - - $Global:mFormObj.Elements[$mElemetnsGrid.CurrentRow.Index].Name = $mElemetnsGrid.CurrentCell.FormattedValue - repaintForm - -} - - - -Function AddElement { - - $mPropertiesArr =@() - - $mSameType = ($mFormObj.Elements | ?{$_.Type -like $mControlType.SelectedItem}) - - if($mSameType.count -ne $NUll -and $mSameType -ne $null) { - - $mControlName=''+$mControlType.SelectedItem+($mSameType.count+1) - - }elseif($mSameType.Count -eq $null -and $mSameType -ne $null){ - - $mControlName=''+$mControlType.SelectedItem+'2' - - }else{ - - $mControlName=''+$mControlType.SelectedItem+'1' - - } - - $mPropertiesArr+= AddProperty 'Text' $mControlName - $mPropertiesArr+= AddProperty 'SizeX' 100 - $mPropertiesArr+= AddProperty 'SizeY' 23 - $mPropertiesArr+= AddProperty 'Top' 5 - $mPropertiesArr+= AddProperty 'Left' 5 - $mPropertiesArr+= AddProperty 'Anchor' 'Left,Top' - - $mElementsObj = New-Object PSCustomObject - $mElementsObj |Add-Member -Name 'Name' -MemberType NoteProperty -Value $mControlName - $mElementsObj |Add-Member -Name 'Type' -MemberType NoteProperty -Value ($mControlType.SelectedItem) - $mElementsObj |Add-Member -Name 'Properties' -MemberType NoteProperty -Value $mPropertiesArr - $Global:mFormObj.Elements += $mElementsObj - - renewGrids - - repaintForm - -} - -function AddControl ($mControl) { - - $mReturnControl = $null - - switch ($mControl.Type){ - - "TextBox" {$mReturnControl = New-Object System.Windows.Forms.TextBox} - "ListBox" {$mReturnControl = New-Object System.Windows.Forms.ListBox} - "ComboBoX" {$mReturnControl = New-Object System.Windows.Forms.ComboBox} - "Label" {$mReturnControl = New-Object System.Windows.Forms.Label} - "DataGrid" {$mReturnControl = New-Object System.Windows.Forms.DataGridView} - "Button" {$mReturnControl = New-Object System.Windows.Forms.Button} - 'CheckBox' {$mReturnControl = New-Object System.Windows.Forms.CheckBox} - 'DateTimePicker' {$mReturnControl = New-Object System.Windows.Forms.DateTimePicker} - 'ListView' {$mReturnControl = New-Object System.Windows.Forms.ListView} - 'PictureBox' {$mReturnControl = New-Object System.Windows.Forms.PictureBox} - 'RichTextBox' {$mReturnControl = New-Object System.Windows.Forms.RichTextBox} - 'TreeView' {$mReturnControl = New-Object System.Windows.Forms.TreeView} - 'WebBrowser' {$mReturnControl = New-Object System.Windows.Forms.WebBrowser} - "default" {write-host 'something goes wrong sorry :('} - - } - - $mReturnControl.Name = $mControl.Name - - $mSizeX=$null - $mSizeY=$null - - foreach ($mProperty in $mControl.Properties){ - - switch ($mProperty.Name){ - 'Text' {$mReturnControl.Text=$mProperty.Value} - 'SizeX' {$mSizeX=$mProperty.Value} - 'SizeY' {$mSizeY=$mProperty.Value} - 'Top' {$mReturnControl.Top=$mProperty.Value} - 'Left' {$mReturnControl.Left=$mProperty.Value} - 'Anchor'{$mReturnControl.Anchor=$mProperty.Value} - } - - - } - - $mReturnControl.Size = New-Object System.Drawing.Size($mSizeX,$mSizeY) - $mReturnControl.Add_MouseDown({MouseDown}) - $mReturnControl.Add_MouseMove({MouseMove ($mControl.Name)}) - $mReturnControl.Add_MouseUP({MouseUP}) - - Return $mReturnControl - -} - -function PropertiesEndEdit{ - - foreach ($mProperty in $Global:mFormObj.Elements[$mElemetnsGrid.CurrentRow.Index].Properties){ - - if ($mProperty.Name -eq $mPropertiesGrid.currentrow.Cells[0].FormattedValue){ - - $mProperty.Value = $mPropertiesGrid.currentrow.Cells[1].FormattedValue - - } - - } - - repaintForm - -} - - -Function repaintForm { - - $mFormGroupBox.Size = New-Object System.Drawing.Size(($mFormObj.SizeX),($mFormObj.SizeY)) - $mFormGroupBox.controls.clear() - - Foreach ($mElement in $mFormObj.Elements){ - - $mFormGroupBox.controls.add((AddControl $mElement)) - - } - -} - -Function EditFormSize ($x,$y){ - - $Global:mFormObj.SizeX = $X - $Global:mFormObj.SizeY = $Y - - repaintForm - -} - - -function ExportForm { - - $mFormObj - $mExportString = " - " - $mExportString+= ' - Add-Type -AssemblyName System.Windows.Forms - Add-Type -AssemblyName System.Drawing - $MyForm = New-Object System.Windows.Forms.Form - $MyForm.Text="MyForm" - $MyForm.Size = New-Object System.Drawing.Size('+$mFormObj.SizeX+','+$mFormObj.SizeY+') - ' - foreach ($mElement in $mFormObj.Elements){ - - $mExportString+=' - - $m'+$mElement.Name+' = New-Object System.Windows.Forms.'+$mElement.Type+'' - $mPrSizeX='' - $mPrSizeY='' - - foreach ($mProperty in $mElement.Properties){ - - If ($mProperty.Name -eq 'SizeX'){ - - $mPrSizeX = $mProperty.Value - - } - elseIf ($mProperty.Name -eq 'SizeY'){ - - $mPrSizeY = $mProperty.Value - - } - else{ - - $mExportString+=' - $m'+$mElement.Name+'.'+$mProperty.Name +'="'+$mProperty.Value+'"' - - } - - } - - $mExportString+=' - $m'+$mElement.Name+'.Size = New-Object System.Drawing.Size('+$mPrSizeX+','+$mPrSizeY+') - $MyForm.Controls.Add($m'+$mElement.Name+') - ' - - } - - $mExportString+= '$MyForm.ShowDialog()' - - $mFileName='' - $mFileName = get-filename 'C:\' - if ($mFileName -notlike ''){ - - $mExportString > $mFileName - - } -} - -Function Get-FileName($initialDirectory) { - - $SaveFileDialog = New-Object System.Windows.Forms.SaveFileDialog - $SaveFileDialog.initialDirectory = $initialDirectory - $SaveFileDialog.filter = “Powershell Script (*.ps1)|*.ps1|All files (*.*)|*.*” - $SaveFileDialog.ShowDialog() | Out-Null - $SaveFileDialog.filename - -} - - -$mForm = New-Object System.Windows.Forms.Form -$mForm.AutoSize = $true -$mForm.Text='FormsMaker' - -$mControlType = New-Object System.Windows.Forms.ComboBoX -$mControlType.Anchor = 'Left,Top' -$mControlType.Size = New-Object System.Drawing.Size(100,23) -$mControlType.Left = 5 -$mControlType.Top = 5 -$mControlType.Items.Add("TextBox") -$mControlType.Items.Add("ListBox") -$mControlType.Items.Add("ComboBoX") -$mControlType.Items.Add("Label") -$mControlType.Items.Add("DataGrid") -$mControlType.Items.Add("Button") -$mControlType.Items.Add("CheckBox") -$mControlType.Items.Add("DateTimePicker") -$mControlType.Items.Add("ListView") -$mControlType.Items.Add("PictureBox") -$mControlType.Items.Add("RichTextBox") -$mControlType.Items.Add("TreeView") -$mControlType.Items.Add("WebBrowser") -$mForm.Controls.Add($mControlType) - -$mAddButton = New-Object System.Windows.Forms.Button -$mAddButton.Anchor = 'Left,Top' -$mAddButton.Text = 'Add' -$mAddButton.Left = 110 -$mAddButton.Top = 5 -$mAddButton.Size = New-Object System.Drawing.Size(50,23) -$mAddButton.Add_Click({AddElement}) -$mForm.Controls.Add($mAddButton) - -$mFormLabel = New-Object System.Windows.Forms.Label -$mFormLabel.Text = 'Form Size:' -$mFormLabel.Top = 5 -$mFormLabel.Left = 165 -$mFormLabel.Anchor = 'Left,Top' -$mFormLabel.Size = New-Object System.Drawing.Size(80,23) -$mFormLabel.TextAlign='MiddleRight' -$mForm.Controls.Add($mFormLabel) - -$mFormXTextBox = New-Object System.Windows.Forms.TextBox -$mFormXTextBox.left = 250 -$mFormXTextBox.top = 5 -$mFormXTextBox.Size = New-Object System.Drawing.Size(30,23) -$mFormXTextBox.Anchor = 'Left,Top' -$mFormXTextBox.Text=300 -$mForm.Controls.Add($mFormXTextBox) - -$mFormXLabel = New-Object System.Windows.Forms.Label -$mFormXLabel.Text = 'X' -$mFormXLabel.Top = 5 -$mFormXLabel.Left = 280 -$mFormXLabel.Anchor = 'Left,Top' -$mFormXLabel.Size = New-Object System.Drawing.Size(20,23) -$mFormXLabel.TextAlign='MiddleCenter' -$mFormXTextBox.Add_TextChanged({EditFormSize $mFormXTextBox.Text $mFormYTextBox.Text }) -$mForm.Controls.Add($mFormXLabel) - -$mFormYTextBox = New-Object System.Windows.Forms.TextBox -$mFormYTextBox.left = 300 -$mFormYTextBox.top = 5 -$mFormYTextBox.Size = New-Object System.Drawing.Size(30,23) -$mFormYTextBox.Anchor = 'Left,Top' -$mFormYTextBox.Text= 300 -$mFormYTextBox.Add_TextChanged({EditFormSize $mFormXTextBox.Text $mFormYTextBox.Text}) -$mForm.Controls.Add($mFormYTextBox) - -$mFormGroupBox = New-Object System.Windows.Forms.GroupBox -$mFormGroupBox.left = 350 -$mFormGroupBox.top = 5 -$mFormGroupBox.Anchor = 'Left,Top' -$mFormGroupBox.Size = New-Object System.Drawing.Size($mFormXTextBox.Text,$mFormYTextBox.Text) -$mFormGroupBox.Text = 'New Form' -$mForm.Controls.Add($mFormGroupBox) - -$mElemetnsGrid = New-Object System.Windows.Forms.DataGridView -$mElemetnsGrid.size = New-Object System.Drawing.Size(155,600) -$mElemetnsGrid.left=5 -$mElemetnsGrid.top=33 -$mElemetnsGrid.Anchor='Top,Left' -$mElemetnsGrid.RowHeadersVisible =$false -$mElemetnsGrid.Add_CellContentClick({ElementsChanged}) -$mElemetnsGrid.Add_CellEndEdit({ElementsEndEdit}) -$mForm.Controls.Add($mElemetnsGrid) - -$mPropertiesGrid = New-Object System.Windows.Forms.DataGridView -$mPropertiesGrid.size = New-Object System.Drawing.Size(155,600) -$mPropertiesGrid.left=180 -$mPropertiesGrid.top=33 -$mPropertiesGrid.Anchor='Top,Left' -$mPropertiesGrid.ColumnHeadersVisible=$true -$mPropertiesGrid.RowHeadersVisible =$false -$mPropertiesGrid.Add_CellEndEdit({PropertiesEndEdit}) -$mForm.Controls.Add($mPropertiesGrid) - -$mDeleteButton = New-Object System.Windows.Forms.Button -$mDeleteButton.size = New-Object System.Drawing.Size(155,23) -$mDeleteButton.Text = 'Delete' -$mDeleteButton.Left = 5 -$mDeleteButton.Top = 638 -$mDeleteButton.Anchor = 'Top,Left' -$mDeleteButton.Add_Click({DeleteElement}) -$mForm.Controls.Add($mDeleteButton) - -$mExportButton = New-Object System.Windows.Forms.Button -$mExportButton.size = New-Object System.Drawing.Size(155,23) -$mExportButton.text = 'Export' -$mExportButton.Left = 180 -$mExportButton.top = 638 -$mExportButton.Anchor='Top,Left' -$mExportButton.Add_Click({ExportForm}) -$mForm.Controls.Add($mExportButton) - -$Global:mFormObj = new-object PSCustomObject -$Global:mFormObj | Add-Member -Name 'SizeX' -MemberType NoteProperty -Value 300 -$Global:mFormObj | Add-Member -Name 'SizeY' -MemberType NoteProperty -Value 300 -$Global:mFormObj | Add-Member -Name 'Elements' -MemberType NoteProperty -Value @() -$Global:mCurFirstX =0 -$Global:mCurFirstY =0 - -$mForm.ShowDialog() \ No newline at end of file diff --git a/dump/SCCM-Tool/Forms/_Form-Template.Export-BLANK.ps1 b/dump/SCCM-Tool/Forms/_Form-Template.Export-BLANK.ps1 deleted file mode 100644 index 4926604..0000000 --- a/dump/SCCM-Tool/Forms/_Form-Template.Export-BLANK.ps1 +++ /dev/null @@ -1,208 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - $PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - $PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - $Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - $Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - $Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - $PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - $PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - $PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - $PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - $form1.Controls.Add($PanelEventLogs_Events) - $form1.Controls.Add($PanelEventLogs_Filter) - - - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1200, 780' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- - - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) - - # - # $Text_ELogs_ServerName - # - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - # - #Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-10x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-10x.ps1 deleted file mode 100644 index ff3c895..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-10x.ps1 +++ /dev/null @@ -1,948 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - - $Script:Output_Left = New-Object System.Windows.Forms.TextBox - $Script:Output_Right = New-Object System.Windows.Forms.TextBox - - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_CollectionName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime_Value = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount_Value = New-Object 'System.Windows.Forms.Label' - - $label_ServersResponding = New-Object 'System.Windows.Forms.Label' - $label_ServersResponding_Value = New-Object 'System.Windows.Forms.Label' - $label_ServersNOTResponding = New-Object 'System.Windows.Forms.Label' - $label_ServersNOTResponding_Value = New-Object 'System.Windows.Forms.Label' - $label_ServersPinging = New-Object 'System.Windows.Forms.Label' - $label_ServersPinging_Value = New-Object 'System.Windows.Forms.Label' - - - #$Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:DeviceCollection_ServerNames1 = "" - - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - $T = Get-CMDeviceCollection -Name $Script:Collection_DropDownBox.text | select Name,MemberCount - - $label_DeviceCount_Value.Text = $T.MemberCount - - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Reset-Forms -Form_Selection 1 - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - - - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function Reset-Forms { - Param($Form_Selection) - - Switch ($Form_Selection) { - 1 { $Collection_DropDownBox.Items.Clear(); $Collection_DropDownBox.Text = "--Deployed to Collections--" } - 2 {} - - } - - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - $Script:Output_Left.Clear() - $Script:Output_Right.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - #$Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Collection_Name = $Script:Collection_DropDownBox.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Collection----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - NA-Set-Stage -Select_Stage OutputStage2 - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - # $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Collection-Members { - Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient - - } - -############################################################################################################################################################# - Function NA-Set-Stage { - Param($Select_Stage) - Switch($Select_Stage) { - OutputStage1 { $Script:Output.Visible = $false - $Script:Output_Left.Visible = $True - $Script:Output_Right.Visible = $True - $label_ServersResponding.Visible = $True - $label_ServersResponding_Value.Visible = $True - $label_ServersNOTResponding.Visible = $True - $label_ServersNOTResponding_Value.Visible = $True - $label_ServersPinging.Visible = $True - $label_ServersPinging_Value.Visible = $True - - - #Write-Host "output-stage1" -ForegroundColor Yellow - } - OutputStage2 { $Script:Output.Visible = $True - $label_ServersResponding.Visible = $false - $label_ServersResponding_Value.Visible = $false - $label_ServersNOTResponding.Visible = $False - $label_ServersNOTResponding_Value.Visible = $false - $Script:Output_Left.Visible = $false - $Script:Output_Right.Visible = $false - $label_ServersPinging.Visible = $false - $label_ServersPinging_Value.Visible = $false - } - test { $Script:Output.Text = "inside na set stage function"} - }#endSwitch - $Script:Output.Text = "outside switch inside na set stage function - param: $Select_Stage" - - - - }#endFunction -############################################################################################################################################################# - - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - - NA-Set-Stage -Select_Stage OutputStage1 - #$Script:Output.Visible = $false - #$Script:Output_Left.Visible = $True - #$Script:Output_Right.Visible = $True - - - $Global:DeviceCollection_ServerNames1 = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - #Set-Location c: - - Write-Host "Total Server Count: $($Global:DeviceCollection_ServerNames1.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Global:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $label_ServersPinging_Value.Text = $Server - $Obj = New-Object -TypeName PSObject - $Count = $Global:DeviceCollection_ServerNames1.count - #$Script:Output.Text = "Checking: $Server ----- Servers left: $($Count--) Please Wait !!!" | Out-String - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - #$Responding += $Server - $Responding += $Obj - # $Script:Output.text += $Obj | Out-String - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - #$NotResponding += $Server - $NotResponding += $Obj - # $Script:Output.text += $Obj | Out-String - } - }#end% - #$Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - $Script:Output_Left.Text = $Responding | Out-String - $Script:Output_Right.Text = $NotResponding | Out-String - - $label_ServersPinging_Value.Text = "Done !" - $label_ServersResponding_Value.Text = $Responding.Count - $label_ServersNOTResponding_Value.Text = $NotResponding.Count - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Global:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Global:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } | Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T | % { $Script:Collection_DropDownBox.Items.Add("$_")} - } - -############################################################################################################################################################# - Function Test-Service { - - $Script:Output.Text = "test-service function" - #$T = Get-Service - #$Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Output_Left.remove_TextChanged($Script:Output_Left_TextChanged) - $Script:Output_Right.remove_TextChanged($Script:Output_Right_TextChanged) - - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Script:Output) - $form1.Controls.Add($Script:Output_Left) - $form1.Controls.Add($Script:Output_Right) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_CollectionName_Value) - $form1.Controls.Add($label_DeploymentName) - $form1.controls.Add($label_DeploymentName_Value) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeploymentTime_Value) - $form1.Controls.Add($label_DeviceCount) - $form1.Controls.Add($label_DeviceCount_Value) - $form1.Controls.Add($label_ServersResponding) - $form1.Controls.Add($label_ServersResponding_Value) - $form1.Controls.Add($label_ServersNOTResponding) - $form1.Controls.Add($label_ServersNOTResponding_Value) - $form1.Controls.Add($label_ServersPinging) - $form1.Controls.Add($label_ServersPinging_Value) - - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Script:Output.Location = '10, 250' - $Script:Output.Multiline = $True - $Script:Output.Name = 'Output' - $Script:Output.ScrollBars = 'both' - $Script:Output.Size = '965, 500' - $Script:Output.Font = 'Consolas, 8.25pt' - $Script:Output.WordWrap = $False - $Script:Output.TabIndex = 5 - $Script:Output.add_TextChanged($Output_TextChanged) - $Script:Output.Visible = $True - # - $Script:Output_Left.Location = '20, 250' - $Script:Output_Left.Multiline = $True - $Script:Output_Left.Name = 'Output_Left' - $Script:Output_Left.ScrollBars = 'both' - $Script:Output_Left.Size = '470, 500' - $Script:Output_Left.Font = 'Consolas, 8.25pt' - $Script:Output_Left.WordWrap = $False - #$Script:Output_Left.TabIndex = 5 - - $Script:Output_Left.add_TextChanged($Output_Left_TextChanged) - # - $Script:Output_Right.Location = '510, 250' - $Script:Output_Right.Multiline = $True - $Script:Output_Right.Name = 'Output_Right' - $Script:Output_Right.ScrollBars = 'both' - $Script:Output_Right.Size = '470, 500' - $Script:Output_Right.Font = 'Consolas, 8.25pt' - $Script:Output_Right.WordWrap = $False - #$Script:Output_Right.TabIndex = 5 - $Script:Output_Right.add_TextChanged($Output_Right_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '580,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = ('150,90') #New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '670,25' - $GroupBox_Info.Size = '300,160' - $GroupBox_Info.Text = "Deployment Info" - ############ - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_CollectionName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeploymentTime_Value) - $GroupBox_Info.Controls.Add($label_DeviceCount) - $GroupBox_Info.Controls.Add($label_DeviceCount_Value) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 9.0pt' #, style=Bold' - #$label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - - ############ Value ############### - $label_CollectionName_Value.AutoSize = $True - $label_CollectionName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName_Value.ForeColor = 'DarkGreen' - #$label_CollectionName_Value.TextAlign = 'MiddleRight' - $label_CollectionName_Value.Location = '140,25' - $label_CollectionName_Value.Name = 'Collection_Name_Value' - $label_CollectionName_Value.Size = '41, 13' - #$label_CollectionName_Value.TabIndex = 6 - $label_CollectionName_Value.Text = '_' - #$label_CollectionName_Value.add_Click($label_CollectionName_Value_Click) - - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - - ############ Value ############ - $label_DeploymentName_Value.AutoSize = $True - $label_DeploymentName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName_Value.ForeColor = 'DarkGreen' - #$label_DeploymentName_Value.TextAlign = 'MiddleRight' - $label_DeploymentName_Value.Location = '140,45' - $label_DeploymentName_Value.Name = 'Deployment_Name_Value' - $label_DeploymentName_Value.Size = '41, 13' - #$label_DeploymentName_Value.TabIndex = 6 - $label_DeploymentName_Value.Text = '_' - #$label_DeploymentName_Value.add_Click($label_DeploymentName_Value_Click) - - ############# - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Deployment Time:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - - ############ Value ############ - $label_DeploymentTime_Value.AutoSize = $True - $label_DeploymentTime_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime_Value.ForeColor = 'DarkGreen' - #$label_DeploymentTime_Value.TextAlign = 'MiddleRight' - $label_DeploymentTime_Value.Location = '140,65' - $label_DeploymentTime_Value.Name = 'Deployment_Time_Value' - $label_DeploymentTime_Value.Size = '41, 13' - #$label_DeploymentTime_Value.TabIndex = 6 - $label_DeploymentTime_Value.Text = '_' - #$label_DeploymentTime_Value.add_Click($label_DeploymentTime_Value_Click) - - ########### - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - - ############ Value ############ - $label_DeviceCount_Value.AutoSize = $True - $label_DeviceCount_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount_Value.ForeColor = 'DarkGreen' - #$label_DeviceCount_Value.TextAlign = 'MiddleRight' - $label_DeviceCount_Value.Location = '140,85' - $label_DeviceCount_Value.Name = 'Device_Count_Value' - $label_DeviceCount_Value.Size = '41, 13' - #$label_DeviceCount_Value.TabIndex = 6 - $label_DeviceCount_Value.Text = '_' - #$label_DeviceCount_Value.add_Click($label_DeviceCount_Value_Click) -############ - $label_ServersResponding.AutoSize = $True - $label_ServersResponding.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersResponding.ForeColor = 'DarkGreen' - #$label_ServersResponding.TextAlign = 'MiddleRight' - $label_ServersResponding.Location = '15,225' - $label_ServersResponding.Name = 'Servers Responding' - $label_ServersResponding.Size = '41, 13' - #$label_ServersResponding.TabIndex = 6 - $label_ServersResponding.Text = 'Servers Responding: ' - $label_ServersResponding.Visible = $False - #$label_ServersResponding.add_Click($label_ServersResponding_Click) -############ - $label_ServersResponding_Value.AutoSize = $True - $label_ServersResponding_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersResponding_Value.ForeColor = 'DarkGreen' - #$label_ServersResponding.TextAlign = 'MiddleRight' - $label_ServersResponding_Value.Location = '155,225' - $label_ServersResponding_Value.Name = 'Servers Responding Vlue' - $label_ServersResponding_Value.Size = '41, 13' - #$label_ServersResponding_Value.TabIndex = 6 - $label_ServersResponding_Value.Text = '-' - $label_ServersResponding_Value.Visible = $False - #$label_ServersResponding_Value.add_Click($label_ServersResponding_Value_Click) -############ -$label_ServersNOTResponding.AutoSize = $True - $label_ServersNOTResponding.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersNOTResponding.ForeColor = 'Red' - #$label_ServersNOTResponding.TextAlign = 'MiddleRight' - $label_ServersNOTResponding.Location = '510,225' - $label_ServersNOTResponding.Name = 'Servers Not Responding' - $label_ServersNOTResponding.Size = '41, 13' - #$label_ServersNOTResponding.TabIndex = 6 - $label_ServersNOTResponding.Text = 'Servers NOT Responding: ' - $label_ServersNOTResponding.Visible = $False - #$label_ServersNOTResponding.add_Click($label_ServersNOTResponding_Click) -############ -$label_ServersNOTResponding_Value.AutoSize = $True - $label_ServersNOTResponding_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersNOTResponding_Value.ForeColor = 'Red' - #$label_ServersNOTResponding_Value.TextAlign = 'MiddleRight' - $label_ServersNOTResponding_Value.Location = '670,225' - $label_ServersNOTResponding_Value.Name = 'Servers Not Responding Value' - $label_ServersNOTResponding_Value.Size = '41, 13' - #$label_ServersNOTResponding_Value.TabIndex = 6 - $label_ServersNOTResponding_Value.Text = '- ' - $label_ServersNOTResponding_Value.Visible = $False - #$label_ServersNOTResponding_Value.add_Click($label_ServersNOTResponding_Value_Click) -############ -$label_ServersPinging.AutoSize = $True - $label_ServersPinging.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersPinging.ForeColor = 'Green' - #$label_ServersPinging.TextAlign = 'MiddleRight' - $label_ServersPinging.Location = '15,210' - $label_ServersPinging.Name = 'Servers Pinging' - $label_ServersPinging.Size = '41, 13' - #$label_ServersPinging.TabIndex = 6 - $label_ServersPinging.Text = 'Checking Servers: ' - $label_ServersPinging.Visible = $False - #$label_ServersPinging.add_Click($label_ServersPinging_Click) -############ -$label_ServersPinging_Value.AutoSize = $True - $label_ServersPinging_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersPinging_Value.ForeColor = 'Green' - #$label_ServersPinging_Value.TextAlign = 'MiddleRight' - $label_ServersPinging_Value.Location = '165,210' - $label_ServersPinging_Value.Name = 'Servers Pinging Value' - $label_ServersPinging_Value.Size = '41, 13' - $label_ServersPinging_Value.Text = '- ' - $label_ServersPinging_Value.Visible = $False - #$label_ServersPinging_Value.add_Click($label_ServersPinging_Value_Click) -############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-11x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-11x.ps1 deleted file mode 100644 index dbaffea..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-11x.ps1 +++ /dev/null @@ -1,960 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - - $Script:Output_Left = New-Object System.Windows.Forms.TextBox - $Script:Output_Right = New-Object System.Windows.Forms.TextBox - - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_CollectionName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime_Value = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount_Value = New-Object 'System.Windows.Forms.Label' - - $label_ServersResponding = New-Object 'System.Windows.Forms.Label' - $label_ServersResponding_Value = New-Object 'System.Windows.Forms.Label' - $label_ServersNOTResponding = New-Object 'System.Windows.Forms.Label' - $label_ServersNOTResponding_Value = New-Object 'System.Windows.Forms.Label' - $label_ServersPinging = New-Object 'System.Windows.Forms.Label' - $label_ServersPinging_Value = New-Object 'System.Windows.Forms.Label' - - - #$Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:DeviceCollection_ServerNames1 = "" - - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - $T = Get-CMDeviceCollection -Name $Script:Collection_DropDownBox.text | select Name,MemberCount - - $Info = $Global:Deployments | ? { $_.applicationname -eq "$($Script:Deployment_DropDownBox.text)" -and $_.collectionname -eq "$($Script:Collection_DropDownBox.text)" } | select applicationname,collectionname,deploymenttime - - $label_DeploymentName_Value.Text = $Info.ApplicationName - $label_DeploymentTime_Value.Text = $Info.DeploymentTime - $label_CollectionName_Value.Text = $Script:Collection_DropDownBox.Text #$T.CollectionName - - $label_DeviceCount_Value.Text = $T.MemberCount - - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Reset-Forms -Form_Selection 1 - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - - - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function Reset-Forms { - Param($Form_Selection) - - Switch ($Form_Selection) { - 1 { $Collection_DropDownBox.Items.Clear(); $Collection_DropDownBox.Text = "--Deployed to Collections--" } - 2 {} - - } - - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - $Script:Output_Left.Clear() - $Script:Output_Right.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - #$Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Collection_Name = $Script:Collection_DropDownBox.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - #$Script:Collection_DropDownBox.BackColor - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - - $Script:Output.Text = "CollectionName: $Global:Collection_Name ----- SelectTool: $Global:Select_Tool" - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Collection----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - NA-Set-Stage -Select_Stage OutputStage2 - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - # $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Collection-Members { - Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient - - } - -############################################################################################################################################################# - Function NA-Set-Stage { - Param($Select_Stage) - Switch($Select_Stage) { - OutputStage1 { $Script:Output.Visible = $false - $Script:Output_Left.Visible = $True - $Script:Output_Right.Visible = $True - $label_ServersResponding.Visible = $True - $label_ServersResponding_Value.Visible = $True - $label_ServersNOTResponding.Visible = $True - $label_ServersNOTResponding_Value.Visible = $True - $label_ServersPinging.Visible = $True - $label_ServersPinging_Value.Visible = $True - - - #Write-Host "output-stage1" -ForegroundColor Yellow - } - OutputStage2 { $Script:Output.Visible = $True - $label_ServersResponding.Visible = $false - $label_ServersResponding_Value.Visible = $false - $label_ServersNOTResponding.Visible = $False - $label_ServersNOTResponding_Value.Visible = $false - $Script:Output_Left.Visible = $false - $Script:Output_Right.Visible = $false - $label_ServersPinging.Visible = $false - $label_ServersPinging_Value.Visible = $false - } - test { $Script:Output.Text = "inside na set stage function"} - }#endSwitch - $Script:Output.Text = "outside switch inside na set stage function - param: $Select_Stage" - - - - }#endFunction -############################################################################################################################################################# - - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - - NA-Set-Stage -Select_Stage OutputStage1 - #$Script:Output.Visible = $false - #$Script:Output_Left.Visible = $True - #$Script:Output_Right.Visible = $True - - - $Global:DeviceCollection_ServerNames1 = Collection-Members -CollectionName $Global:Collection_Name | select Name #Get-CMCollectionMember - #Set-Location c: - - Write-Host "Total Server Count: $($Global:DeviceCollection_ServerNames1.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Global:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $label_ServersPinging_Value.Text = $Server - $Obj = New-Object -TypeName PSObject - $Count = $Global:DeviceCollection_ServerNames1.count - #$Script:Output.Text = "Checking: $Server ----- Servers left: $($Count--) Please Wait !!!" | Out-String - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - #$Responding += $Server - $Responding += $Obj - # $Script:Output.text += $Obj | Out-String - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - #$NotResponding += $Server - $NotResponding += $Obj - # $Script:Output.text += $Obj | Out-String - } - - $label_ServersResponding_Value.Text = $Responding.Count - $label_ServersNOTResponding_Value.Text = $NotResponding.Count - - }#end% - #$Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - $Script:Output_Left.Text = $Responding | Out-String - $Script:Output_Right.Text = $NotResponding | Out-String - - $label_ServersPinging_Value.Text = "Done !" - - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Global:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Global:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } #| Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T.CollectionName | % { $Script:Collection_DropDownBox.Items.Add("$_")} - - - } - -############################################################################################################################################################# - Function Test-Service { - - $Script:Output.Text = "test-service function" - #$T = Get-Service - #$Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Output_Left.remove_TextChanged($Script:Output_Left_TextChanged) - $Script:Output_Right.remove_TextChanged($Script:Output_Right_TextChanged) - - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Script:Output) - $form1.Controls.Add($Script:Output_Left) - $form1.Controls.Add($Script:Output_Right) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_CollectionName_Value) - $form1.Controls.Add($label_DeploymentName) - $form1.controls.Add($label_DeploymentName_Value) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeploymentTime_Value) - $form1.Controls.Add($label_DeviceCount) - $form1.Controls.Add($label_DeviceCount_Value) - $form1.Controls.Add($label_ServersResponding) - $form1.Controls.Add($label_ServersResponding_Value) - $form1.Controls.Add($label_ServersNOTResponding) - $form1.Controls.Add($label_ServersNOTResponding_Value) - $form1.Controls.Add($label_ServersPinging) - $form1.Controls.Add($label_ServersPinging_Value) - - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Script:Output.Location = '10, 250' - $Script:Output.Multiline = $True - $Script:Output.Name = 'Output' - $Script:Output.ScrollBars = 'both' - $Script:Output.Size = '965, 500' - $Script:Output.Font = 'Consolas, 8.25pt' - $Script:Output.WordWrap = $False - $Script:Output.TabIndex = 5 - $Script:Output.add_TextChanged($Output_TextChanged) - $Script:Output.Visible = $True - # - $Script:Output_Left.Location = '20, 250' - $Script:Output_Left.Multiline = $True - $Script:Output_Left.Name = 'Output_Left' - $Script:Output_Left.ScrollBars = 'both' - $Script:Output_Left.Size = '470, 500' - $Script:Output_Left.Font = 'Consolas, 8.25pt' - $Script:Output_Left.WordWrap = $False - #$Script:Output_Left.TabIndex = 5 - - $Script:Output_Left.add_TextChanged($Output_Left_TextChanged) - # - $Script:Output_Right.Location = '510, 250' - $Script:Output_Right.Multiline = $True - $Script:Output_Right.Name = 'Output_Right' - $Script:Output_Right.ScrollBars = 'both' - $Script:Output_Right.Size = '470, 500' - $Script:Output_Right.Font = 'Consolas, 8.25pt' - $Script:Output_Right.WordWrap = $False - #$Script:Output_Right.TabIndex = 5 - $Script:Output_Right.add_TextChanged($Output_Right_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '500,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = ('150,90') #New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '570,25' - $GroupBox_Info.Size = '410,160' - $GroupBox_Info.Text = "Deployment Info" - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_CollectionName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeploymentTime_Value) - $GroupBox_Info.Controls.Add($label_DeviceCount) - $GroupBox_Info.Controls.Add($label_DeviceCount_Value) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 9.0pt' #, style=Bold' - #$label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - - ############ Value ############### - $label_CollectionName_Value.AutoSize = $True - $label_CollectionName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName_Value.ForeColor = 'DarkGreen' - #$label_CollectionName_Value.TextAlign = 'MiddleRight' - $label_CollectionName_Value.Location = '140,25' - $label_CollectionName_Value.Name = 'Collection_Name_Value' - $label_CollectionName_Value.Size = '41, 13' - #$label_CollectionName_Value.TabIndex = 6 - $label_CollectionName_Value.Text = '_' - #$label_CollectionName_Value.add_Click($label_CollectionName_Value_Click) - - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - - ############ Value ############ - $label_DeploymentName_Value.AutoSize = $True - $label_DeploymentName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName_Value.ForeColor = 'DarkGreen' - #$label_DeploymentName_Value.TextAlign = 'MiddleRight' - $label_DeploymentName_Value.Location = '140,45' - $label_DeploymentName_Value.Name = 'Deployment_Name_Value' - $label_DeploymentName_Value.Size = '41, 13' - #$label_DeploymentName_Value.TabIndex = 6 - $label_DeploymentName_Value.Text = '_' - #$label_DeploymentName_Value.add_Click($label_DeploymentName_Value_Click) - - ############# - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Deployment Time:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - - ############ Value ############ - $label_DeploymentTime_Value.AutoSize = $True - $label_DeploymentTime_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime_Value.ForeColor = 'DarkGreen' - #$label_DeploymentTime_Value.TextAlign = 'MiddleRight' - $label_DeploymentTime_Value.Location = '140,65' - $label_DeploymentTime_Value.Name = 'Deployment_Time_Value' - $label_DeploymentTime_Value.Size = '41, 13' - #$label_DeploymentTime_Value.TabIndex = 6 - $label_DeploymentTime_Value.Text = '_' - #$label_DeploymentTime_Value.add_Click($label_DeploymentTime_Value_Click) - - ########### - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - - ############ Value ############ - $label_DeviceCount_Value.AutoSize = $True - $label_DeviceCount_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount_Value.ForeColor = 'DarkGreen' - #$label_DeviceCount_Value.TextAlign = 'MiddleRight' - $label_DeviceCount_Value.Location = '140,85' - $label_DeviceCount_Value.Name = 'Device_Count_Value' - $label_DeviceCount_Value.Size = '41, 13' - #$label_DeviceCount_Value.TabIndex = 6 - $label_DeviceCount_Value.Text = '_' - #$label_DeviceCount_Value.add_Click($label_DeviceCount_Value_Click) -############ - $label_ServersResponding.AutoSize = $True - $label_ServersResponding.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersResponding.ForeColor = 'DarkGreen' - #$label_ServersResponding.TextAlign = 'MiddleRight' - $label_ServersResponding.Location = '15,225' - $label_ServersResponding.Name = 'Servers Responding' - $label_ServersResponding.Size = '41, 13' - #$label_ServersResponding.TabIndex = 6 - $label_ServersResponding.Text = 'Servers Responding: ' - $label_ServersResponding.Visible = $False - #$label_ServersResponding.add_Click($label_ServersResponding_Click) -############ - $label_ServersResponding_Value.AutoSize = $True - $label_ServersResponding_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersResponding_Value.ForeColor = 'DarkGreen' - #$label_ServersResponding.TextAlign = 'MiddleRight' - $label_ServersResponding_Value.Location = '155,225' - $label_ServersResponding_Value.Name = 'Servers Responding Vlue' - $label_ServersResponding_Value.Size = '41, 13' - #$label_ServersResponding_Value.TabIndex = 6 - $label_ServersResponding_Value.Text = '-' - $label_ServersResponding_Value.Visible = $False - #$label_ServersResponding_Value.add_Click($label_ServersResponding_Value_Click) -############ -$label_ServersNOTResponding.AutoSize = $True - $label_ServersNOTResponding.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersNOTResponding.ForeColor = 'Red' - #$label_ServersNOTResponding.TextAlign = 'MiddleRight' - $label_ServersNOTResponding.Location = '510,225' - $label_ServersNOTResponding.Name = 'Servers Not Responding' - $label_ServersNOTResponding.Size = '41, 13' - #$label_ServersNOTResponding.TabIndex = 6 - $label_ServersNOTResponding.Text = 'Servers NOT Responding: ' - $label_ServersNOTResponding.Visible = $False - #$label_ServersNOTResponding.add_Click($label_ServersNOTResponding_Click) -############ -$label_ServersNOTResponding_Value.AutoSize = $True - $label_ServersNOTResponding_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersNOTResponding_Value.ForeColor = 'Red' - #$label_ServersNOTResponding_Value.TextAlign = 'MiddleRight' - $label_ServersNOTResponding_Value.Location = '670,225' - $label_ServersNOTResponding_Value.Name = 'Servers Not Responding Value' - $label_ServersNOTResponding_Value.Size = '41, 13' - #$label_ServersNOTResponding_Value.TabIndex = 6 - $label_ServersNOTResponding_Value.Text = '- ' - $label_ServersNOTResponding_Value.Visible = $False - #$label_ServersNOTResponding_Value.add_Click($label_ServersNOTResponding_Value_Click) -############ -$label_ServersPinging.AutoSize = $True - $label_ServersPinging.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersPinging.ForeColor = 'Green' - #$label_ServersPinging.TextAlign = 'MiddleRight' - $label_ServersPinging.Location = '15,210' - $label_ServersPinging.Name = 'Servers Pinging' - $label_ServersPinging.Size = '41, 13' - #$label_ServersPinging.TabIndex = 6 - $label_ServersPinging.Text = 'Checking Servers: ' - $label_ServersPinging.Visible = $False - #$label_ServersPinging.add_Click($label_ServersPinging_Click) -############ -$label_ServersPinging_Value.AutoSize = $True - $label_ServersPinging_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersPinging_Value.ForeColor = 'Green' - #$label_ServersPinging_Value.TextAlign = 'MiddleRight' - $label_ServersPinging_Value.Location = '165,210' - $label_ServersPinging_Value.Name = 'Servers Pinging Value' - $label_ServersPinging_Value.Size = '41, 13' - $label_ServersPinging_Value.Text = '- ' - $label_ServersPinging_Value.Visible = $False - #$label_ServersPinging_Value.add_Click($label_ServersPinging_Value_Click) -############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-12x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-12x.ps1 deleted file mode 100644 index 67b53de..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-12x.ps1 +++ /dev/null @@ -1,960 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - - $Script:Output_Left = New-Object System.Windows.Forms.TextBox - $Script:Output_Right = New-Object System.Windows.Forms.TextBox - - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_CollectionName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime_Value = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount_Value = New-Object 'System.Windows.Forms.Label' - - $label_ServersResponding = New-Object 'System.Windows.Forms.Label' - $label_ServersResponding_Value = New-Object 'System.Windows.Forms.Label' - $label_ServersNOTResponding = New-Object 'System.Windows.Forms.Label' - $label_ServersNOTResponding_Value = New-Object 'System.Windows.Forms.Label' - $label_ServersPinging = New-Object 'System.Windows.Forms.Label' - $label_ServersPinging_Value = New-Object 'System.Windows.Forms.Label' - - - #$Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:DeviceCollection_ServerNames1 = "" - - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - $T = Get-CMDeviceCollection -Name $Script:Collection_DropDownBox.text | select Name,MemberCount - - $Info = $Global:Deployments | ? { $_.applicationname -eq "$($Script:Deployment_DropDownBox.text)" -and $_.collectionname -eq "$($Script:Collection_DropDownBox.text)" } | select applicationname,collectionname,deploymenttime - - $label_DeploymentName_Value.Text = $Info.ApplicationName - $label_DeploymentTime_Value.Text = $Info.DeploymentTime - $label_CollectionName_Value.Text = $Script:Collection_DropDownBox.Text #$T.CollectionName - - $label_DeviceCount_Value.Text = $T.MemberCount - - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Reset-Forms -Form_Selection 1 - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - - - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function Reset-Forms { - Param($Form_Selection) - - Switch ($Form_Selection) { - 1 { $Collection_DropDownBox.Items.Clear(); $Collection_DropDownBox.Text = "--Deployed to Collections--" } - 2 {} - - } - - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - $Script:Output_Left.Clear() - $Script:Output_Right.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - #$Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Collection_Name = $Script:Collection_DropDownBox.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - #$Script:Collection_DropDownBox.BackColor - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - - $Script:Output.Text = "CollectionName: $Global:Collection_Name ----- SelectTool: $Global:Select_Tool" - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Collection----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - NA-Set-Stage -Select_Stage OutputStage2 - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - # $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Collection-Members { - Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient - - } - -############################################################################################################################################################# - Function NA-Set-Stage { - Param($Select_Stage) - Switch($Select_Stage) { - OutputStage1 { $Script:Output.Visible = $false - $Script:Output_Left.Visible = $True - $Script:Output_Right.Visible = $True - $label_ServersResponding.Visible = $True - $label_ServersResponding_Value.Visible = $True - $label_ServersNOTResponding.Visible = $True - $label_ServersNOTResponding_Value.Visible = $True - $label_ServersPinging.Visible = $True - $label_ServersPinging_Value.Visible = $True - - - #Write-Host "output-stage1" -ForegroundColor Yellow - } - OutputStage2 { $Script:Output.Visible = $True - $label_ServersResponding.Visible = $false - $label_ServersResponding_Value.Visible = $false - $label_ServersNOTResponding.Visible = $False - $label_ServersNOTResponding_Value.Visible = $false - $Script:Output_Left.Visible = $false - $Script:Output_Right.Visible = $false - $label_ServersPinging.Visible = $false - $label_ServersPinging_Value.Visible = $false - } - test { $Script:Output.Text = "inside na set stage function"} - }#endSwitch - $Script:Output.Text = "outside switch inside na set stage function - param: $Select_Stage" - - - - }#endFunction -############################################################################################################################################################# - - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - NA-Set-Stage -Select_Stage OutputStage1 - - $Global:DeviceCollection_ServerNames1 = Collection-Members -CollectionName $Global:Collection_Name | select Name #Get-CMCollectionMember - #Set-Location c: - - Write-Host "Total Server Count: $($Global:DeviceCollection_ServerNames1.count)" -ForegroundColor Green - Write-Host "" - - If($Script:Collection_DropDownBox.Text -like "-*") { - $Script:Collection_DropDownBox.BackColor = 'red' - } - - Else { - $Script:Collection_DropDownBox.BackColor = 'white' - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Global:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $label_ServersPinging_Value.Text = $Server - $Obj = New-Object -TypeName PSObject - $Count = $Global:DeviceCollection_ServerNames1.count - #$Script:Output.Text = "Checking: $Server ----- Servers left: $($Count--) Please Wait !!!" | Out-String - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - #$Responding += $Server - $Responding += $Obj - # $Script:Output.text += $Obj | Out-String - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - #$NotResponding += $Server - $NotResponding += $Obj - # $Script:Output.text += $Obj | Out-String - } - - $label_ServersResponding_Value.Text = $Responding.Count - $label_ServersNOTResponding_Value.Text = $NotResponding.Count - - }#end% - #$Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - $Script:Output_Left.Text = $Responding | Out-String - $Script:Output_Right.Text = $NotResponding | Out-String - - $label_ServersPinging_Value.Text = "Done !" - - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - - }#endElse - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - NA-Set-Stage -Select_Stage OutputStage2 - $Global:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Global:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } #| Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T.CollectionName | % { $Script:Collection_DropDownBox.Items.Add("$_")} - - - } - -############################################################################################################################################################# - Function Test-Service { - - $Script:Output.Text = "test-service function" - #$T = Get-Service - #$Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Output_Left.remove_TextChanged($Script:Output_Left_TextChanged) - $Script:Output_Right.remove_TextChanged($Script:Output_Right_TextChanged) - - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Script:Output) - $form1.Controls.Add($Script:Output_Left) - $form1.Controls.Add($Script:Output_Right) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_CollectionName_Value) - $form1.Controls.Add($label_DeploymentName) - $form1.controls.Add($label_DeploymentName_Value) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeploymentTime_Value) - $form1.Controls.Add($label_DeviceCount) - $form1.Controls.Add($label_DeviceCount_Value) - $form1.Controls.Add($label_ServersResponding) - $form1.Controls.Add($label_ServersResponding_Value) - $form1.Controls.Add($label_ServersNOTResponding) - $form1.Controls.Add($label_ServersNOTResponding_Value) - $form1.Controls.Add($label_ServersPinging) - $form1.Controls.Add($label_ServersPinging_Value) - - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Script:Output.Location = '10, 250' - $Script:Output.Multiline = $True - $Script:Output.Name = 'Output' - $Script:Output.ScrollBars = 'both' - $Script:Output.Size = '965, 500' - $Script:Output.Font = 'Consolas, 8.25pt' - $Script:Output.WordWrap = $False - $Script:Output.TabIndex = 5 - $Script:Output.add_TextChanged($Output_TextChanged) - $Script:Output.Visible = $True - # - $Script:Output_Left.Location = '20, 250' - $Script:Output_Left.Multiline = $True - $Script:Output_Left.Name = 'Output_Left' - $Script:Output_Left.ScrollBars = 'both' - $Script:Output_Left.Size = '470, 500' - $Script:Output_Left.Font = 'Consolas, 8.25pt' - $Script:Output_Left.WordWrap = $False - #$Script:Output_Left.TabIndex = 5 - - $Script:Output_Left.add_TextChanged($Output_Left_TextChanged) - # - $Script:Output_Right.Location = '510, 250' - $Script:Output_Right.Multiline = $True - $Script:Output_Right.Name = 'Output_Right' - $Script:Output_Right.ScrollBars = 'both' - $Script:Output_Right.Size = '470, 500' - $Script:Output_Right.Font = 'Consolas, 8.25pt' - $Script:Output_Right.WordWrap = $False - #$Script:Output_Right.TabIndex = 5 - $Script:Output_Right.add_TextChanged($Output_Right_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '500,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = ('150,90') #New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '570,25' - $GroupBox_Info.Size = '410,160' - $GroupBox_Info.Text = "Deployment Info" - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_CollectionName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeploymentTime_Value) - $GroupBox_Info.Controls.Add($label_DeviceCount) - $GroupBox_Info.Controls.Add($label_DeviceCount_Value) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 9.0pt' #, style=Bold' - #$label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - - ############ Value ############### - $label_CollectionName_Value.AutoSize = $True - $label_CollectionName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName_Value.ForeColor = 'DarkGreen' - #$label_CollectionName_Value.TextAlign = 'MiddleRight' - $label_CollectionName_Value.Location = '140,25' - $label_CollectionName_Value.Name = 'Collection_Name_Value' - $label_CollectionName_Value.Size = '41, 13' - #$label_CollectionName_Value.TabIndex = 6 - $label_CollectionName_Value.Text = '_' - #$label_CollectionName_Value.add_Click($label_CollectionName_Value_Click) - - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - - ############ Value ############ - $label_DeploymentName_Value.AutoSize = $True - $label_DeploymentName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName_Value.ForeColor = 'DarkGreen' - #$label_DeploymentName_Value.TextAlign = 'MiddleRight' - $label_DeploymentName_Value.Location = '140,45' - $label_DeploymentName_Value.Name = 'Deployment_Name_Value' - $label_DeploymentName_Value.Size = '41, 13' - #$label_DeploymentName_Value.TabIndex = 6 - $label_DeploymentName_Value.Text = '_' - #$label_DeploymentName_Value.add_Click($label_DeploymentName_Value_Click) - - ############# - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Deployment Time:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - - ############ Value ############ - $label_DeploymentTime_Value.AutoSize = $True - $label_DeploymentTime_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime_Value.ForeColor = 'DarkGreen' - #$label_DeploymentTime_Value.TextAlign = 'MiddleRight' - $label_DeploymentTime_Value.Location = '140,65' - $label_DeploymentTime_Value.Name = 'Deployment_Time_Value' - $label_DeploymentTime_Value.Size = '41, 13' - #$label_DeploymentTime_Value.TabIndex = 6 - $label_DeploymentTime_Value.Text = '_' - #$label_DeploymentTime_Value.add_Click($label_DeploymentTime_Value_Click) - - ########### - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count:' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - - ############ Value ############ - $label_DeviceCount_Value.AutoSize = $True - $label_DeviceCount_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount_Value.ForeColor = 'DarkGreen' - #$label_DeviceCount_Value.TextAlign = 'MiddleRight' - $label_DeviceCount_Value.Location = '140,85' - $label_DeviceCount_Value.Name = 'Device_Count_Value' - $label_DeviceCount_Value.Size = '41, 13' - #$label_DeviceCount_Value.TabIndex = 6 - $label_DeviceCount_Value.Text = '_' - #$label_DeviceCount_Value.add_Click($label_DeviceCount_Value_Click) -############ - $label_ServersResponding.AutoSize = $True - $label_ServersResponding.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersResponding.ForeColor = 'DarkGreen' - #$label_ServersResponding.TextAlign = 'MiddleRight' - $label_ServersResponding.Location = '15,225' - $label_ServersResponding.Name = 'Servers Responding' - $label_ServersResponding.Size = '41, 13' - #$label_ServersResponding.TabIndex = 6 - $label_ServersResponding.Text = 'Servers Responding: ' - $label_ServersResponding.Visible = $False - #$label_ServersResponding.add_Click($label_ServersResponding_Click) -############ - $label_ServersResponding_Value.AutoSize = $True - $label_ServersResponding_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersResponding_Value.ForeColor = 'DarkGreen' - #$label_ServersResponding.TextAlign = 'MiddleRight' - $label_ServersResponding_Value.Location = '155,225' - $label_ServersResponding_Value.Name = 'Servers Responding Vlue' - $label_ServersResponding_Value.Size = '41, 13' - #$label_ServersResponding_Value.TabIndex = 6 - $label_ServersResponding_Value.Text = '-' - $label_ServersResponding_Value.Visible = $False - #$label_ServersResponding_Value.add_Click($label_ServersResponding_Value_Click) -############ -$label_ServersNOTResponding.AutoSize = $True - $label_ServersNOTResponding.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersNOTResponding.ForeColor = 'Red' - #$label_ServersNOTResponding.TextAlign = 'MiddleRight' - $label_ServersNOTResponding.Location = '510,225' - $label_ServersNOTResponding.Name = 'Servers Not Responding' - $label_ServersNOTResponding.Size = '41, 13' - #$label_ServersNOTResponding.TabIndex = 6 - $label_ServersNOTResponding.Text = 'Servers NOT Responding: ' - $label_ServersNOTResponding.Visible = $False - #$label_ServersNOTResponding.add_Click($label_ServersNOTResponding_Click) -############ -$label_ServersNOTResponding_Value.AutoSize = $True - $label_ServersNOTResponding_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersNOTResponding_Value.ForeColor = 'Red' - #$label_ServersNOTResponding_Value.TextAlign = 'MiddleRight' - $label_ServersNOTResponding_Value.Location = '670,225' - $label_ServersNOTResponding_Value.Name = 'Servers Not Responding Value' - $label_ServersNOTResponding_Value.Size = '41, 13' - #$label_ServersNOTResponding_Value.TabIndex = 6 - $label_ServersNOTResponding_Value.Text = '- ' - $label_ServersNOTResponding_Value.Visible = $False - #$label_ServersNOTResponding_Value.add_Click($label_ServersNOTResponding_Value_Click) -############ -$label_ServersPinging.AutoSize = $True - $label_ServersPinging.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersPinging.ForeColor = 'Green' - #$label_ServersPinging.TextAlign = 'MiddleRight' - $label_ServersPinging.Location = '15,210' - $label_ServersPinging.Name = 'Servers Pinging' - $label_ServersPinging.Size = '41, 13' - #$label_ServersPinging.TabIndex = 6 - $label_ServersPinging.Text = 'Checking Servers: ' - $label_ServersPinging.Visible = $False - #$label_ServersPinging.add_Click($label_ServersPinging_Click) -############ -$label_ServersPinging_Value.AutoSize = $True - $label_ServersPinging_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_ServersPinging_Value.ForeColor = 'Green' - #$label_ServersPinging_Value.TextAlign = 'MiddleRight' - $label_ServersPinging_Value.Location = '165,210' - $label_ServersPinging_Value.Name = 'Servers Pinging Value' - $label_ServersPinging_Value.Size = '41, 13' - $label_ServersPinging_Value.Text = '- ' - $label_ServersPinging_Value.Visible = $False - #$label_ServersPinging_Value.add_Click($label_ServersPinging_Value_Click) -############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 5 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-2.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-2.ps1 deleted file mode 100644 index ef825ea..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-2.ps1 +++ /dev/null @@ -1,318 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent - -$Script:ALL_Patch_Servers = @() -$Script:Responding = @() -$Script:NotResponding = @() -$Global:Collection_Name = "" -$Global:Select_Tool -$Global:Output_Type = "" - -If(!(Get-PSDrive -Name SCCM-Drive -ErrorAction SilentlyContinue)) { - 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" -} -######################################################################################################################################################### -Function Start-Form { - - #$Global:Collection_Name = "" - #$Global:Select_Tool = "" - #$Global:Output_Type = "" - - $Temp = "" - - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - - $Form = New-Object System.Windows.Forms.Form - $Form.Size = New-Object System.Drawing.Size(1000,800) - ############################################## - #$Form_Load={ $Script:outputBox.text = "Welcome" } - ############################################## Start functions - <# function pingInfo { - - if ($RadioButton1.Checked -eq $true) {$nrOfPings=1} - if ($RadioButton2.Checked -eq $true) {$nrOfPings=2} - if ($RadioButton3.Checked -eq $true) {$nrOfPings=3} - - $computer=$DropDownBox.SelectedItem.ToString() #populate the var with the value you selected - $pingResult=ping $wks -n $nrOfPings | fl | out-string; - $Script:outputBox.text=$pingResult - - } #end pingInfo - #> - ############################################## end functions - Function SCCM-Module { - - If(!(Get-PSDrive).Name -eq "sccm-drive") { - 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" - }#endIf - CD sccm-drive: - }#endFunction - ############################################## - Function Update-Dropdown1 { - # $Collections += $textBox1.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Tool6","Tool7") - $Collections | % { $DropDownBox.Items.Add($_) } - } - ############################################## - Function temp { - $outputBox.Clear() - #$Script:outputBox.text = $textBox1.text | Out-String - $Global:Collection_Name = $textBox1.Text - #$Global:Select_Tool = $RadioButton1.Checked - - $Global:Select_Tool = $DropDownBox.text - #$Global:Output_Type = - If ($RadioButton1.Checked -eq $true) { $Global:Output_Type = "Window"; $outputBox.Text = "Radio1 Checked: $($RadioButton1.Checked)" | Out-String } - ElseIf ($RadioButton2.Checked -eq $true) { $Global:Output_Type = "Gridview"; $outputBox.Text = "Radio2 Checked: $RadioButton2.Checked" | Out-String } - ElseIf ($RadioButton3.Checked -eq $true) { $Global:Output_Type = "Export"; $outputBox.Text = "Radio3 Checked: $RadioButton2.Checked" | Out-String } - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($DropDownBox.text = "Tool1"){gcc} - Run-Tool - $textBox1.clear() - $DropDownBox.text = "----Select Tool----" - Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:outputBox.SelectionColor = 'red' - $Script:outputBox.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction - ############################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - #"Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $outputBox.Text = Invoke-Expression $Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction - ############################################## - Function Run-Defaults { - $Script:textBox1.Text = "Nabil - Test Collection" - $Script:RadioButton1.Checked = $true - } - ############################################## - Function gcc { - $Script:outputBox.text = Get-Service | Out-String - } - ############################################## - Function Clear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -#region Controls - ############################################## Start group boxes - $groupBox = New-Object System.Windows.Forms.GroupBox - $groupBox.Location = New-Object System.Drawing.Size(270,20) - $groupBox.size = New-Object System.Drawing.Size(150,110) - $groupBox.text = "Select Output:" - $Form.Controls.Add($groupBox) - ############################################## end group boxes - - ############################################## Start radio buttons - $Script:RadioButton1 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton1.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton1.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton1.Checked = $true - $Script:RadioButton1.Text = "Window" - $groupBox.Controls.Add($RadioButton1) - - $Script:RadioButton2 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton2.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton2.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton2.Text = "Gridview" - $groupBox.Controls.Add($RadioButton2) - - $Script:RadioButton3 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton3.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton3.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton3.Text = "Export csv" - $groupBox.Controls.Add($RadioButton3) - - ############################################## end radio buttons - ########### Text Box ########### - ############Define text box1 for input - $Script:textBox1 = New-Object “System.Windows.Forms.TextBox”; - $Script:textBox1.Left = 20; - $Script:textBox1.Top = 30; - $Script:textBox1.width = 200; - $Script:textBox1.Text = "Nabil - Test Collection" - $Form.Controls.Add($textBox1) - ############################################## Start drop down boxes - - $Script:DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:DropDownBox.Location = New-Object System.Drawing.Size(20,80) - $Script:DropDownBox.Size = New-Object System.Drawing.Size(180,20) - $Script:DropDownBox.DropDownHeight = 200 - $Script:DropDownBox.text = "----Select Tool----" - $Form.Controls.Add($DropDownBox) - - ############################################## end drop down boxes - - <############################################## Start text fields - - $Script:outputBox = New-Object System.Windows.Forms.TextBox - $Script:outputBox.Location = New-Object System.Drawing.Size(10,150) - $Script:outputBox.Size = New-Object System.Drawing.Size(865,300) - $Script:outputBox.MultiLine = $True - - $Script:outputBox.ScrollBars = "Vertical" - $Form.Controls.Add($Script:outputBox) - ###########> - $SCRIPT:outputBox=New-Object System.Windows.Forms.RichTextBox - $outputBox.Location=New-Object System.Drawing.Size(10,150) - $outputBox.Size=New-Object System.Drawing.Size(965,600) - $outputBox.Multiline=$True - $outputBox.ReadOnly = $True - $outputBox.BackColor = [Drawing.Color]::White - $outputBox.ScrollBars = "both" - $outputBox.WordWrap = $false - $outputBox.Font = 'Consolas, 8.25pt' - $form.Controls.Add($Script:outputBox) - - - - - ############################################## end text fields - - ############################################## Start buttons - - $Button = New-Object System.Windows.Forms.Button - $Button.Location = New-Object System.Drawing.Size(450,30) - $Button.Size = New-Object System.Drawing.Size(110,80) - $Button.Text = "Go" - $Button.Add_Click({temp}) - $Form.Controls.Add($Button) -#endregion Controls - ############################################## end buttons - Update-Dropdown1 - - $Form.Add_Shown({$Form.Activate()}) - [void] $Form.ShowDialog() - -} -######################################################################################################################################################### - <# Function Input-Box { - [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') - $Global:Collection_Name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter your name", "Name", "Enter Collection Name") - - } - #> -############################################################################################################################################################# - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - Set-Location c: - $Script:DeviceCollection_ServerNames1.Name | % { - - $Obj = New-Object -TypeName PSObject - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:outputBox.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - - }#endIf - - Else { - #$Script:outputBox.AppendText("NOT Responding: $_") - $NotResponding += $_ - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - } - }#end% - $Script:outputBox.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - SCCM-Module - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:outputBox.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $outputBox.Text = $T | ft -AutoSize | Out-String - } -############################################################################################################################################################# - -############################################################################################################################################################# -Start-Form - diff --git a/dump/SCCM-Tool/NA-Tool-GUI-3.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-3.ps1 deleted file mode 100644 index 4413f23..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-3.ps1 +++ /dev/null @@ -1,377 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent - -$Script:ALL_Patch_Servers = @() -$Script:Responding = @() -$Script:NotResponding = @() -$Global:Collection_Name = "" -$Global:Select_Tool -$Global:Output_Type = "" - -If(!(Get-PSDrive -Name SCCM-Drive -ErrorAction SilentlyContinue)) { - 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" -} -######################################################################################################################################################### -Function Start-Form { - - #$Global:Collection_Name = "" - #$Global:Select_Tool = "" - #$Global:Output_Type = "" - - $Temp = "" - - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - - $Form = New-Object System.Windows.Forms.Form - $Form.Size = New-Object System.Drawing.Size(1000,800) - ############################################## - #$Form_Load={ $Script:outputBox.text = "Welcome" } - ############################################## Start functions - <# function pingInfo { - - if ($RadioButton1.Checked -eq $true) {$nrOfPings=1} - if ($RadioButton2.Checked -eq $true) {$nrOfPings=2} - if ($RadioButton3.Checked -eq $true) {$nrOfPings=3} - - $computer=$DropDownBox.SelectedItem.ToString() #populate the var with the value you selected - $pingResult=ping $wks -n $nrOfPings | fl | out-string; - $Script:outputBox.text=$pingResult - - } #end pingInfo - #> - - - - - ############################################## end functions - Function SCCM-Module { - - If(!(Get-PSDrive).Name -eq "sccm-drive") { - 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" - }#endIf - CD sccm-drive: - }#endFunction - ############################################## - Function Update-Dropdown1 { - # $Collections += $textBox1.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Tool7") - $Collections | % { $DropDownBox.Items.Add($_) } - } - ############################################## - Function temp { - $outputBox.Clear() - #$Script:outputBox.text = $textBox1.text | Out-String - $Global:Collection_Name = $textBox1.Text - #$Global:Select_Tool = $RadioButton1.Checked - - $Global:Select_Tool = $DropDownBox.text - #$Global:Output_Type = - If ($RadioButton1.Checked -eq $true) { $Global:Output_Type = "Window"; $outputBox.Text = "Radio1 Checked: $($RadioButton1.Checked)" | Out-String } - ElseIf ($RadioButton2.Checked -eq $true) { $Global:Output_Type = "Gridview"; $outputBox.Text = "Radio2 Checked: $RadioButton2.Checked" | Out-String } - ElseIf ($RadioButton3.Checked -eq $true) { $Global:Output_Type = "Export"; $outputBox.Text = "Radio3 Checked: $RadioButton2.Checked" | Out-String } - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($DropDownBox.text = "Tool1"){gcc} - Run-Tool - $textBox1.clear() - $DropDownBox.text = "----Select Tool----" - Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:outputBox.SelectionColor = 'red' - $Script:outputBox.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction - ############################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - #"Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $outputBox.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction - ############################################## - Function Run-Defaults { - $Script:textBox1.Text = "Nabil - Test Collection" - $Script:RadioButton1.Checked = $true - } - ############################################## - Function gcc { - $Script:outputBox.text = Get-Service | Out-String - } - ############################################## - Function Clear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -#region Controls - ############################################## Start group boxes - $groupBox = New-Object System.Windows.Forms.GroupBox - $groupBox.Location = New-Object System.Drawing.Size(270,20) - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - $Form.Controls.Add($groupBox) - ############################################## end group boxes - - ############################################## Start radio buttons - $Script:RadioButton1 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton1.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton1.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton1.Checked = $true - $Script:RadioButton1.Text = "Window" - $groupBox.Controls.Add($RadioButton1) - - $Script:RadioButton2 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton2.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton2.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton2.Text = "Gridview" - $groupBox.Controls.Add($RadioButton2) - - $Script:RadioButton3 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton3.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton3.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton3.Text = "Export csv" - $groupBox.Controls.Add($RadioButton3) - - ############################################## end radio buttons - ########### Text Box ########### - ############Define text box1 for input - $Script:textBox1 = New-Object “System.Windows.Forms.TextBox”; - $Script:textBox1.Left = 20; - $Script:textBox1.Top = 30; - $Script:textBox1.width = 200; - $Script:textBox1.Text = "Nabil - Test Collection" - $Form.Controls.Add($textBox1) - ############################################## Start drop down boxes - $Script:DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:DropDownBox.Location = New-Object System.Drawing.Size(20,80) - $Script:DropDownBox.Size = New-Object System.Drawing.Size(180,20) - $Script:DropDownBox.DropDownHeight = 200 - $Script:DropDownBox.text = "----Select Tool----" - $Form.Controls.Add($DropDownBox) - ############################################## end drop down boxes - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox.Location = New-Object System.Drawing.Size(20,150) - $Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Form.Controls.Add($Deployment_DropDownBox) - ############################################## - $Script:DeploymentCollection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:DeploymentCollection_DropDownBox.Location = New-Object System.Drawing.Size(20,180) - $Script:DeploymentCollection_DropDownBox.Size = New-Object System.Drawing.Size(280,50) - $Script:DeploymentCollection_DropDownBox.DropDownHeight = 200 - $Script:DeploymentCollection_DropDownBox.text = "----Deployment Collections----" - #$Script:DeploymentCollection_DropDownBox.Visible = $false - $Form.Controls.Add($DeploymentCollection_DropDownBox) - - - <############################################## Start text fields - - $Script:outputBox = New-Object System.Windows.Forms.TextBox - $Script:outputBox.Location = New-Object System.Drawing.Size(10,150) - $Script:outputBox.Size = New-Object System.Drawing.Size(865,300) - $Script:outputBox.MultiLine = $True - - $Script:outputBox.ScrollBars = "Vertical" - $Form.Controls.Add($Script:outputBox) - ###########> - $SCRIPT:outputBox=New-Object System.Windows.Forms.RichTextBox - $OutputBox.Location=New-Object System.Drawing.Size(10,250) - $OutputBox.Size=New-Object System.Drawing.Size(965,500) - $OutputBox.Multiline=$True - $OutputBox.ReadOnly = $True - $OutputBox.BackColor = [Drawing.Color]::White - $OutputBox.ScrollBars = "both" - $OutputBox.WordWrap = $false - $OutputBox.Font = 'Consolas, 8.25pt' - $form.Controls.Add($SCRIPT:OutputBox) - - - - - ############################################## end text fields - - ############################################## Start buttons - - $Button = New-Object System.Windows.Forms.Button - $Button.Location = New-Object System.Drawing.Size(450,30) - $Button.Size = New-Object System.Drawing.Size(110,80) - $Button.Text = "Go" - $Button.Add_Click({temp}) - $Form.Controls.Add($Button) -#endregion Controls - ############################################## end buttons - Update-Dropdown1 - Deployment-List -Deployment_History 2 -$OutputBox.Text = "hello" -############################################## - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - #$Script:DeploymentCollection_DropDownBox.Text - $OutputBox.Text = "hello111111" #$Script:Deployment_DropDownBox.Text - } - - - - $Form.Add_Shown({$Form.Activate()}) - - - - - - - - [void] $Form.ShowDialog() - -} - - - - -######################################################################################################################################################### - <# Function Input-Box { - [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') - $Global:Collection_Name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter your name", "Name", "Enter Collection Name") - - } - #> -############################################################################################################################################################# - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - Set-Location c: - $Script:DeviceCollection_ServerNames1.Name | % { - - $Obj = New-Object -TypeName PSObject - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:outputBox.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - - }#endIf - - Else { - #$Script:outputBox.AppendText("NOT Responding: $_") - $NotResponding += $_ - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - } - }#end% - $Script:outputBox.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - SCCM-Module - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:outputBox.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - SCCM-Module - $Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $outputBox.Text = $T | ft -AutoSize | Out-String - } -############################################################################################################################################################# - -############################################################################################################################################################# -Start-Form - diff --git a/dump/SCCM-Tool/NA-Tool-GUI-3x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-3x.ps1 deleted file mode 100644 index 8855f6b..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-3x.ps1 +++ /dev/null @@ -1,518 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - $Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - $Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - $Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - - - - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - $Script:Output.Text = $Script:Collection_DropDownBox.Text - } - - $Button_Go_Click = { $Script:Output.Text = "Button clicked" } - - ############################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Tool7") - $Collections | % { $Script:Collection_DropDownBox.Items.Add($_) } - } -################################################################################################################## - Function temp { - $outputBox.Clear() - #$Script:outputBox.text = $Script:Collection_DropDownBox.text | Out-String - $Global:Collection_Name = $Script:TextBox_CollectionName.Text - #$Global:Select_Tool = $RadioButton1.Checked - - $Global:Select_Tool = $DropDownBox.text - #$Global:Output_Type = - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window"; $outputBox.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview"; $outputBox.Text = "Gridview_Radio2 Checked: $Script:RadioButton_GridView.Checked" | Out-String } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export"; $outputBox.Text = "CSV_Radio3 Checked: $Script:RadioButton_CSV.Checked" | Out-String } - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($DropDownBox.text = "Tool1"){gcc} - Run-Tool - $Script:TextBox_CollectionName.clear() - $DropDownBox.text = "----Select Tool----" - Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:outputBox.SelectionColor = 'red' - $Script:outputBox.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction - - -################################################################################################################## - Function SCCM-Module { - - If(!(Get-PSDrive).Name -eq "sccm-drive") { - 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" - }#endIf - CD sccm-drive: - }#endFunction - -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - #"Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $outputBox.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton1.Checked = $true - } -################################################################################################################## - Function Clear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - Set-Location c: - $Script:DeviceCollection_ServerNames1.Name | % { - - $Obj = New-Object -TypeName PSObject - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:outputBox.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - - }#endIf - - Else { - #$Script:outputBox.AppendText("NOT Responding: $_") - $NotResponding += $_ - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - } - }#end% - $Script:outputBox.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - SCCM-Module - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:outputBox.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - SCCM-Module - $Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $outputBox.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Output) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($GroupBox) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - # - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - # - # Output - # - $Output.Location = '10, 250' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'both' - $Output.Size = '965, 500' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.TabIndex = 5 - $Output.add_TextChanged($Output_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Tools--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - $Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - # - $groupBox.Location = '270,70' - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - $Script:Output.Text = "hello" - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-4x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-4x.ps1 deleted file mode 100644 index 113b8f0..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-4x.ps1 +++ /dev/null @@ -1,626 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - $Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - $Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - $Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - - - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Tool----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction - - - - -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - #Set-Location c: - - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Script:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $Obj = New-Object -TypeName PSObject - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - $Responding += $Server - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - $NotResponding += $Server - } - }#end% - $Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } | Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T | % { $Script:Collection_DropDownBox.Items.Add("$_")} - } - -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Output) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Output.Location = '10, 250' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'both' - $Output.Size = '965, 500' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.TabIndex = 5 - $Output.add_TextChanged($Output_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '580,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-5x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-5x.ps1 deleted file mode 100644 index 29b5e43..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-5x.ps1 +++ /dev/null @@ -1,693 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - - - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Tool----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction - - - - -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - #Set-Location c: - - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Script:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $Obj = New-Object -TypeName PSObject - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - $Responding += $Server - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - $NotResponding += $Server - } - }#end% - $Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } | Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T | % { $Script:Collection_DropDownBox.Items.Add("$_")} - } - -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Output) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_DeploymentName) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeviceCount) - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Output.Location = '10, 250' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'both' - $Output.Size = '965, 500' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.TabIndex = 5 - $Output.add_TextChanged($Output_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '580,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - - - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '670,25' - $GroupBox_Info.Size = '300,200' - $GroupBox_Info.Text = "Deployment Info" - ############ - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeviceCount) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - ############ - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Collection Name:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - ############ - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count:' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - ############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-6x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-6x.ps1 deleted file mode 100644 index c0930f3..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-6x.ps1 +++ /dev/null @@ -1,713 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_CollectionName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - - - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - $T = Get-CMDeviceCollection -Name $Script:Collection_DropDownBox.text | select Name,MemberCount - $label_CollectionName_Value.Text = $T.MemberCount - - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - - - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Collection----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction - - - - -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - #Set-Location c: - - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Script:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $Obj = New-Object -TypeName PSObject - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - $Responding += $Server - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - $NotResponding += $Server - } - }#end% - $Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } | Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T | % { $Script:Collection_DropDownBox.Items.Add("$_")} - } - -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Output) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_CollectionName_Value) - $form1.Controls.Add($label_DeploymentName) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeviceCount) - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Output.Location = '10, 250' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'both' - $Output.Size = '965, 500' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.TabIndex = 5 - $Output.add_TextChanged($Output_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '580,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - - - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '670,25' - $GroupBox_Info.Size = '300,200' - $GroupBox_Info.Text = "Deployment Info" - ############ - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_CollectionName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeviceCount) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - #$label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - ############ - $label_CollectionName_Value.AutoSize = $True - $label_CollectionName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName_Value.ForeColor = 'DarkGreen' - #$label_CollectionName_Value.TextAlign = 'MiddleRight' - $label_CollectionName_Value.Location = '130,25' - $label_CollectionName_Value.Name = 'Collection_Name_Value' - $label_CollectionName_Value.Size = '41, 13' - #$label_CollectionName_Value.TabIndex = 6 - $label_CollectionName_Value.Text = '_' - #$label_CollectionName_Value.add_Click($label_CollectionName_Value_Click) - - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - ############ - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Collection Name:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - ############ - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count:' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - ############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-7x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-7x.ps1 deleted file mode 100644 index fb86d0d..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-7x.ps1 +++ /dev/null @@ -1,770 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_CollectionName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime_Value = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount_Value = New-Object 'System.Windows.Forms.Label' - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - - - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - $T = Get-CMDeviceCollection -Name $Script:Collection_DropDownBox.text | select Name,MemberCount - - $label_CollectionName_Value.Text = $T.MemberCount - - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Reset-Forms -Form_Selection 1 - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - - - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function Reset-Forms { - Param($Form_Selection) - - Switch ($Form_Selection) { - 1 { $Collection_DropDownBox.Items.Clear(); $Collection_DropDownBox.Text = "--Deployed to Collections--" } - 2 {} - - } - - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - #$Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Collection_Name = $Script:Collection_DropDownBox.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Collection----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - #Set-Location c: - - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Script:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $Obj = New-Object -TypeName PSObject - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - $Responding += $Server - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - $NotResponding += $Server - } - }#end% - $Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } | Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T | % { $Script:Collection_DropDownBox.Items.Add("$_")} - } - -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Output) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_CollectionName_Value) - $form1.Controls.Add($label_DeploymentName) - $form1.controls.Add($label_DeploymentName_Value) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeploymentTime_Value) - $form1.Controls.Add($label_DeviceCount) - $form1.Controls.Add($label_DeviceCount_Value) - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Output.Location = '10, 250' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'both' - $Output.Size = '965, 500' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.TabIndex = 5 - $Output.add_TextChanged($Output_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '580,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - - - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '670,25' - $GroupBox_Info.Size = '300,200' - $GroupBox_Info.Text = "Deployment Info" - ############ - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_CollectionName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeploymentTime_Value) - $GroupBox_Info.Controls.Add($label_DeviceCount) - $GroupBox_Info.Controls.Add($label_DeviceCount_Value) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 9.0pt' #, style=Bold' - #$label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - - ############ Value ############### - $label_CollectionName_Value.AutoSize = $True - $label_CollectionName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName_Value.ForeColor = 'DarkGreen' - #$label_CollectionName_Value.TextAlign = 'MiddleRight' - $label_CollectionName_Value.Location = '140,25' - $label_CollectionName_Value.Name = 'Collection_Name_Value' - $label_CollectionName_Value.Size = '41, 13' - #$label_CollectionName_Value.TabIndex = 6 - $label_CollectionName_Value.Text = '_' - #$label_CollectionName_Value.add_Click($label_CollectionName_Value_Click) - - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - - ############ Value ############ - $label_DeploymentName_Value.AutoSize = $True - $label_DeploymentName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName_Value.ForeColor = 'DarkGreen' - #$label_DeploymentName_Value.TextAlign = 'MiddleRight' - $label_DeploymentName_Value.Location = '140,45' - $label_DeploymentName_Value.Name = 'Deployment_Name_Value' - $label_DeploymentName_Value.Size = '41, 13' - #$label_DeploymentName_Value.TabIndex = 6 - $label_DeploymentName_Value.Text = '_' - #$label_DeploymentName_Value.add_Click($label_DeploymentName_Value_Click) - - ############# - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Deployment Time:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - - ############ Value ############ - $label_DeploymentTime_Value.AutoSize = $True - $label_DeploymentTime_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime_Value.ForeColor = 'DarkGreen' - #$label_DeploymentTime_Value.TextAlign = 'MiddleRight' - $label_DeploymentTime_Value.Location = '140,65' - $label_DeploymentTime_Value.Name = 'Deployment_Time_Value' - $label_DeploymentTime_Value.Size = '41, 13' - #$label_DeploymentTime_Value.TabIndex = 6 - $label_DeploymentTime_Value.Text = '_' - #$label_DeploymentTime_Value.add_Click($label_DeploymentTime_Value_Click) - - ########### - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - - ############ Value ############ - $label_DeviceCount_Value.AutoSize = $True - $label_DeviceCount_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount_Value.ForeColor = 'DarkGreen' - #$label_DeviceCount_Value.TextAlign = 'MiddleRight' - $label_DeviceCount_Value.Location = '140,85' - $label_DeviceCount_Value.Name = 'Device_Count_Value' - $label_DeviceCount_Value.Size = '41, 13' - #$label_DeviceCount_Value.TabIndex = 6 - $label_DeviceCount_Value.Text = '_' - #$label_DeviceCount_Value.add_Click($label_DeviceCount_Value_Click) - ############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-8x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-8x.ps1 deleted file mode 100644 index 138b6fc..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-8x.ps1 +++ /dev/null @@ -1,782 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_CollectionName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime_Value = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount_Value = New-Object 'System.Windows.Forms.Label' - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - - - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:DeviceCollection_ServerNames1 = "" - - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - $T = Get-CMDeviceCollection -Name $Script:Collection_DropDownBox.text | select Name,MemberCount - - $label_DeviceCount_Value.Text = $T.MemberCount - - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Reset-Forms -Form_Selection 1 - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - - - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function Reset-Forms { - Param($Form_Selection) - - Switch ($Form_Selection) { - 1 { $Collection_DropDownBox.Items.Clear(); $Collection_DropDownBox.Text = "--Deployed to Collections--" } - 2 {} - - } - - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - #$Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Collection_Name = $Script:Collection_DropDownBox.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Collection----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - # $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Collection-Members { - Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient - - } - -############################################################################################################################################################# - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - #SCCM-Module - #CD sccm-drive: - $Global:DeviceCollection_ServerNames1 = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - #Set-Location c: - - Write-Host "Total Server Count: $($Global:DeviceCollection_ServerNames1.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Global:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $Obj = New-Object -TypeName PSObject - $Count = $Global:DeviceCollection_ServerNames1.count - $Script:Output.Text = "Checking: $Server ----- Servers left: $($Count--) Please Wait !!!" | Out-String - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - $Responding += $Server - # $Script:Output.text += $Obj | Out-String - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - $NotResponding += $Server - # $Script:Output.text += $Obj | Out-String - } - }#end% - $Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Global:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Global:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } | Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T | % { $Script:Collection_DropDownBox.Items.Add("$_")} - } - -############################################################################################################################################################# - Function Test-Service { - $T = Get-Service - $Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Output) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_CollectionName_Value) - $form1.Controls.Add($label_DeploymentName) - $form1.controls.Add($label_DeploymentName_Value) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeploymentTime_Value) - $form1.Controls.Add($label_DeviceCount) - $form1.Controls.Add($label_DeviceCount_Value) - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Output.Location = '10, 250' - $Output.Multiline = $True - $Output.Name = 'Output' - $Output.ScrollBars = 'both' - $Output.Size = '965, 500' - $Output.Font = 'Consolas, 8.25pt' - $Output.WordWrap = $False - $Output.TabIndex = 5 - $Output.add_TextChanged($Output_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '580,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - - - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '670,25' - $GroupBox_Info.Size = '300,200' - $GroupBox_Info.Text = "Deployment Info" - ############ - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_CollectionName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeploymentTime_Value) - $GroupBox_Info.Controls.Add($label_DeviceCount) - $GroupBox_Info.Controls.Add($label_DeviceCount_Value) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 9.0pt' #, style=Bold' - #$label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - - ############ Value ############### - $label_CollectionName_Value.AutoSize = $True - $label_CollectionName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName_Value.ForeColor = 'DarkGreen' - #$label_CollectionName_Value.TextAlign = 'MiddleRight' - $label_CollectionName_Value.Location = '140,25' - $label_CollectionName_Value.Name = 'Collection_Name_Value' - $label_CollectionName_Value.Size = '41, 13' - #$label_CollectionName_Value.TabIndex = 6 - $label_CollectionName_Value.Text = '_' - #$label_CollectionName_Value.add_Click($label_CollectionName_Value_Click) - - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - - ############ Value ############ - $label_DeploymentName_Value.AutoSize = $True - $label_DeploymentName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName_Value.ForeColor = 'DarkGreen' - #$label_DeploymentName_Value.TextAlign = 'MiddleRight' - $label_DeploymentName_Value.Location = '140,45' - $label_DeploymentName_Value.Name = 'Deployment_Name_Value' - $label_DeploymentName_Value.Size = '41, 13' - #$label_DeploymentName_Value.TabIndex = 6 - $label_DeploymentName_Value.Text = '_' - #$label_DeploymentName_Value.add_Click($label_DeploymentName_Value_Click) - - ############# - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Deployment Time:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - - ############ Value ############ - $label_DeploymentTime_Value.AutoSize = $True - $label_DeploymentTime_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime_Value.ForeColor = 'DarkGreen' - #$label_DeploymentTime_Value.TextAlign = 'MiddleRight' - $label_DeploymentTime_Value.Location = '140,65' - $label_DeploymentTime_Value.Name = 'Deployment_Time_Value' - $label_DeploymentTime_Value.Size = '41, 13' - #$label_DeploymentTime_Value.TabIndex = 6 - $label_DeploymentTime_Value.Text = '_' - #$label_DeploymentTime_Value.add_Click($label_DeploymentTime_Value_Click) - - ########### - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - - ############ Value ############ - $label_DeviceCount_Value.AutoSize = $True - $label_DeviceCount_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount_Value.ForeColor = 'DarkGreen' - #$label_DeviceCount_Value.TextAlign = 'MiddleRight' - $label_DeviceCount_Value.Location = '140,85' - $label_DeviceCount_Value.Name = 'Device_Count_Value' - $label_DeviceCount_Value.Size = '41, 13' - #$label_DeviceCount_Value.TabIndex = 6 - $label_DeviceCount_Value.Text = '_' - #$label_DeviceCount_Value.add_Click($label_DeviceCount_Value_Click) - ############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/NA-Tool-GUI-9x.ps1 b/dump/SCCM-Tool/NA-Tool-GUI-9x.ps1 deleted file mode 100644 index 4c2910f..0000000 --- a/dump/SCCM-Tool/NA-Tool-GUI-9x.ps1 +++ /dev/null @@ -1,847 +0,0 @@ -#------------------------------------------------------------------------ -# Source File Information (DO NOT MODIFY) -# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a -# Source File: Form-Template.psf -#------------------------------------------------------------------------ -#region File Recovery Data (DO NOT MODIFY) -<#RecoveryData: -RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x -QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV -Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk -BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh -MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6 -bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r -m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#> -#endregion - -<# - .NOTES - -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141 - Generated on: 8/29/2017 11:53 AM - Generated by: Haidey2 - -------------------------------------------------------------------------------- - .DESCRIPTION - GUI script generated by PowerShell Studio 2017 -#> - - -#---------------------------------------------- -#region Application Functions -#---------------------------------------------- - -#endregion Application Functions - -#---------------------------------------------- -# Generated Form Function -#---------------------------------------------- -function Show-Form-Template_psf { - - #---------------------------------------------- - #region Import the Assemblies - #---------------------------------------------- - [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') - [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') - #endregion Import Assemblies - - #---------------------------------------------- - #region Generated Form Objects - #---------------------------------------------- - [System.Windows.Forms.Application]::EnableVisualStyles() - $form1 = New-Object 'System.Windows.Forms.Form' - $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' - - - $Script:Output = New-Object System.Windows.Forms.TextBox - - $Script:Output_Left = New-Object System.Windows.Forms.TextBox - $Script:Output_Right = New-Object System.Windows.Forms.TextBox - - $Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:Combobox_Tools = New-Object System.Windows.Forms.ComboBox - - $GroupBox = New-Object System.Windows.Forms.GroupBox - $GroupBox_Info = New-Object System.Windows.Forms.GroupBox - - $Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton - $Button_Go = New-Object System.Windows.Forms.Button - $Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox” - - #$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel' - #$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel' - - - #$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox' - #$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox' - #$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox' - - $label_CollectionName = New-Object 'System.Windows.Forms.Label' - $label_CollectionName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName = New-Object 'System.Windows.Forms.Label' - $label_DeploymentName_Value = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime = New-Object 'System.Windows.Forms.Label' - $label_DeploymentTime_Value = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount = New-Object 'System.Windows.Forms.Label' - $label_DeviceCount_Value = New-Object 'System.Windows.Forms.Label' - - $Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button' - - - - -# $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - - $Script:ALL_Patch_Servers = @() - $Script:Responding = @() - $Script:NotResponding = @() - $Global:DeviceCollection_ServerNames1 = "" - - $Global:Collection_Name = "" - $Global:Select_Tool - $Global:Output_Type = "" - $Global:Deployments = "" - - #endregion Generated Form Objects - - #---------------------------------------------- - # User Generated Script - #---------------------------------------------- - - $form1_Load={ - #TODO: Initialize Form Controls here - - } - - $Script:Collection_DropDownBox_SelectedIndexChanged={ - - $Script:Output.Text = $Script:Collection_DropDownBox.Text - $T = Get-CMDeviceCollection -Name $Script:Collection_DropDownBox.text | select Name,MemberCount - - $label_DeviceCount_Value.Text = $T.MemberCount - - } - - $Script:Deployment_DropDownBox_SelectedIndexChanged={ - Reset-Forms -Form_Selection 1 - Deployed-to-Collections - $Script:Output.Text = $Script:Deployment_DropDownBox.Text - } - - $Script:Combobox_Tools_SelectedIndexChanged= { - $Script:Output.Text = $Script:Combobox_Tools.Text - - - } - - $Button_Go_Click = { - temp - #SCCM-Module - # $Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - # $Global:Select_Tool = $Script:Combobox_Tools.Text - - - #$Output.Text = "$Global:Collection_Name --- $Global:Select_Tool " | Out-String - #$Output.Text = | Out-String - } - - -################################################################################################################## - Function ConnectTo-SCCM { - - If(!(Get-PSDrive).Name -ne "CCX") { - # - # Press 'F5' to run this script. Running this script will load the ConfigurationManager - # module for Windows PowerShell and will connect to the site. - # - # This script was auto-generated at '2/18/2021 10:12:39 AM'. - - # Uncomment the line below if running in an environment where script signing is - # required. - #Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process - - # Site configuration - $SiteCode = "CCX" # Site code - $ProviderMachineName = "PNCRASCCM001.ccx.carecentrix.com" # SMS Provider machine name - - # Customizations - $initParams = @{} - #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging - #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors - - # Do not change anything below this line - - # Import the ConfigurationManager.psd1 module - if((Get-Module ConfigurationManager) -eq $null) { - Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams - } - - # Connect to the site's drive if it is not already present - if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) { - New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams - } - - # Set the current location to be the site code. - Set-Location "$($SiteCode):\" @initParams - - #$Script:Output.Text = "inside connectoSCCM function" - }#endIf - }#endFunction -################################################################################################################## - Function SCCM-Module { - Write-Host "Inside SCCM function" -ForegroundColor Cyan - If(!(Get-PSDrive).Name -eq "sccm-drive") { - - 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" - }#endIf - $Script:Output.Text | Get-PSDrive | ft -AutoSize | Out-String - CD sccm-drive: - }#endFunction -################################################################################################################## - Function Update-Dropdown1 { - # $Collections += $Script:Collection_DropDownBox.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Test-Sccm") - $Collections | % { $Script:Combobox_Tools.Items.Add($_) } - } -################################################################################################################## - Function Reset-Forms { - Param($Form_Selection) - - Switch ($Form_Selection) { - 1 { $Collection_DropDownBox.Items.Clear(); $Collection_DropDownBox.Text = "--Deployed to Collections--" } - 2 {} - - } - - } -################################################################################################################## - Function temp { - $Script:Output.Clear() - $Script:Output_Left.Clear() - $Script:Output_Right.Clear() - #$Script:Script:Output.text = $Script:Collection_DropDownBox.text | Out-String - - #$Global:Collection_Name = $Script:TextBox_CollectionName.Text #$Script:TextBox_CollectionName.Text - $Global:Collection_Name = $Script:Collection_DropDownBox.Text - $Global:Select_Tool = $Script:Combobox_Tools.Text - - - If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window" <#; $Script:Output.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview" <#; $Script:Output.Text = "Gridview_Radio2 Checked: $($Script:RadioButton_GridView.Checked)" | Out-String #> } - ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export" <#; $Script:Output.Text = "CSV_Radio3 Checked: $($Script:RadioButton_CSV.Checked)" | Out-String #> } - - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($Script:Collection_DropDownBox.text = "Tool1"){gcc} - Run-Tool - #$Script:TextBox_CollectionName.clear() - $Script:Collection_DropDownBox.text = "----Select Collection----" - #Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:Output.SelectionColor = 'red' - $Script:Output.Text = "You must select 'Tool' and enter Collection Name............!!" - } - - Run-Defaults - }#endFunction -################################################################################################################## - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - Test-Service { Test-Service } - Test-SCCM { SCCM-Module } - #"Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Remotely Update Policy" { $Script:Output.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String } - "Software Update Status" { $Script:Output.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String} - }#endSwitch - #Clear-Variables - }#endFunction -################################################################################################################## - Function Run-Defaults { - #$Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - $Script:RadioButton_Window.Checked = $true - - <# - If(!$Location) { - $Location = Split-Path $MyInvocation.MyCommand.Path -Parent - } - #> - } -################################################################################################################## - Function xClear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -################################################################################################################## - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - $Script:ALL_Patch_Servers = @() - - ConnectTo-SCCM - NA-Set-Stage -Select_Stage OutputStage2 - #SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - #Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:Output.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - # $Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation - - }#endFunction -############################################################################################################################################################# - Function Collection-Members { - Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient - - } - -############################################################################################################################################################# - Function NA-Set-Stage { - Param($Select_Stage) - Switch($Select_Stage) { - OutputStage1 { $Script:Output.Visible = $false - $Script:Output_Left.Visible = $True - $Script:Output_Right.Visible = $True - Write-Host "output-stage1" -ForegroundColor Yellow - } - OutputStage2 { $Script:Output.Visible = $True - $Script:Output_Left.Visible = $false - $Script:Output_Right.Visible = $false - } - test { $Script:Output.Text = "inside na set stage function"} - }#endSwitch - $Script:Output.Text = "outside switch inside na set stage function - param: $Select_Stage" - - - - }#endFunction -############################################################################################################################################################# - - Function Ping_Collection { - - $Ping_Result = @() - $NotResponding = @() - $Responding = @() - - ConnectTo-SCCM - - NA-Set-Stage -Select_Stage OutputStage1 - #$Script:Output.Visible = $false - #$Script:Output_Left.Visible = $True - #$Script:Output_Right.Visible = $True - - - $Global:DeviceCollection_ServerNames1 = Collection-Members #Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - #Set-Location c: - - Write-Host "Total Server Count: $($Global:DeviceCollection_ServerNames1.count)" -ForegroundColor Green - Write-Host "" - - ############ - # $Script:Output.Text = "CollectionName: $($Global:Collection_Name) ------ hello " - ############ - $Global:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $Obj = New-Object -TypeName PSObject - $Count = $Global:DeviceCollection_ServerNames1.count - #$Script:Output.Text = "Checking: $Server ----- Servers left: $($Count--) Please Wait !!!" | Out-String - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - #$Responding += $Server - $Responding += $Obj - # $Script:Output.text += $Obj | Out-String - }#endIf - - Else { - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - #$NotResponding += $Server - $NotResponding += $Obj - # $Script:Output.text += $Obj | Out-String - } - }#end% - #$Script:Output.Text = $Ping_Result | ft -AutoSize | Out-String - $Script:Output_Left.Text = $Responding | Out-String - $Script:Output_Right.Text = $NotResponding | Out-String - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - #Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - ConnectTo-SCCM - $Global:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:Output.Text = $Global:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastReboot";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } - -############################################################################################################################################################# - Function Deployment-List { - Param($Deployment_History) - # SCCM-Module - $Global:Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) } - - #$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) } - $i = 0 - $Q = "" #@() - - $Global:Deployments.ApplicationName | % { $Script:Deployment_DropDownBox.Items.Add($_)} - <# - foreach ($D in $Deployments) { - $Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName - - $Deployment_DropDownBox.Items.Add($Q) - $i++ - } - #> - - #$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) } - - }#endFunction -############################################################################################################################################################# - Function Deployed-to-Collections { - $T = $Global:Deployments | ? { $_.ApplicationName -eq "$($Script:Deployment_DropDownBox.text)" } | Select -ExpandProperty CollectionName - $Script:Collection_DropDownBox.Items.Clear() - $T | % { $Script:Collection_DropDownBox.Items.Add("$_")} - } - -############################################################################################################################################################# - Function Test-Service { - - $Script:Output.Text = "test-service function" - #$T = Get-Service - #$Script:Output.Text = $T | ft -AutoSize | Out-String - } -################################################################################################################## - -################################################################################################################## - # --End User Generated Script-- - #---------------------------------------------- - #region Generated Events - #---------------------------------------------- - - $Form_StateCorrection_Load= - { - #Correct the initial state of the form to prevent the .Net maximized form issue - $form1.WindowState = $InitialFormWindowState - } - - $Form_Cleanup_FormClosed= - { - #Remove all event handlers from the controls - try - { - $form1.remove_Load($form1_Load) - $form1.remove_Load($Form_StateCorrection_Load) - $form1.remove_FormClosed($Form_Cleanup_FormClosed) - - #$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint) - #$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint) - - $Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged) - $Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged) - $Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged) - - $Script:Output.remove_TextChanged($Output_TextChanged) - $Script:Output_Left.remove_TextChanged($Script:Output_Left_TextChanged) - $Script:Output_Right.remove_TextChanged($Script:Output_Right_TextChanged) - - $Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - $Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - $Script:Combobox_Tools.remove_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - $Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged) - $Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged) - $Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged) - $Button_Go.remove_Click($Button_Go_Click) - - } - catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } - } - - - #$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> } - #$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ } - - $Text_ELogs_ServerName_TextChanged={} - $Text_Elogs_DaysBack_TextChanged={} - - #endregion Generated Events - - #---------------------------------------------- - #region Generated Form Code - #---------------------------------------------- - # - # form1 - # - #$form1.Controls.Add($PanelEventLogs_Events) - #$form1.Controls.Add($PanelEventLogs_Filter) - - $form1.Controls.Add($Script:Output) - $form1.Controls.Add($Script:Output_Left) - $form1.Controls.Add($Script:Output_Right) - $form1.Controls.Add($Script:Collection_DropDownBox) - $form1.Controls.Add($Script:Deployment_DropDownBox) - $form1.Controls.Add($Script:Combobox_Tools) - $form1.Controls.Add($GroupBox) - $form1.Controls.Add($GroupBox_Info) - $form1.controls.Add($Script:RadioButton_Window) - $form1.controls.Add($Script:RadioButton_GridView) - $form1.Controls.Add($Script:RadioButton_CSV) - $form1.Controls.Add($Button_Go) - $form1.Controls.Add($Script:TextBox_CollectionName) - $form1.Controls.Add($label_CollectionName) - $form1.Controls.Add($label_CollectionName_Value) - $form1.Controls.Add($label_DeploymentName) - $form1.controls.Add($label_DeploymentName_Value) - $form1.Controls.Add($label_DeploymentTime) - $form1.Controls.Add($label_DeploymentTime_Value) - $form1.Controls.Add($label_DeviceCount) - $form1.Controls.Add($label_DeviceCount_Value) - - - $form1.AutoScaleDimensions = '6, 13' - $form1.AutoScaleMode = 'Font' - $form1.ClientSize = '1000, 800' - $form1.Name = 'form1' - $form1.Text = 'Form' - $form1.add_Load($form1_Load) - #endregion Generated Form Code - - #---------------------------------------------- -<# - $PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect) - $PanelEventLogs_Events.Controls.Add($Button_ELogs_View) - $PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList) - $PanelEventLogs_Events.Controls.Add($VCenterUserPassword) - $PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin) - $PanelEventLogs_Events.Controls.Add($labelVCenterUserName) - $PanelEventLogs_Events.Controls.Add($labelVCenterPassword) - $PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox) - $PanelEventLogs_Events.BackColor = '153,153,153' - $PanelEventLogs_Events.Location = '6, 6' - $PanelEventLogs_Events.Name = 'panelEventLogs_Events' - $PanelEventLogs_Events.Size = '598, 56' - $PanelEventLogs_Events.TabIndex = 0 - $PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint) - - $PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level) - $PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_Level) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID) - $PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack) - $PanelEventLogs_Filter.BackColor = '255,255,212' - $PanelEventLogs_Filter.Location = '6, 62' - $PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter' - $PanelEventLogs_Filter.Size = '598, 56' - $PanelEventLogs_Filter.BorderStyle = 'FixedSingle' - $PanelEventLogs_Filter.TabIndex = 0 - $PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint) -#> - # - # $Text_ELogs_ServerName - <# - $Text_ELogs_ServerName.Location = '8, 26' - $Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName' - $Text_ELogs_ServerName.Size = '100, 20' - $Text_ELogs_ServerName.text = "l2012" - $Text_ELogs_ServerName.TabIndex = 6 - $Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged) - # - # - # Text_ELogs_EventID - # - $Text_ELogs_EventID.Location = '115, 26' - $Text_ELogs_EventID.Name = 'Text_ELogs_EventID' - $Text_ELogs_EventID.Size = '40, 20' - $Text_ELogs_EventID.TabIndex = 7 - $Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged) - # - # Text_Elogs_DaysBack - # - $Text_Elogs_DaysBack.Location = '175, 26' - $Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack' - $Text_Elogs_DaysBack.Size = '40, 20' - $Text_Elogs_DaysBack.TabIndex = 7 - $Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged) - #> - # Output - # - $Script:Output.Location = '10, 250' - $Script:Output.Multiline = $True - $Script:Output.Name = 'Output' - $Script:Output.ScrollBars = 'both' - $Script:Output.Size = '965, 500' - $Script:Output.Font = 'Consolas, 8.25pt' - $Script:Output.WordWrap = $False - $Script:Output.TabIndex = 5 - $Script:Output.add_TextChanged($Output_TextChanged) - $Script:Output.Visible = $True - # - $Script:Output_Left.Location = '20, 250' - $Script:Output_Left.Multiline = $True - $Script:Output_Left.Name = 'Output_Left' - $Script:Output_Left.ScrollBars = 'both' - $Script:Output_Left.Size = '470, 500' - $Script:Output_Left.Font = 'Consolas, 8.25pt' - $Script:Output_Left.WordWrap = $False - #$Script:Output_Left.TabIndex = 5 - - $Script:Output_Left.add_TextChanged($Output_Left_TextChanged) - # - $Script:Output_Right.Location = '510, 250' - $Script:Output_Right.Multiline = $True - $Script:Output_Right.Name = 'Output_Right' - $Script:Output_Right.ScrollBars = 'both' - $Script:Output_Right.Size = '470, 500' - $Script:Output_Right.Font = 'Consolas, 8.25pt' - $Script:Output_Right.WordWrap = $False - #$Script:Output_Right.TabIndex = 5 - $Script:Output_Right.add_TextChanged($Output_Right_TextChanged) - # - # ComboboxServiceStartMode - # - $Script:Collection_DropDownBox.FormattingEnabled = $True - $Script:Collection_DropDownBox.Location = '20, 80' - $Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox' - $Script:Collection_DropDownBox.Size = '180, 20' - $Script:Collection_DropDownBox.TabIndex = 2 - $Script:Collection_DropDownBox.Text = '--Deployed to Collections--' - $Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged) - # - $Script:Deployment_DropDownBox.Location = '20,30' - #$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50) - $Script:Deployment_DropDownBox.Size = '580,50' - #$Script:Deployment_DropDownBox.DropDownHeight = 200 - $Script:Deployment_DropDownBox.text = "----Select Deployment----" - #$Script:Deployment_DropDownBox.Visible = $false - $Script:Deployment_DropDownBox.add_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged) - # - #$Script:Combobox_Tools.Size = New-Object System.Drawing.Size(180,20) - #$Script:Combobox_Tools.DropDownHeight = 200 - $Script:Combobox_Tools.text = "----Select Tool----!" - $Script:Combobox_Tools.Location = '20,170' - $Script:Combobox_Tools.Size = '180,10' - $Script:Combobox_Tools.add_SelectedIndexChanged($Script:Combobox_Tools_SelectedIndexChanged) - # - $groupBox.Location = '270,70' - $groupBox.size = New-Object System.Drawing.Size(150,90) - $groupBox.text = "Select Output:" - - - $GroupBox.Controls.Add($Script:RadioButton_Window) - $GroupBox.Controls.Add($Script:RadioButton_GridView) - $GroupBox.Controls.Add($Script:RadioButton_CSV) - # - $GroupBox_Info.Location = '670,25' - $GroupBox_Info.Size = '300,200' - $GroupBox_Info.Text = "Deployment Info" - ############ - $GroupBox_Info.Controls.Add($label_CollectionName) - $GroupBox_Info.Controls.Add($label_CollectionName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentName) - $GroupBox_Info.Controls.Add($label_DeploymentName_Value) - $GroupBox_Info.Controls.Add($label_DeploymentTime) - $GroupBox_Info.Controls.Add($label_DeploymentTime_Value) - $GroupBox_Info.Controls.Add($label_DeviceCount) - $GroupBox_Info.Controls.Add($label_DeviceCount_Value) - ############ - $label_CollectionName.AutoSize = $True - $label_CollectionName.Font = 'Microsoft Sans Serif, 9.0pt' #, style=Bold' - #$label_CollectionName.ForeColor = 'DarkGreen' - #$label_CollectionName.TextAlign = 'MiddleRight' - $label_CollectionName.Location = '20,25' - $label_CollectionName.Name = 'Collection_Name' - $label_CollectionName.Size = '41, 13' - #$label_CollectionName.TabIndex = 6 - $label_CollectionName.Text = 'Collection Name:' - #$label_CollectionName.add_Click($label_CollectionName_Click) - - ############ Value ############### - $label_CollectionName_Value.AutoSize = $True - $label_CollectionName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_CollectionName_Value.ForeColor = 'DarkGreen' - #$label_CollectionName_Value.TextAlign = 'MiddleRight' - $label_CollectionName_Value.Location = '140,25' - $label_CollectionName_Value.Name = 'Collection_Name_Value' - $label_CollectionName_Value.Size = '41, 13' - #$label_CollectionName_Value.TabIndex = 6 - $label_CollectionName_Value.Text = '_' - #$label_CollectionName_Value.add_Click($label_CollectionName_Value_Click) - - ############ - $label_DeploymentName.AutoSize = $True - $label_DeploymentName.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName.ForeColor = 'DarkGreen' - #$label_DeploymentName.TextAlign = 'MiddleRight' - $label_DeploymentName.Location = '20,45' - $label_DeploymentName.Name = 'Deployment_Name' - $label_DeploymentName.Size = '41, 13' - #$label_DeploymentName.TabIndex = 6 - $label_DeploymentName.Text = 'Deployment Name:' - #$label_DeploymentName.add_Click($label_DeploymentName_Click) - - ############ Value ############ - $label_DeploymentName_Value.AutoSize = $True - $label_DeploymentName_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentName_Value.ForeColor = 'DarkGreen' - #$label_DeploymentName_Value.TextAlign = 'MiddleRight' - $label_DeploymentName_Value.Location = '140,45' - $label_DeploymentName_Value.Name = 'Deployment_Name_Value' - $label_DeploymentName_Value.Size = '41, 13' - #$label_DeploymentName_Value.TabIndex = 6 - $label_DeploymentName_Value.Text = '_' - #$label_DeploymentName_Value.add_Click($label_DeploymentName_Value_Click) - - ############# - $label_DeploymentTime.AutoSize = $True - $label_DeploymentTime.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime.ForeColor = 'DarkGreen' - #$label_DeploymentTime.TextAlign = 'MiddleRight' - $label_DeploymentTime.Location = '20,65' - $label_DeploymentTime.Name = 'Deployment_Time' - $label_DeploymentTime.Size = '41, 13' - #$label_DeploymentTime.TabIndex = 6 - $label_DeploymentTime.Text = 'Deployment Time:' - #$label_DeploymentTime.add_Click($label_CollectionName_Click) - - ############ Value ############ - $label_DeploymentTime_Value.AutoSize = $True - $label_DeploymentTime_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeploymentTime_Value.ForeColor = 'DarkGreen' - #$label_DeploymentTime_Value.TextAlign = 'MiddleRight' - $label_DeploymentTime_Value.Location = '140,65' - $label_DeploymentTime_Value.Name = 'Deployment_Time_Value' - $label_DeploymentTime_Value.Size = '41, 13' - #$label_DeploymentTime_Value.TabIndex = 6 - $label_DeploymentTime_Value.Text = '_' - #$label_DeploymentTime_Value.add_Click($label_DeploymentTime_Value_Click) - - ########### - $label_DeviceCount.AutoSize = $True - $label_DeviceCount.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount.ForeColor = 'DarkGreen' - #$label_DeviceCount.TextAlign = 'MiddleRight' - $label_DeviceCount.Location = '20,85' - $label_DeviceCount.Name = 'Device_Count' - $label_DeviceCount.Size = '41, 13' - #$label_DeviceCount.TabIndex = 6 - $label_DeviceCount.Text = 'Device Count' - #$label_DeviceCount.add_Click($label_DeviceCount_Click) - - ############ Value ############ - $label_DeviceCount_Value.AutoSize = $True - $label_DeviceCount_Value.Font = 'Microsoft Sans Serif, 8.50pt, style=Bold' - $label_DeviceCount_Value.ForeColor = 'DarkGreen' - #$label_DeviceCount_Value.TextAlign = 'MiddleRight' - $label_DeviceCount_Value.Location = '140,85' - $label_DeviceCount_Value.Name = 'Device_Count_Value' - $label_DeviceCount_Value.Size = '41, 13' - #$label_DeviceCount_Value.TabIndex = 6 - $label_DeviceCount_Value.Text = '_' - #$label_DeviceCount_Value.add_Click($label_DeviceCount_Value_Click) - ############ - $Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton_Window.Checked = $true - $Script:RadioButton_Window.Text = "Window" - #$Script:RadioButton_Window. - # - $Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_GridView.Checked = $False - $Script:RadioButton_GridView.Text = "GridView" - # - $Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton_CSV.Checked = $False - $Script:RadioButton_CSV.Text = "CSV" - # - $Button_Go.Location = New-Object System.Drawing.Size(450,75) - $Button_Go.Size = New-Object System.Drawing.Size(110,80) - $Button_Go.Text = "Go" - #$Button_Go.Add_Click({temp}) - $Button_Go.Add_Click($Button_Go_Click) - # - $Script:TextBox_CollectionName.Left = 20; - $Script:TextBox_CollectionName.Top = 130; - $Script:TextBox_CollectionName.width = 200; - $Script:TextBox_CollectionName.Text = "Nabil - Test Collection" - # - ############################################################################ - Update-Dropdown1 - ConnectTo-SCCM - Deployment-List -Deployment_History 10 - $Script:Output.Text = "helloooooooo" - #cd c: - - - ############################################################################ - -#Save the initial state of the form - $InitialFormWindowState = $form1.WindowState - #Init the OnLoad event to correct the initial state of the form - $form1.add_Load($Form_StateCorrection_Load) - #Clean up the control events - $form1.add_FormClosed($Form_Cleanup_FormClosed) - #Show the Form - return $form1.ShowDialog() - -} #End Function - -#Call the form -Show-Form-Template_psf | Out-Null diff --git a/dump/SCCM-Tool/Old-Versions/NA-Tool-GUI.ps1 b/dump/SCCM-Tool/Old-Versions/NA-Tool-GUI.ps1 deleted file mode 100644 index e16ec00..0000000 --- a/dump/SCCM-Tool/Old-Versions/NA-Tool-GUI.ps1 +++ /dev/null @@ -1,293 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent - -$Script:ALL_Patch_Servers = @() -$Script:Responding = @() -$Script:NotResponding = @() -$Global:Collection_Name = "" -$Global:Select_Tool -$Global:Output_Type = "" - -If(!(Get-PSDrive -Name SCCM-Drive -ErrorAction SilentlyContinue)) { - 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" -} -######################################################################################################################################################### -Function Start-Form { - - #$Global:Collection_Name = "" - #$Global:Select_Tool = "" - #$Global:Output_Type = "" - - $Temp = "" - - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") - [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") - - $Form = New-Object System.Windows.Forms.Form - $Form.Size = New-Object System.Drawing.Size(900,500) - ############################################## - #$Form_Load={ $Script:outputBox.text = "Welcome" } - ############################################## Start functions - <# function pingInfo { - - if ($RadioButton1.Checked -eq $true) {$nrOfPings=1} - if ($RadioButton2.Checked -eq $true) {$nrOfPings=2} - if ($RadioButton3.Checked -eq $true) {$nrOfPings=3} - - $computer=$DropDownBox.SelectedItem.ToString() #populate the var with the value you selected - $pingResult=ping $wks -n $nrOfPings | fl | out-string; - $Script:outputBox.text=$pingResult - - } #end pingInfo - #> - ############################################## end functions - Function SCCM-Module { - - If(!(Get-PSDrive).Name -eq "sccm-drive") { - 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" - }#endIf - CD sccm-drive: - }#endFunction - ############################################## - Function Run-Defaults { - $Script:textBox1.Text = "Nabil - Test Collection" - $Script:RadioButton1.Checked = $true - } - ############################################## - Function temp { - $outputBox.Clear() - #$Script:outputBox.text = $textBox1.text | Out-String - $Global:Collection_Name = $textBox1.Text - #$Global:Select_Tool = $RadioButton1.Checked - - $Global:Select_Tool = $DropDownBox.text - #$Global:Output_Type = - If ($RadioButton1.Checked -eq $true) { $Global:Output_Type = "Window"; $outputBox.Text = "Radio1 Checked: $($RadioButton1.Checked)" | Out-String } - ElseIf ($RadioButton2.Checked -eq $true) { $Global:Output_Type = "Gridview"; $outputBox.Text = "Radio2 Checked: $RadioButton2.Checked" | Out-String } - ElseIf ($RadioButton3.Checked -eq $true) { $Global:Output_Type = "Export"; $outputBox.Text = "Radio3 Checked: $RadioButton2.Checked" | Out-String } - - If($Global:Collection_Name -and $Global:Select_Tool) { - # If($DropDownBox.text = "Tool1"){gcc} - Run-Tool - $textBox1.clear() - $DropDownBox.text = "----Select Tool----" - Clear-Variables - }#endIf - Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red } - $Script:outputBox.SelectionColor = 'red' - $Script:outputBox.Text = "You must select 'Tool' and enter Collection Name............!!" - } - Run-Defaults - }#endFunction - ############################################## - Function Update-Dropdown1 { - # $Collections += $textBox1.text - $Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Tool4","Tool5","Tool6","Tool7") - $Collections | % { $DropDownBox.Items.Add($_) } - } - ############################################## - Function gcc { - $Script:outputBox.text = Get-Service | Out-String - } - ############################################## - Function Clear-Variables { - $Global:Collection_Name = "" - $Global:Select_Tool = "" - $Global:Output_Type = "" - - $Script:ALL_Patch_Servers = @() - } -#region Controls - ############################################## Start group boxes - $groupBox = New-Object System.Windows.Forms.GroupBox - $groupBox.Location = New-Object System.Drawing.Size(270,20) - $groupBox.size = New-Object System.Drawing.Size(150,110) - $groupBox.text = "Select Output:" - $Form.Controls.Add($groupBox) - ############################################## end group boxes - - ############################################## Start radio buttons - $Script:RadioButton1 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton1.Location = new-object System.Drawing.Point(15,15) - $Script:RadioButton1.size = New-Object System.Drawing.Size(130,20) - $Script:RadioButton1.Checked = $true - $Script:RadioButton1.Text = "Window" - $groupBox.Controls.Add($RadioButton1) - - $Script:RadioButton2 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton2.Location = new-object System.Drawing.Point(15,35) - $Script:RadioButton2.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton2.Text = "Gridview" - $groupBox.Controls.Add($RadioButton2) - - $Script:RadioButton3 = New-Object System.Windows.Forms.RadioButton - $Script:RadioButton3.Location = new-object System.Drawing.Point(15,55) - $Script:RadioButton3.size = New-Object System.Drawing.Size(80,20) - $Script:RadioButton3.Text = "Export csv" - $groupBox.Controls.Add($RadioButton3) - - ############################################## end radio buttons - ########### Text Box ########### - ############Define text box1 for input - $Script:textBox1 = New-Object “System.Windows.Forms.TextBox”; - $Script:textBox1.Left = 20; - $Script:textBox1.Top = 30; - $Script:textBox1.width = 200; - $Script:textBox1.Text = "Nabil - Test Collection" - $Form.Controls.Add($textBox1) - ############################################## Start drop down boxes - - $Script:DropDownBox = New-Object System.Windows.Forms.ComboBox - $Script:DropDownBox.Location = New-Object System.Drawing.Size(20,80) - $Script:DropDownBox.Size = New-Object System.Drawing.Size(180,20) - $Script:DropDownBox.DropDownHeight = 200 - $Script:DropDownBox.text = "----Select Tool----" - $Form.Controls.Add($DropDownBox) - - ############################################## end drop down boxes - - <############################################## Start text fields - - $Script:outputBox = New-Object System.Windows.Forms.TextBox - $Script:outputBox.Location = New-Object System.Drawing.Size(10,150) - $Script:outputBox.Size = New-Object System.Drawing.Size(865,300) - $Script:outputBox.MultiLine = $True - - $Script:outputBox.ScrollBars = "Vertical" - $Form.Controls.Add($Script:outputBox) - ###########> - $SCRIPT:outputBox=New-Object System.Windows.Forms.RichTextBox - $outputBox.Location=New-Object System.Drawing.Size(10,150) - $outputBox.Size=New-Object System.Drawing.Size(865,300) - $outputBox.Multiline=$True - $outputBox.ReadOnly = $True - $outputBox.BackColor = [Drawing.Color]::White - $outputBox.ScrollBars = "Vertical" - $form.Controls.Add($Script:outputBox) - - - - - ############################################## end text fields - - ############################################## Start buttons - - $Button = New-Object System.Windows.Forms.Button - $Button.Location = New-Object System.Drawing.Size(450,30) - $Button.Size = New-Object System.Drawing.Size(110,80) - $Button.Text = "Go" - $Button.Add_Click({temp}) - $Form.Controls.Add($Button) -#endregion Controls - ############################################## end buttons - Update-Dropdown1 - - $Form.Add_Shown({$Form.Activate()}) - [void] $Form.ShowDialog() - -} -######################################################################################################################################################### - <# Function Input-Box { - [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') - $Global:Collection_Name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter your name", "Name", "Enter Collection Name") - - } - #> -############################################################################################################################################################# - Function Display-Results { - #Param($Global:Output_Type,$Final_Result) - Write-Host "DisplayType: $($Global:Output_Type)" - Switch ($Global:Output_Type){ - - Window { $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String} - Gridview { $Script:ALL_Patch_Servers | Out-GridView } - Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv } - - }#endSwitch - - } -############################################################################################################################################################# - Function Collection-Servers { - #Param($Coll_Name) - - Write-Host "Collection:$Global:Collection_Name" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount - $Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation - #$ServerName = $DeviceCollection_ServerNames.Name - Set-Location c: - - #$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient - - $Script:DeviceCollection_ServerNames | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name - $Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient - $Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name - #$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount} - - $Obj - $Script:ALL_Patch_Servers += $Obj - - }#end% - - # $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String - Display-Results #-Final_Result $Script:ALL_Patch_Servers - Write-Host "$Script:ALL_Patch_Servers" - - }#endFunction -############################################################################################################################################################# - Function Ping_Collection { - - Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green - Write-Host "" - - SCCM-Module - #CD sccm-drive: - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - Set-Location c: - $Script:DeviceCollection_ServerNames1.Name | % { - - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - $Script:outputBox.AppendText("Responding: $_") - - $Responding += $_ - - }#endIf - - Else { - $Script:outputBox.AppendText("NOT Responding: $_") - $NotResponding += $_ } - - }#end% - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red - - Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - }#endFunction -############################################################################################################################################################# - Function Check_Uptime { - SCCM-Module - $Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name - $Script:outputBox.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String - - } -############################################################################################################################################################# - Function Run-Tool { - - Switch($Global:Select_Tool) { - Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" } - Ping-Collection { Ping_Collection } - Check_Uptime { Check_Uptime } - }#endSwitch - #Clear-Variables - }#endFunction -############################################################################################################################################################# -Start-Form - diff --git a/dump/SCCM-Tool/Old-Versions/Tool-Remotely-Restart-SCCMSyncCycle.ps1 b/dump/SCCM-Tool/Old-Versions/Tool-Remotely-Restart-SCCMSyncCycle.ps1 deleted file mode 100644 index 99afeb7..0000000 --- a/dump/SCCM-Tool/Old-Versions/Tool-Remotely-Restart-SCCMSyncCycle.ps1 +++ /dev/null @@ -1,130 +0,0 @@ -Function Restart-SCCMSyncCycle { -<# -.Synopsis - Remotely restarts sccm service cycles. - - -.DESCRIPTION - This function restarts all sccm policies on a remote client so that the client can immediately get any pending software updates or inventory. - - -.NOTES - Name: Restart-SCCMSyncCycle - Author: theSysadminChannel - Version: 1 - DateCreated: 2017-02-09 - - -.LINK - https://thesysadminchannel.com/remotely-restart-sccmsynccycle-using-powershell - - - -.PARAMETER ComputerName - The computer to which connectivity will be checked - - -.EXAMPLE - Restart-SCCMSyncCycle -Computername Pactest-1 - - Description: - Will restart all sccm services on a remote machine. - -.EXAMPLE - Restart-SCCMSyncCycle -ComputerName pactest-1, pactest-2, pactest-3 - - Description: - Will generate a list of installed programs on pactest-1, pactest-2 and pactest-3 - -#> - - - [CmdletBinding()] - param( - [Parameter( - ValueFromPipeline=$true, - ValueFromPipelineByPropertyName=$true, - Position=0)] - [string[]] $ComputerName = $env:COMPUTERNAME - - ) - - Foreach ($Computer in $ComputerName ) { - try { - - Write-Host "=====================================================================" - Write-Output "$Computer : Machine Policy Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000022}" -ErrorAction Stop | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Application Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000121}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Discovery Data Collection Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000003}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : File Collection Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000010}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Hardware Inventory Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000001}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Machine Policy Retrieval Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000021}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Inventory Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000002}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Software Metering Usage Report Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000031}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Update Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000114}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : Software Update Scan Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000113}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : State Message Refresh" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000111}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Retrieval Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000026}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Evaluation Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000027}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Windows Installers Source List Update Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000032}" | select -ExpandProperty PSComputerName | Out-Null - - sleep 1 - } - - catch { - Write-Host $Computer.toUpper() "is not online or Account is locked out" -ForegroundColor:Red - Write-Host - Write-Host - - } - } -} - - -# Restart-SCCMSyncCycle pver001 -# Restart-SCCMSyncCycle - -# Restart-SCCMSyncCycle $DeviceCollection_ServerNames.name - -Restart-SCCMSyncCycle w2012a,w2012b - - diff --git a/dump/SCCM-Tool/Results.csv b/dump/SCCM-Tool/Results.csv deleted file mode 100644 index a295f3b..0000000 --- a/dump/SCCM-Tool/Results.csv +++ /dev/null @@ -1,3 +0,0 @@ -"Server","ClientInstalled","CollectionName" -"W2012A","True","Nabil - Test Collection" -"W2012B","True","Nabil - Test Collection" diff --git a/dump/SCCM-Tool/Tool-Deployment-List.ps1 b/dump/SCCM-Tool/Tool-Deployment-List.ps1 deleted file mode 100644 index 34d088e..0000000 --- a/dump/SCCM-Tool/Tool-Deployment-List.ps1 +++ /dev/null @@ -1,5 +0,0 @@ - $T = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-30)) } - - - - diff --git a/dump/SCCM-Tool/Tool-Get-SCCMSoftwareUpdateStatus.ps1 b/dump/SCCM-Tool/Tool-Get-SCCMSoftwareUpdateStatus.ps1 deleted file mode 100644 index 2fe9358..0000000 --- a/dump/SCCM-Tool/Tool-Get-SCCMSoftwareUpdateStatus.ps1 +++ /dev/null @@ -1,149 +0,0 @@ -param($Dep_ID) - -Get-SCCMSoftwareUpdateStatus -DeploymentID $Dep_ID - -function Get-SCCMSoftwareUpdateStatus { -<# -.Synopsis - This will output the device status for the Software Update Deployments within SCCM. - For updated help and examples refer to -Online version. - - -.DESCRIPTION - This will output the device status for the Software Update Deployments within SCCM. - For updated help and examples refer to -Online version. - - -.NOTES - Name: Get-SCCMSoftwareUpdateStatus - Author: The Sysadmin Channel - Version: 1.0 - DateCreated: 2018-Nov-10 - DateUpdated: 2018-Nov-10 - -.LINK - https://thesysadminchannel.com/get-sccm-software-update-status-powershell - - - -.EXAMPLE - For updated help and examples refer to -Online version. - -#> - - [CmdletBinding()] - - param( - [Parameter()] - [switch] $DeploymentIDFromGUI, - - [Parameter(Mandatory = $false)] - [Alias('ID', 'AssignmentID')] - [string] $DeploymentID, - - [Parameter(Mandatory = $false)] - [ValidateSet('Success', 'InProgress', 'Error', 'Unknown')] - [Alias('Filter')] - [string] $Status - - - ) - - BEGIN { - $Site_Code = 'CCX' - $Site_Server = 'PNCRASCCM001' - $HasErrors = $False - - if ($Status -eq 'Success') { - $StatusType = 1 - } - - if ($Status -eq 'InProgress') { - $StatusType = 2 - } - - if ($Status -eq 'Unknown') { - $StatusType = 4 - } - - if ($Status -eq 'Error') { - $StatusType = 5 - } - - } - - PROCESS { - - try { - if ($DeploymentID -and $DeploymentIDFromGUI) { - Write-Error "Select the DeploymentIDFromGUI or DeploymentID Parameter. Not Both" - $HasErrors = $True - throw - } - - if ($DeploymentIDFromGUI) { - $ShellLocation = Get-Location - Import-Module (Join-Path $(Split-Path $env:SMS_ADMIN_UI_PATH) ConfigurationManager.psd1) - - #Checking to see if module has been imported. If not abort. - if (Get-Module ConfigurationManager) { - Set-Location "$($Site_Code):\" - $DeploymentID = Get-CMSoftwareUpdateDeployment | select AssignmentID, AssignmentName | Out-GridView -OutputMode Single -Title "Select a Deployment and Click OK" | Select -ExpandProperty AssignmentID - Set-Location $ShellLocation - } else { - Write-Error "The SCCM Module wasn't imported successfully. Aborting." - $HasErrors = $True - throw - } - } - - if ($DeploymentID) { - $DeploymentNameWithID = Get-WMIObject -ComputerName $Site_Server -Namespace root\sms\site_$Site_Code -class SMS_SUMDeploymentAssetDetails -Filter "AssignmentID = $DeploymentID" | select AssignmentID, AssignmentName - $DeploymentName = $DeploymentNameWithID.AssignmentName | select -Unique - } else { - Write-Error "A Deployment ID was not specified. Aborting." - $HasErrors = $True - throw - } - - if ($Status) { - $Output = Get-WMIObject -ComputerName $Site_Server -Namespace root\sms\site_$Site_Code -class SMS_SUMDeploymentAssetDetails -Filter "AssignmentID = $DeploymentID and StatusType = $StatusType" | ` - select DeviceName, CollectionName, @{Name = 'StatusTime'; Expression = {$_.ConvertToDateTime($_.StatusTime) }}, @{Name = 'Status' ; Expression = {if ($_.StatusType -eq 1) {'Success'} elseif ($_.StatusType -eq 2) {'InProgress'} elseif ($_.StatusType -eq 5) {'Error'} elseif ($_.StatusType -eq 4) {'Unknown'} }} - - } else { - $Output = Get-WMIObject -ComputerName $Site_Server -Namespace root\sms\site_$Site_Code -class SMS_SUMDeploymentAssetDetails -Filter "AssignmentID = $DeploymentID" | ` - select DeviceName, CollectionName, @{Name = 'StatusTime'; Expression = {$_.ConvertToDateTime($_.StatusTime) }}, @{Name = 'Status' ; Expression = {if ($_.StatusType -eq 1) {'Success'} elseif ($_.StatusType -eq 2) {'InProgress'} elseif ($_.StatusType -eq 5) {'Error'} elseif ($_.StatusType -eq 4) {'Unknown'} }} - } - - if (-not $Output) { - Write-Error "A Deployment with ID: $($DeploymentID) is not valid. Aborting" - $HasErrors = $True - throw - - } - - } catch { - - - } finally { - if (($HasErrors -eq $false) -and ($Output)) { - Write-Output "" - Write-Output "Deployment Name: $DeploymentName" - Write-Output "Deployment ID: $DeploymentID" - Write-Output "" - Write-Output $Output | Sort-Object Status - } - } - } - - END {} - -} - - - - -# $T = Get-SCCMSoftwareUpdateStatus -DeploymentID 16778048 - -# Get-SCCMSoftwareUpdateStatus -DeploymentIDFromGUI | ? { $_.Assignmentname -like "dsfsdfsd" } - -# Get-SCCMSoftwareUpdateStatus -DeploymentIDFromGUI diff --git a/dump/SCCM-Tool/Tool-Remotely Restart-SCCMSyncCycle.ps1 b/dump/SCCM-Tool/Tool-Remotely Restart-SCCMSyncCycle.ps1 deleted file mode 100644 index 104155c..0000000 --- a/dump/SCCM-Tool/Tool-Remotely Restart-SCCMSyncCycle.ps1 +++ /dev/null @@ -1,132 +0,0 @@ -$Location1 = Split-Path $MyInvocation.MyCommand.Path -Parent - -Function Restart-SCCMSyncCycle { -<# -.Synopsis - Remotely restarts sccm service cycles. - - -.DESCRIPTION - This function restarts all sccm policies on a remote client so that the client can immediately get any pending software updates or inventory. - - -.NOTES - Name: Restart-SCCMSyncCycle - Author: theSysadminChannel - Version: 1 - DateCreated: 2017-02-09 - - -.LINK - https://thesysadminchannel.com/remotely-restart-sccmsynccycle-using-powershell - - - -.PARAMETER ComputerName - The computer to which connectivity will be checked - - -.EXAMPLE - Restart-SCCMSyncCycle -Computername Pactest-1 - - Description: - Will restart all sccm services on a remote machine. - -.EXAMPLE - Restart-SCCMSyncCycle -ComputerName pactest-1, pactest-2, pactest-3 - - Description: - Will generate a list of installed programs on pactest-1, pactest-2 and pactest-3 - -#> - - - [CmdletBinding()] - param( - [Parameter( - ValueFromPipeline=$true, - ValueFromPipelineByPropertyName=$true, - Position=0)] - [string[]] $ComputerName = $env:COMPUTERNAME - - ) - - Foreach ($Computer in $ComputerName ) { - try { - - Write-Host "=====================================================================" - Write-Output "$Computer : Machine Policy Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000022}" -ErrorAction Stop | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Application Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000121}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Discovery Data Collection Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000003}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : File Collection Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000010}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Hardware Inventory Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000001}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Machine Policy Retrieval Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000021}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Inventory Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000002}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Software Metering Usage Report Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000031}" | select -ExpandProperty PSComputerName | Out-Null - - - Write-Output "$Computer : Software Update Deployment Evaluation Cycle" - Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000114}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : Software Update Scan Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000113}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : State Message Refresh" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000111}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Retrieval Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000026}" | select -ExpandProperty PSComputerName | Out-Null - - - #Write-Output "$Computer : User Policy Evaluation Cycle" - #Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000027}" | select -ExpandProperty PSComputerName | Out-Null - - - # Write-Output "$Computer : Windows Installers Source List Update Cycle" - # Invoke-WMIMethod -ComputerName $Computer -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000032}" | select -ExpandProperty PSComputerName | Out-Null - - sleep 1 - } - - catch { - Write-Host $Computer.toUpper() "is not online or Account is locked out" -ForegroundColor:Red - Write-Host - Write-Host - - } - } -} - - -# Restart-SCCMSyncCycle pver001 -# Restart-SCCMSyncCycle - -# Restart-SCCMSyncCycle $DeviceCollection_ServerNames.name -$Collection_Servers = Import-Csv $Location1\Current-Collection-Servers.csv -Restart-SCCMSyncCycle w2012a,w2012b $Collection_Servers.Server - - diff --git a/dump/SCCM-Tool/test1.ps1 b/dump/SCCM-Tool/test1.ps1 deleted file mode 100644 index 7b9d9b8..0000000 --- a/dump/SCCM-Tool/test1.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$NotResponding = @() -$Ping_Result = @() - $Script:DeviceCollection_ServerNames1.Name | % { - $Server = $_ - $Obj = New-Object -TypeName PSObject - - If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { - #Write-Host "Responding:---- $_ " -ForegroundColor Green - #$Script:Output.AppendText("Responding: $_") - - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" - $Ping_Result += $Obj - - }#endIf - - Else { - - $NotResponding += $Server - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server - $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" - $Ping_Result += $Obj - } - }#end% - $Ping_Result - $NotResponding \ No newline at end of file diff --git a/dump/SCCM-Troubleshooting/Updates-Not-Synchronizing.txt b/dump/SCCM-Troubleshooting/Updates-Not-Synchronizing.txt deleted file mode 100644 index cff2008..0000000 --- a/dump/SCCM-Troubleshooting/Updates-Not-Synchronizing.txt +++ /dev/null @@ -1,19 +0,0 @@ -https://www.windows-noob.com/forums/topic/7522-wsus-sync-sccm-error/ - - deselecting all classifications in SUP (SCCM: Administration/Site/Primary Site/ (Configure Site Components/Softwar Update Point/Classifications/)) - Manual Sync in SUP - - - -1) unselect all Classifications in SUP -2) Perform wsusutil reset -3) Perform sync -4) Re add the Classifications. - - - -"wsusutil reset" in WSUS (C:\Program Files\Update Services\Tools) - selecting classification in SUP - Manual Sync in SUP - -log: c:\Program Files\Microsoft Configuration Manager\LOgs\wsyncmgr.log \ No newline at end of file diff --git a/dump/SCCM-WID-ReIndex-Script.txt b/dump/SCCM-WID-ReIndex-Script.txt deleted file mode 100644 index 0a0dfb9..0000000 --- a/dump/SCCM-WID-ReIndex-Script.txt +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -This sample T-SQL script performs basic maintenance tasks on SUSDB -1. Identifies indexes that are fragmented and defragments them. For certain - tables, a fill-factor is set in order to improve insert performance. - Based on MSDN sample at http://msdn2.microsoft.com/en-us/library/ms188917.aspx - and tailored for SUSDB requirements -2. Updates potentially out-of-date table statistics. -******************************************************************************/ - -USE SUSDB; -GO -SET NOCOUNT ON; - --- Rebuild or reorganize indexes based on their fragmentation levels -DECLARE @work_to_do TABLE ( - objectid int - , indexid int - , pagedensity float - , fragmentation float - , numrows int -) - -DECLARE @objectid int; -DECLARE @indexid int; -DECLARE @schemaname nvarchar(130); -DECLARE @objectname nvarchar(130); -DECLARE @indexname nvarchar(130); -DECLARE @numrows int -DECLARE @density float; -DECLARE @fragmentation float; -DECLARE @command nvarchar(4000); -DECLARE @fillfactorset bit -DECLARE @numpages int - --- Select indexes that need to be defragmented based on the following --- * Page density is low --- * External fragmentation is high in relation to index size -PRINT 'Estimating fragmentation: Begin. ' + convert(nvarchar, getdate(), 121) -INSERT @work_to_do -SELECT - f.object_id - , index_id - , avg_page_space_used_in_percent - , avg_fragmentation_in_percent - , record_count -FROM - sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL , NULL, 'SAMPLED') AS f -WHERE - (f.avg_page_space_used_in_percent < 85.0 and f.avg_page_space_used_in_percent/100.0 * page_count < page_count - 1) - or (f.page_count > 50 and f.avg_fragmentation_in_percent > 15.0) - or (f.page_count > 10 and f.avg_fragmentation_in_percent > 80.0) - -PRINT 'Number of indexes to rebuild: ' + cast(@@ROWCOUNT as nvarchar(20)) - -PRINT 'Estimating fragmentation: End. ' + convert(nvarchar, getdate(), 121) - -SELECT @numpages = sum(ps.used_page_count) -FROM - @work_to_do AS fi - INNER JOIN sys.indexes AS i ON fi.objectid = i.object_id and fi.indexid = i.index_id - INNER JOIN sys.dm_db_partition_stats AS ps on i.object_id = ps.object_id and i.index_id = ps.index_id - --- Declare the cursor for the list of indexes to be processed. -DECLARE curIndexes CURSOR FOR SELECT * FROM @work_to_do - --- Open the cursor. -OPEN curIndexes - --- Loop through the indexes -WHILE (1=1) -BEGIN - FETCH NEXT FROM curIndexes - INTO @objectid, @indexid, @density, @fragmentation, @numrows; - IF @@FETCH_STATUS < 0 BREAK; - - SELECT - @objectname = QUOTENAME(o.name) - , @schemaname = QUOTENAME(s.name) - FROM - sys.objects AS o - INNER JOIN sys.schemas as s ON s.schema_id = o.schema_id - WHERE - o.object_id = @objectid; - - SELECT - @indexname = QUOTENAME(name) - , @fillfactorset = CASE fill_factor WHEN 0 THEN 0 ELSE 1 END - FROM - sys.indexes - WHERE - object_id = @objectid AND index_id = @indexid; - - IF ((@density BETWEEN 75.0 AND 85.0) AND @fillfactorset = 1) OR (@fragmentation < 30.0) - SET @command = N'ALTER INDEX ' + @indexname + N' ON ' + @schemaname + N'.' + @objectname + N' REORGANIZE'; - ELSE IF @numrows >= 5000 AND @fillfactorset = 0 - SET @command = N'ALTER INDEX ' + @indexname + N' ON ' + @schemaname + N'.' + @objectname + N' REBUILD WITH (FILLFACTOR = 90)'; - ELSE - SET @command = N'ALTER INDEX ' + @indexname + N' ON ' + @schemaname + N'.' + @objectname + N' REBUILD'; - PRINT convert(nvarchar, getdate(), 121) + N' Executing: ' + @command; - EXEC (@command); - PRINT convert(nvarchar, getdate(), 121) + N' Done.'; -END - --- Close and deallocate the cursor. -CLOSE curIndexes; -DEALLOCATE curIndexes; - - -IF EXISTS (SELECT * FROM @work_to_do) -BEGIN - PRINT 'Estimated number of pages in fragmented indexes: ' + cast(@numpages as nvarchar(20)) - SELECT @numpages = @numpages - sum(ps.used_page_count) - FROM - @work_to_do AS fi - INNER JOIN sys.indexes AS i ON fi.objectid = i.object_id and fi.indexid = i.index_id - INNER JOIN sys.dm_db_partition_stats AS ps on i.object_id = ps.object_id and i.index_id = ps.index_id - - PRINT 'Estimated number of pages freed: ' + cast(@numpages as nvarchar(20)) -END -GO - - ---Update all statistics -PRINT 'Updating all statistics.' + convert(nvarchar, getdate(), 121) -EXEC sp_updatestats -PRINT 'Done updating statistics.' + convert(nvarchar, getdate(), 121) -GO \ No newline at end of file diff --git a/dump/SCCM-WID-to-SQL.txt b/dump/SCCM-WID-to-SQL.txt deleted file mode 100644 index 34df026..0000000 --- a/dump/SCCM-WID-to-SQL.txt +++ /dev/null @@ -1,24 +0,0 @@ -Total Updates in WID: 7280 - - -1. Stop-Service WsusService (Validate in Services) -2. Stop Website: WSUS Administration -3. Stop WsusPool -4. Open WID in SSMS(open as Administrator) - Connect to WID Instance: \\.\pipe\MICROSOFT\tsql\query\ -5. Detach 'SUSDB' - Choose 'Drop Connections' -6. Copy (SUSDB.mdf & SUSDB_log.ldf ) from the following location to a location in SQL Server (E:\): - - C:\Windows\WID\Data -*********************************************************************** -** Done by SQL Team - CAB ** -7. From SQL Server - Attach SUSDB.mdf -*********************************************************************** - -*********************************************************************** -8. Run the ReIndex Script on SUSDB on SQL Server - https://gallery.technet.microsoft.com/scriptcenter/6f8cde49-5c52-4abd-9820-f1d270ddea61 -9. Goto IIS: Start WsusPool / 'WSUS Administration' Website0 -10. Start-Service WsusService -11. Remove-WindowsFeature -name UpdateServices-WidDB -12. Add-WindowsFeature -name UpdateServices-DB -13. Run WsusUtil.exe to point to SQL database: CD "C:\Program Files\Update Services\Tools" -14. .\WsusUtil.exe postinstall SQL_INSTANCE_NAME="PSQL027.ccx.carecentrix.com" CONTENT_DIR="E:\WSUS" diff --git a/dump/Server-Last-Patched.ps1 b/dump/Server-Last-Patched.ps1 deleted file mode 100644 index 734577f..0000000 --- a/dump/Server-Last-Patched.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Final_Last_Patched_Report = @() -$Date_Today = Get-Date -UFormat %m-%d-%Y - -$Collection_Name = "9PM - Production Patching" -$Collection_Servers = Import-Csv "$Location\Files\$Collection_Name.csv" - -$Collection_Servers.Name | % { - #Write-Host "Checking: $_" -ForeGround Green - $HF = Get-HotFix -ComputerName $_ | sort installedon -Descending | Select -First 1 - - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_ - $Obj | Add-Member -MemberType NoteProperty -Name InstalledOn -Value $HF.InstalledOn - $Obj | Add-Member -MemberType NoteProperty -Name LastHF -Value $HF.HotFixID - $Obj | Add-Member -MemberType NoteProperty -Name InstalledBy -Value $HF.InstalledBy - $Obj | Add-Member -MemberType NoteProperty -Name Description -Value $HF.Description - $Obj - $Final_Last_Patched_Report += $Obj -}#end% - - $Final_Last_Patched_Report #| Export-Csv H:\Scripts\Patching\Server-Last-Patched\Server-Last-Patched-$Date_Today.csv -NoTypeInformation - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dump/Software-Inventory.ps1 b/dump/Software-Inventory.ps1 deleted file mode 100644 index e5b9229..0000000 --- a/dump/Software-Inventory.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -# $My_List = Import-Csv "\\ccx\shares\Users\Serverless\NNAZMAT\temp\Legacy-Servers.csv" -$Report = @() -$T = @() -$Failed_Connection = @() -$Failed_Invoke = @() -$My_List | % { $Temp = $_ - - If(Test-Connection $Temp.Machine -Count 1 -ErrorAction SilentlyContinue) { - - If(Invoke-Command $Temp.Machine -ErrorAction SilentlyContinue { $env:COMPUTERNAME }) { - - $T2 = Invoke-Command $Temp.Machine { Get-ItemProperty "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" | - ? { $_.DisplayName -notlike "Security*" -and $_.DisplayName -notlike "Update*" -and $_.DisplayName -notlike "Hotfix*" -and $_.DisplayName -notlike "Microsoft Visual C++*" -and $_.DisplayName -notlike ""} | - Select-Object displayname, displayversion, publisher, installdate } - - $T2 | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Machine -Value $Temp.Machine - $Obj | Add-Member -MemberType NoteProperty -Name OS -Value $Temp.OS - $Obj | Add-Member -MemberType NoteProperty -Name DisplayName -Value $_.DisplayName - $Obj | Add-Member -MemberType NoteProperty -Name DisplayVersion -Value $_.DisplayVersion - $Obj | Add-Member -MemberType NoteProperty -Name Publisher -Value $_.Publisher - $Obj | Add-Member -MemberType NoteProperty -Name InstallDate -Value $_.InstallDate - $Obj - $Report += $Obj - - - - }#$end% - }#endIfinvoke - Else { $Failed_Invoke += $Temp.Machine } - }#endIf - - Else { $Failed_Connection += $Temp.Machine } - - }#end% - - - diff --git a/dump/Software-Update-Group-Patches.ps1 b/dump/Software-Update-Group-Patches.ps1 deleted file mode 100644 index f9d495f..0000000 --- a/dump/Software-Update-Group-Patches.ps1 +++ /dev/null @@ -1,45 +0,0 @@ - <# - $SUG = "Server 2008 Required Updates", - "Server 2008 R2 Requred Patches", - "Server 2016 Required Patches", - "Server 2019 Required Patches", - "Server 2012 R2 Required Patches" - -#$P | select LocalizedDisplayName,Updates - -#$P = Get-CMSoftwareUpdateGroup | ? { $_.LocalizedDisplayName -eq "Server 2008 R2 Requred Patches" } -$P | select LocalizedDisplayName, @{n="Updates";e={$_.Updates | Out-String}} | ft -Wrap - -#> - - - - - -$info = @() - -ForEach ($item in $SUG) -{ - # Write-host "Processing Software Update Group" $item - - forEach ($item1 in (Get-CMSoftwareUpdate -Fast -UpdateGroupName $item)) - { - $object = New-Object -TypeName PSObject - $object | Add-Member -MemberType NoteProperty -Name UpdateGroup -Value $item - $object | Add-Member -MemberType NoteProperty -Name ArticleID -Value $item1.ArticleID - $object | Add-Member -MemberType NoteProperty -Name BulletinID -Value $item1.BulletinID - $object | Add-Member -MemberType NoteProperty -Name Title -Value $item1.LocalizedDisplayName - $info += $object - $object - } -} - - -#$Title = "Total assigned software updates in " + $item.LocalizedDisplayName + " = " + $info.count -#$info | Out-GridView -Title "$Title" - - - - -#Get-CMSoftwareUpdate -Fast -UpdateGroupName "Server 2008 Required Updates" - diff --git a/dump/Software-Update-Group-PatchesX.ps1 b/dump/Software-Update-Group-PatchesX.ps1 deleted file mode 100644 index 6fc54ea..0000000 --- a/dump/Software-Update-Group-PatchesX.ps1 +++ /dev/null @@ -1,86 +0,0 @@ -# https://www.verboon.info/2013/09/list-configmgr-software-update-group-members-with-powershell/ - - -<# -.Synopsis - Lists assigned software updates in a configuration manager 2012 software update group -.DESCRIPTION - Lists all assigned software updates in a configuration manager 2012 software update group that is selected - from the list of available update groups or provided as a command line option -.EXAMPLE - Get-UpdateGroupcontent.ps1 -.EXAMPLE - Get-UpdateGroupcontent.ps1 -UpdateGroup "Win7x64_12_11_15" - - -#> - -[CmdletBinding()] - - -param( - - - # Software Update Group - [Parameter(Mandatory = $false, ValueFromPipeline=$true)] - [String] $UpdateGroup - ) - - -$SiteCode = "POC" - -Function Get-UpdateGroupcontent -{ - - -# Check that youre not running X64 -if ([Environment]::Is64BitProcess -eq $True) - { Throw "Need to run at a X86 PowershellPrompt" - } - -# Load ConfigMgr module if it isn't loaded already -if (-not(Get-Module -name ConfigurationManager)) { - Import-Module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1') - } - -# Change to site - Push-Location - Set-Location ${SiteCode}: - - -#Set-CMQueryResultMaximum -Maximum 5000 - - -if ($UpdateGroup.Length -eq 0) { - $UpdateGroup = Get-CMSoftwareUpdateGroup | Select-Object LocalizedDisplayName | Out-GridView -Title "Select the Software Update Group " -PassThru - } -Else - { - $UpdateGroup = Get-CMSoftwareUpdateGroup | Where-Object {$_.LocalizedDisplayName -like "$($UpdateGroup)"} | Select-Object LocalizedDisplayName -} - -$info = @() - -ForEach ($item in $UpdateGroup) -{ - Write-host "Processing Software Update Group" $($item.LocalizedDisplayName) - forEach ($item1 in (Get-CMSoftwareUpdate -UpdateGroupName $($item.LocalizedDisplayName))) - { - $object = New-Object -TypeName PSObject - #$object | Add-Member -MemberType NoteProperty -Name UpdateGroup -Value $item.LocalizedDisplayName - $object | Add-Member -MemberType NoteProperty -Name ArticleID -Value $item1.ArticleID - $object | Add-Member -MemberType NoteProperty -Name BulletinID -Value $item1.BulletinID - $object | Add-Member -MemberType NoteProperty -Name Title -Value $item1.LocalizedDisplayName - $info += $object - } -} - - -$Title = "Total assigned software updates in " + $item.LocalizedDisplayName + " = " + $info.count -$info | Out-GridView -Title "$Title" -} - - -# -----------------------------------------------------------------------------------------------------* -# Get the list of software updates in the selected update group -Get-UpdateGroupcontent \ No newline at end of file diff --git a/dump/SupersededUpdates.csv b/dump/SupersededUpdates.csv deleted file mode 100644 index 46a1294..0000000 Binary files a/dump/SupersededUpdates.csv and /dev/null differ diff --git a/dump/SupersededUpdatesBackup.csv b/dump/SupersededUpdatesBackup.csv deleted file mode 100644 index 5811d59..0000000 Binary files a/dump/SupersededUpdatesBackup.csv and /dev/null differ diff --git a/dump/TechNet LogLauncher.website b/dump/TechNet LogLauncher.website deleted file mode 100644 index bf13242..0000000 --- a/dump/TechNet LogLauncher.website +++ /dev/null @@ -1,13 +0,0 @@ -[{000214A0-0000-0000-C000-000000000046}] -Prop3=19,11 -Prop4=31,TechNet LogLauncher -[InternetShortcut] -IDList= -URL=https://gallery.technet.microsoft.com/LogLauncher-61ba5c99 -IconFile=https://i1.gallery.technet.s-msft.com/GlobalResources/images/Technet/favicon.ico -IconIndex=1 -[{A7AF692E-098D-4C08-A225-D433CA835ED0}] -Prop5=3,0 -Prop9=19,0 -[{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}] -Prop5=8,Microsoft.Website.B4BD2547.99B248A2 diff --git a/dump/Testing RPC Connectivity.URL b/dump/Testing RPC Connectivity.URL deleted file mode 100644 index 3008305..0000000 --- a/dump/Testing RPC Connectivity.URL +++ /dev/null @@ -1,6 +0,0 @@ -[InternetShortcut] -URL=https://gallery.technet.microsoft.com/systemcenter/Testing-RPC-Connectivity-e0ab4901 -IDList= -HotKey=0 -IconFile=C:\Users\nnazmat\AppData\Local\Mozilla\Firefox\Profiles\20v5hisb.default-release\shortcutCache\THlrAH+ISyziQ0QQaPftXQ==.ico -IconIndex=0 diff --git a/dump/WSUS_Scripts/0-new-WSUS-PendingReboot.ps1 b/dump/WSUS_Scripts/0-new-WSUS-PendingReboot.ps1 deleted file mode 100644 index 72ff8eb..0000000 --- a/dump/WSUS_Scripts/0-new-WSUS-PendingReboot.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -#import correct file -#Uncomment Restart-Computer -$Dte = Get-Date -UFormat %m-%d-%Y -######################################################################################### -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -$WSUSGroup = "Tier0" - -$Current_Month = (Get-Date -UFormat %B) -$Current_Year = (Get-Date -UFormat %Y) - #$WSUSGroup = Read-Host "Enter Target Group Name" -$Folder = "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year" -$Group_Folder = "$Folder\$WSUSGroup-$Current_Month-PENDING-Reboot" -$Pending_Reboot_File_Name = "$Group_Folder\$WSUSGroup-PENDING-Reboots-$Current_Month" - - - -#If(!(Test-Path E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching)) { New-Item -Path "E:\WSUS_Scripts\Patching-Day" -ItemType Directory -Name $WSUSGroup-$Current_Month-Patching } - -######################################################################################### -#$Server_Reboot_Before_Patching = Import-Csv "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$Group_Folder\$Pending_Reboot_File_Name.csv" | ? { $_.RebootPending -eq "True" } | select computer -#$Server_Reboot_Before_Patching | Export-Csv "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$Group_Folder\$WSUSGroup-Servers-Rebooting-Before-Patching-$Dte.csv" -NoTypeInformation - -$Server_Reboot_Before_Patching = Import-Csv "$Pending_Reboot_File_Name.csv" | ? { $_.RebootPending -eq "True" } | select computer -Write-Host "$WSUSGroup - Server Count: $($Server_Reboot_Before_Patching.count)" -ForegroundColor Yellow - -$Server_Reboot_Before_Patching.Computer | % { - #Write-EventLog -LogName System -Source "Powershell-WSUS-Reboot-Before-Patching" -EntryType Information -EventId 7893 -Message "Reboot-Before-Patching-Remote" -ErrorAction SilentlyContinue - #Invoke-Command $_ -ErrorAction SilentlyContinue { - # New-EventLog -LogName System -Source "Reboot-Before-Patching" -ErrorAction SilentlyContinue - # Write-EventLog -LogName System -Source "Reboot-Before-Patching" -EntryType Information -EventId 7893 -Message "Reboot-Before-Patching-Invoke" -ErrorAction SilentlyContinue - #}#endInvoke - Write-Host "Rebooting --- $_" - xRestart-Computer $_ -Force -Verbose -}#end% - -############################################################################################################################## -<# - -$Server_Reboot_Before_Patching.computer | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } -} - - - $Server_Reboot_Before_Patching.computer | % { gwmi win32_operatingsystem -ComputerName $_ | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} - -#> - diff --git a/dump/WSUS_Scripts/1-new-January-Patch-WSUSGroup-4.ps1 b/dump/WSUS_Scripts/1-new-January-Patch-WSUSGroup-4.ps1 deleted file mode 100644 index d4ac48d..0000000 --- a/dump/WSUS_Scripts/1-new-January-Patch-WSUSGroup-4.ps1 +++ /dev/null @@ -1,102 +0,0 @@ -################################################################################################################################# -If(Test-Path E:\WSUS_Scripts\Lock_Script.txt) { - Write-Host "The Script is locked for protection. If you are not running it by mistake - Delete the file (E:\WSUS_Scripts\Lock_Script.txt) and run the Script again" -ForegroundColor Yellow - Break -} -Else { New-Item -Path E:\WSUS_Scripts -Name Lock_Script.txt -ItemType File } -################################################################################################################################# - -Get-Job | Remove-Job - -#$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -############################################################ -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -$Current_Month = (Get-Date -UFormat %B) -$Current_Year = (Get-Date -UFormat %Y) -############################################################ -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() -$Failed_Jobs = @() -$Receive_Jobs = @() - -$servers = "" -$WSUSGroup = "xxx" #Read-Host "Enter Target Group Name" - -If(!(Test-Path E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching)) { New-Item -Path "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year" -ItemType Directory -Name $WSUSGroup-$Current_Month-Patching } - -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select -ExpandProperty Fulldomainname -$Group_Folder = "$WSUSGroup-$Current_Month-Patching" -$Group_Folder_Location = "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$Group_Folder" - -#$Servers_Reboot_Only = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\CCXQ1-November-Prep-Files\Manual-$WSUSGroup-OperatingSystems-$Current_Month.csv -#$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup.csv | select -ExpandProperty "Server Name" -$servers = Import-Csv $Group_Folder_Location\$WSUSGroup.csv | select -ExpandProperty "Computer" - -####$servers = $servers | ? { $_ -notin $Servers_Reboot_Only.FullDomainName } - -#$servers | Out-File $Location\Patching-Day\$Current_Month-2019\$Group_Folder\$WSUSGroup-Patching-Today-$Dte.txt -$servers | Out-File $Group_Folder_Location\$WSUSGroup-Patching-Today-Backup-$Dte.txt - -xxxForeach ($server in $servers) { - - #New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -ComputerName $server -verbose - #New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -ComputerName $server -verbose - #New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -ComputerName $server -verbose - #Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Remote" -ComputerName $server -ErrorAction SilentlyContinue -verbose - - $Patch_Job += xxxStart-Job -ScriptBlock { Param($server) WindowsUpdate\Install-WindowsUpdate -ComputerName $server } -Name "$WSUSGroup-#$server#-Patching" -ArgumentList $server - - #Invoke-Command $server -ErrorAction SilentlyContinue { - # New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -verbose - # New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -verbose - # New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -verbose - # Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Invoke" -verbose - # }#endInvoke - -}#endForeach - - - -#$Patch_Job | Export-Csv $Location\Patching-Day\$Current_Month-2019\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv $Group_Folder_Location\$WSUSGroup-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -#$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\$Current_Month-2019\$Group_Folder\$WSUSGroup-Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv $Group_Folder_Location\$WSUSGroup-Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -#$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\$Group_Folder\$Current_Month-2019\$WSUSGroup-Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Group_Folder_Location\$WSUSGroup-Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - -Get-Job -<# - -$Failed_Jobs += $Patch_Job | ? { $_.State -eq "Failed" } - -$Failed_Jobs | ft -autosize - -$Failed_Jobs | Export-Csv "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching\failed-jobs.csv" -NoTypeInformation - -#> - - -### Running Count - -# $Patch_Job - -<# - - $Patch_Job | ft -AutoSize - - ( $Patch_Job | ? { $_.State -eq "Running" } ).count - - ( $Patch_Job | ? { $_.State -eq "Completed" } ).count - - ( $Patch_Job | ? { $_.State -eq "Failed" } ).count - - - - $Patch_Job | ? { $_.State -eq "Running" } | export-csv $Group_Folder_Location\jobs-running.csv - - $T = import-csv $Group_Folder_Location\jobs-running.csv - $T = $T | % {$_.Name.Split('#')[1] } -#> diff --git a/dump/WSUS_Scripts/2-new-WSUS-Patch-Job-Status.ps1 b/dump/WSUS_Scripts/2-new-WSUS-Patch-Job-Status.ps1 deleted file mode 100644 index 5097478..0000000 --- a/dump/WSUS_Scripts/2-new-WSUS-Patch-Job-Status.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -###### This Script must be run after the patching is in progress #################### -$File_Date = Get-Date -UFormat %H-%M-%p -$Current_Month = (Get-Date -UFormat %B) -$Current_Year = (Get-Date -UFormat %Y) - -If(!(Test-Path "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching\ReRun")) { New-Item -Path "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching\ReRun" -ItemType Directory } - -$Collect_Completed_Servers = @() -$Collect_Completed_Jobs = "" - -$WSUSGroup = "" -$WSUSGroup = Read-Host "Enter Target Group Name" - -$Collect_Completed_Jobs = $Patch_Job -$Patch_Job = $Patch_Job | ? { $_.State -ne "Completed" } -$Failed_Jobs = $Patch_Job | ? { $_.State -eq "Failed" } - -$Collect_Completed_Jobs | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value ($_.Name.Split('#')[1]) - $Obj | Add-Member -MemberType NoteProperty -Name State -Value $_.State - $Obj -} - -$TPJ = $Obj - -#If(!(Test-Path "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching\ReRun")) { New-Item -Path "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching\ReRun" -ItemType Directory } - -$Patch_Job | Export-Csv "$ReRun_File_Location\$WSUSGroup-Completed-Jobs-$File_Date.csv" -NoTypeInformation - -$ReRun_File_Location = "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching\ReRun" - -#$TPJ | Export-Csv "$ReRun_File_Location\$WSUSGroup-Completed-Jobs-$File_Date.csv" -NoTypeInformation -$Failed_Jobs | Export-Csv "$ReRun_File_Location\$WSUSGroup-FAILED-Jobs-$File_Date.csv" -NoTypeInformation - -#$Unique_Servers = $Collect_Completed_Servers | select Name -Unique -#$temp = Import-Csv "E:\WSUS_Scripts\Patching-Day\November-2019\NCRA - Development Servers-November-Patching\test--NCRA - Development Servers-Patching-Jobs-11-01-2019 - Copy.csv" -#$Collect_Completed_Servers = $Collect_Completed_Jobs.Name | % {$_.Split('#')[1] } - -###################################### Reboot Servers ########################## - -Restart-Computer -ComputerName $TPJ.Server -Force -Verbose -################################################################################ -<# - -$servers | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } - } - - -#> - - - -# $Servers | % { gwmi win32_operatingsystem -ComputerName $_ | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} - - - - - - diff --git a/dump/WSUS_Scripts/3-new-ReRun-Patch-WSUSGroup-1.ps1 b/dump/WSUS_Scripts/3-new-ReRun-Patch-WSUSGroup-1.ps1 deleted file mode 100644 index 48240dc..0000000 --- a/dump/WSUS_Scripts/3-new-ReRun-Patch-WSUSGroup-1.ps1 +++ /dev/null @@ -1,96 +0,0 @@ -################################################################################################################################# -#$ErrorActionPreference = "Ignore" - -#$servers = "W2012A","W2012B","slfkjsdl" -#$WSUSGroup = "Test GGroupppppp" - -#$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -################################################################################################################################# -If(Test-Path E:\WSUS_Scripts\Patching-Day\December-2019\Lock_Script.txt) { - Write-Host "The Script is locked for protection. If you are not running it by mistake - Delete the file (E:\WSUS_Scripts\Patching-Day\December-2019\Lock_Script.txt) and run the Script again" -ForegroundColor Yellow - Break -} -Else { New-Item -Path E:\WSUS_Scripts\Patching-Day\December-2019 -Name Lock_Script.txt -ItemType File } -################################################################################################################################# - -############################################################ -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -$Current_Month = (Get-Date -UFormat %B) -$Current_Year = (Get-Date -UFormat %Y) -############################################################ -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() -$Failed_Jobs = @() -$Receive_Jobs = @() - -#If(!(Test-Path E:\WSUS_Scripts\Patching-Day\$WSUSGroup-$Current_Month-Patching)) { New-Item -Path "E:\WSUS_Scripts\Patching-Day" -ItemType Directory -Name $WSUSGroup-$Current_Month-Patching } - -$servers = "" -$WSUSGroup = Read-Host "Enter Target Group Name" - -$ReRun_File_Location = "E:\WSUS_Scripts\Patching-Day\$Current_Month-$Current_Year\$WSUSGroup-$Current_Month-Patching\ReRun" - -#$Group_Folder = "$WSUSGroup-$Current_Month-Patching" -$Recent_File = gci $ReRun_File_Location | sort LastWriteTime -Descending | select -First 1 | Select FullName - -$servers = Import-Csv $Recent_File.FullName | select -ExpandProperty Server - -#$servers | Out-File $Location\Patching-Day\$Current_Month-$Current_Year\$Group_Folder\$WSUSGroup-Patching-Today-$Dte.txt -#$servers | Out-File $ReRun_File_Location\$WSUSGroup-Patching-Today-Backup-$Dte.txt - -Foreach ($server in $servers) { - - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -ComputerName $server -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Remote" -ComputerName $server -ErrorAction SilentlyContinue -verbose - - $Patch_Job_ReRun += Start-Job -ScriptBlock { Param($server) WindowsUpdate\Install-WindowsUpdate -ComputerName $server } -Name "ReRun-$WSUSGroup-#$server#-Patching" -ArgumentList $server - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Invoke" -verbose - }#endInvoke - -}#endForeach - - -#Get-Job - -#$Patch_Job_ReRun | Export-Csv $Location\Patching-Day\$Current_Month-$Current_Year\$Group_Folder\ReRun-$WSUSGroup-Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job_ReRun | Export-Csv $ReRun_File_Location\ReRun-$WSUSGroup-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -#$Collect_Jobs_ReRun = Get-Job | Export-Csv $Location\Patching-Day\$Current_Month-$Current_Year\$Group_Folder\ReRun-$WSUSGroup-Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs_ReRun = Get-Job | Export-Csv $ReRun_File_Location\ReRun-$WSUSGroup-Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -#$Patch_Job_ReRun | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\$Current_Month-$Current_Year\$Group_Folder\ReRun-$WSUSGroup-Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job_ReRun | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $ReRun_File_Location\ReRun-$WSUSGroup-Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - - -#################### Reboot Servers ######################## -# Restart-Computer -ComputerName $servers -Verbose -############################################################ - -<# - -$Failed_Jobs += $Patch_Job | ? { $_.State -eq "Failed" } - -$Failed_Jobs | ft -autosize - -$Failed_Jobs | Export-Csv "E:\WSUS_Scripts\Patching-Day\NCRA - Quality Assurance Servers-November-Patching\failed-jobs.csv" -NoTypeInformation - -#> - - -### Running Count -## ( $Patch_Job | ? { $_.State -eq "Running" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Completed" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Failed" } ).count - -#> - \ No newline at end of file diff --git a/dump/WSUS_Scripts/4--new-Reboot-WSUSGroup-4.ps1 b/dump/WSUS_Scripts/4--new-Reboot-WSUSGroup-4.ps1 deleted file mode 100644 index 563e647..0000000 --- a/dump/WSUS_Scripts/4--new-Reboot-WSUSGroup-4.ps1 +++ /dev/null @@ -1,67 +0,0 @@ - -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -################################################################################################################################# -$Dte = Get-Date -UFormat %m-%d-%Y -$Current_Month = (Get-Date -UFormat %B) -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -#$Group_Folder = "$WSUSGroup-$Current_Month-Patching" -#$Group = "NCRA - Development Servers" -################################################################################################################################# -$servers = "" -$WSUSGroup = Read-Host "Enter Target Group Name" -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -$Group_Folder = "$WSUSGroup-$Current_Month-Patching" - -#$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\December-2019\$Group_Folder\CCXQ1-November-Prep-Files\$WSUSGroup-Target-Group-Computers-$Current_Month.csv | select -ExpandProperty FullDomainName -$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\December-2019\$WSUSGroup.csv | select -ExpandProperty "Server Name" - - -#$servers | Out-File $Location\Patching-Day\$Group_Folder\$WSUSGroup-Servers-Rebooting-$Dte.txt -ErrorAction SilentlyContinue -$servers | Out-File E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Servers-Rebooting-Backup-$Dte.txt -ErrorAction SilentlyContinue - -#$servers = $servers | ? { $_ -ne "qadf001.ccx.carecentrix.com"} - -#$Patch_Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Get-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Get-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -#$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Collect-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Collect-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation - -Foreach ($server in $servers) { - - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Remote" -ComputerName $server -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Remote" -ComputerName $server -ErrorAction SilentlyContinue - - Invoke-Command $server -ErrorAction SilentlyContinue { - #New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Finished" -ErrorAction SilentlyContinue - #New-EventLog -LogName System -Source "Powershell-Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Invoke" -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Invoke" -ErrorAction SilentlyContinue - }#endInvoke - Restart-Computer -ComputerName $server -Force -Verbose - -}#endForeach - - - -<# - -$servers | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } - } - - -#> - -# $Servers | % { Get-EventLog -LogName System -ComputerName $_.computer | ? { $_.EventID -eq '7893' } } - - -# $Servers | % { gwmi win32_operatingsystem -ComputerName $_ | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} - - - - - diff --git a/dump/WSUS_Scripts/Backups/new-Patch-WSUSGroup.ps1 b/dump/WSUS_Scripts/Backups/new-Patch-WSUSGroup.ps1 deleted file mode 100644 index 0f8d339..0000000 --- a/dump/WSUS_Scripts/Backups/new-Patch-WSUSGroup.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -<# - -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" -#> - -################################################################################################################################# -#$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" - -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -#$servers = "W2012A","W2012B","slfkjsdl" -#$WSUSGroup = "Test GGroupppppp" - -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() - -$servers | Out-File $Location\Patching-Day\"$WSUSGroup"-Server-Patching-Today-$Dte.txt -$servers | Out-File E:\WSUS_Scripts\Patching-Day\"$WSUSGroup"-Server-Patching-Today-Backup-$Dte.txt - -Foreach ($server in $servers) { - - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -ComputerName $server - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -ComputerName $server - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -ComputerName $server - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Remote" -ComputerName $server -ErrorAction SilentlyContinue - - $Patch_Job += Start-Job -ScriptBlock { Param($server) Install-WindowsUpdate -ComputerName $server } -Name "$server-Patching" -ArgumentList $server - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Invoke" - }#endInvoke - - Install-WindowsUpdate -ComputerName $server -AsJob - -}#endForeach - -Get-Job - -$Patch_Job | Export-Csv $Location\Patching-Day\Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv E:\WSUS_Scripts\Patching-Day\Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - - - - - - - - - \ No newline at end of file diff --git a/dump/WSUS_Scripts/Backups/new-Reboot-WSUSGroup-backup1.ps1 b/dump/WSUS_Scripts/Backups/new-Reboot-WSUSGroup-backup1.ps1 deleted file mode 100644 index 7eda7f6..0000000 --- a/dump/WSUS_Scripts/Backups/new-Reboot-WSUSGroup-backup1.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Dte = Get-Date -UFormat %m-%d-%Y - -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -$servers | Out-File $Location\Patching-Day\"$WSUSGroup"-Servers-Rebooting-$Dte.txt -ErrorAction SilentlyContinue -$servers | Out-File E:\WSUS_Scripts\Patching-Day\"$WSUSGroup"-Servers-Rebooting-Backup-$Dte.txt -ErrorAction SilentlyContinue - -$Patch_Job | Export-Csv $Location\Patching-Day\Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -Get-Job | Export-Csv $Location\Patching-Day\Patching-Get-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Get-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\Patching-Collect-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Collect-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation - -Foreach ($server in $servers) { - - Invoke-Command $server -ErrorAction SilentlyContinue { - #New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Finished" -ErrorAction SilentlyContinue - #New-EventLog -LogName System -Source "Powershell-Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished" - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching" - }#endInvoke - Restart-Computer -ComputerName $server -Force -Verbose - -}#endForeach \ No newline at end of file diff --git a/dump/WSUS_Scripts/Backups/new-Reboot-WSUSGroup.ps1 b/dump/WSUS_Scripts/Backups/new-Reboot-WSUSGroup.ps1 deleted file mode 100644 index 3efdd2f..0000000 --- a/dump/WSUS_Scripts/Backups/new-Reboot-WSUSGroup.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Dte = Get-Date -UFormat %m-%d-%Y - -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -$servers | Out-File $Location\Patching-Day\"$WSUSGroup"-Servers-Rebooting-$Dte.txt -ErrorAction SilentlyContinue -$servers | Out-File E:\WSUS_Scripts\Patching-Day\"$WSUSGroup"-Servers-Rebooting-Backup-$Dte.txt -ErrorAction SilentlyContinue - -$Patch_Job | Export-Csv $Location\Patching-Day\Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -Get-Job | Export-Csv $Location\Patching-Day\Patching-Get-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Get-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\Patching-Collect-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Collect-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation - -Foreach ($server in $servers) { - - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Remote" -ComputerName $server -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Remote" -ComputerName $server -ErrorAction SilentlyContinue - - Invoke-Command $server -ErrorAction SilentlyContinue { - #New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Finished" -ErrorAction SilentlyContinue - #New-EventLog -LogName System -Source "Powershell-Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Invoke" -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Invoke" -ErrorAction SilentlyContinue - }#endInvoke - Restart-Computer -ComputerName $server -Force -Verbose - -}#endForeach \ No newline at end of file diff --git a/dump/WSUS_Scripts/Backups/new-WSUS-PendingReboot.ps1 b/dump/WSUS_Scripts/Backups/new-WSUS-PendingReboot.ps1 deleted file mode 100644 index 45dbb37..0000000 --- a/dump/WSUS_Scripts/Backups/new-WSUS-PendingReboot.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -#import correct file -#Uncomment Restart-Computer - -$Server_Reboot_Before_Patching = Import-Csv E:\WSUS_Scripts\Files\PENDING-Reboots-10-08-2019.csv | ? { $_.RebootPending -eq "True" } | select computer - -$Server_Reboot_Before_Patching.Computer | % { - Write-EventLog -LogName System -Source "Powershell-WSUS-Reboot-Before-Patching" -EntryType Information -EventId 7893 -Message "Reboot-Before-Patching-Remote" -ErrorAction SilentlyContinue - Invoke-Command $_ -ErrorAction SilentlyContinue { - New-EventLog -LogName System -Source "Reboot-Before-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-Before-Patching" -EntryType Information -EventId 7893 -Message "Reboot-Before-Patching-Invoke" -ErrorAction SilentlyContinue - }#endInvoke - Restart-Computer $_ -Force -Verbose -}#end% - - \ No newline at end of file diff --git a/dump/WSUS_Scripts/Check-Hotfix-2.ps1 b/dump/WSUS_Scripts/Check-Hotfix-2.ps1 deleted file mode 100644 index 26c9be6..0000000 --- a/dump/WSUS_Scripts/Check-Hotfix-2.ps1 +++ /dev/null @@ -1,4 +0,0 @@ - - -$ServerName | % { Get-HotFix -ComputerName $_ | sort installedon -Descending | select -First 1 } - diff --git a/dump/WSUS_Scripts/Check-Hotfix.ps1 b/dump/WSUS_Scripts/Check-Hotfix.ps1 deleted file mode 100644 index 7d3b8e4..0000000 --- a/dump/WSUS_Scripts/Check-Hotfix.ps1 +++ /dev/null @@ -1,8 +0,0 @@ - -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Target-Group-Computers-$Current_Month.csv | select -ExpandProperty FullDomainName -$servers | % { Get-HotFix -ComputerName $_ | ? { $_.InstalledOn} | sort installedon -Descending | select -First 1 } - - - - diff --git a/dump/WSUS_Scripts/Check-Jobs.ps1 b/dump/WSUS_Scripts/Check-Jobs.ps1 deleted file mode 100644 index 937bae7..0000000 --- a/dump/WSUS_Scripts/Check-Jobs.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -$Check_Jobs = Import-Csv "E:\WSUS_Scripts\Patching-Day\December-2019\Tier2B-December-Patching\ReRun\Tier2B-FAILED-Jobs-22-01-PM.csv" | select @{n="Server";e={$_.Name.split('#')[1]}},State,PSBeginTime - -##$Completed_Jobs = $Check_Jobs | ? { $_.State -eq "Completed" } -##$Failed_Jobs = $Check_Jobs | ? { $_.State -eq "Failed" } -#$P_Job_Servers = @() - -##### Reboot Completed Ones and Run patching again ##### -#Restart-Computer $Completed_Jobs.Server -Force -Verbose - - -Foreach ($S in $Completed_Jobs.Server) { - #$S = $T.name - #$P_Job_Servers += Start-Job -ScriptBlock { Param($S) WindowsUpdate\Install-WindowsUpdate -ComputerName $S } -Name "$WSUSGroup-#$S#-Patching" -ArgumentList $S - -}#endForeach - -<# - -$Tier2B_Servers."Server Name" | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } -} - -####################################################################################################### - -$Tier2B_Servers."Server Name" | % { gwmi win32_operatingsystem -ComputerName $_ | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | ft -autosize - - -#> - - - - diff --git a/dump/WSUS_Scripts/Files/NCRA - Development Servers-PENDING-Reboots-November.csv b/dump/WSUS_Scripts/Files/NCRA - Development Servers-PENDING-Reboots-November.csv deleted file mode 100644 index 38877a9..0000000 --- a/dump/WSUS_Scripts/Files/NCRA - Development Servers-PENDING-Reboots-November.csv +++ /dev/null @@ -1,60 +0,0 @@ -"Computer","CBServicing","WindowsUpdate","CCMClientSDK","PendComputerRename","PendFileRename","PendFileRenVal","RebootPending" -"DAPP006","True","True",,"False","True","System.String[]","True" -"DSQL001","False","False",,"False","False",,"False" -"DAPP012","True","True",,"False","True","System.String[]","True" -"DIIS004",,"False",,"False","True","System.String[]","True" -"DSQL002","False","False",,"False","False",,"False" -"DWHD001","False","False",,"False","False",,"False" -"DEDI001","False","False",,"False","False",,"False" -"DOWA001","False","False",,"False","True","System.String[]","True" -"DSWF001","False","False",,"False","False",,"False" -"DSAP001","False","False",,"False","True","System.String[]","True" -"DSQL009","False","False",,"False","True","System.String[]","True" -"DFNP009","True","True",,"False","False",,"True" -"DDOC001","True","True",,"False","False",,"True" -"DCPR001","False","False",,"False","False",,"False" -"DTABL001","False","False",,"False","True","System.String[]","True" -"DBTS001","False","False",,"False","False",,"False" -"DPGP001","False","False",,"False","False",,"False" -"DSSS001","False","False",,"False","True","System.String[]","True" -"DAPP001",,"False",,"False","True","System.String[]","True" -"DBIT901","True","True",,"False","True","System.String[]","True" -"DFNP002","True","True",,"False","False",,"True" -"DDWH001","False","False",,"False","False",,"False" -"DVRS001","True","True",,"False","False",,"True" -"DSHP001","False","False",,"False","False",,"False" -"DWHD003","False","False",,"False","True","System.String[]","True" -"DSRS001","False","False",,"False","True","System.String[]","True" -"DWTS001","False","False",,"False","False",,"False" -"DAPP003",,"False",,"False","True","System.String[]","True" -"DWAM002","True","True",,"False","True","System.String[]","True" -"DFNP001","True","True",,"False","True","System.String[]","True" -"DSIS001","False","False",,"False","False",,"False" -"DIIS003","False","False",,"False","True","System.String[]","True" -"DVB6001","True","True",,"False","True","System.String[]","True" -"DSQL006","False","False",,"False","False",,"False" -"DCTI001","True","True",,"False","True","System.String[]","True" -"DIIS002",,"False",,"False","True","System.String[]","True" -"DFNP020","True","True",,"False","True","System.String[]","True" -"DFNP014","True","True",,"False","False",,"True" -"DIAP001","True","True",,"False","True","System.String[]","True" -"DSQL027B","False","False",,"False","True","System.String[]","True" -"DSQL027A","False","False",,"False","True","System.String[]","True" -"DVVC004","True","True",,"False","True","System.String[]","True" -"DVCO001","True","True",,"False","True","System.String[]","True" -"DVVC003","True","True",,"False","True","System.String[]","True" -"DEDI113","False","False",,"False","True","System.String[]","True" -"DSQL000","False","False",,"False","True","System.String[]","True" -"DSQL028","False","False",,"False","True","System.String[]","True" -"DSIS003","False","False",,"False","False",,"False" -"DFAX011","False","False",,"False","True","System.String[]","True" -"DMQS001","False","False",,"False","True","System.String[]","True" -"DGAW001","False","False",,"False","True","System.String[]","True" -"DSQL004","False","False",,"False","True","System.String[]","True" -"DSQL029","False","False",,"False","True","System.String[]","True" -"DSQL030","False","False",,"False","True","System.String[]","True" -"DAPCAC001","False","False",,"False","True","System.String[]","True" -"DAPCAV001","False","False",,"False","True","System.String[]","True" -"DAPCAC002","False","False",,"False","False",,"False" -"DAPVRNS001","False","False",,"False","True","System.String[]","True" -"DAPSEP001","False","False",,"False","True","System.String[]","True" diff --git a/dump/WSUS_Scripts/Files/NCRA - Development Servers-Ping-Failed-November.txt b/dump/WSUS_Scripts/Files/NCRA - Development Servers-Ping-Failed-November.txt deleted file mode 100644 index 916ed88..0000000 Binary files a/dump/WSUS_Scripts/Files/NCRA - Development Servers-Ping-Failed-November.txt and /dev/null differ diff --git a/dump/WSUS_Scripts/Files/NCRA - Quality Assurance Servers-PENDING-Reboots-November.csv b/dump/WSUS_Scripts/Files/NCRA - Quality Assurance Servers-PENDING-Reboots-November.csv deleted file mode 100644 index 8eed953..0000000 --- a/dump/WSUS_Scripts/Files/NCRA - Quality Assurance Servers-PENDING-Reboots-November.csv +++ /dev/null @@ -1,91 +0,0 @@ -"Computer","CBServicing","WindowsUpdate","CCMClientSDK","PendComputerRename","PendFileRename","PendFileRenVal","RebootPending" -"Q1FNP003","False","False",,"False","False",,"False" -"Q1SQL022","False","False",,"False","True","System.String[]","True" -"Q1SQL024","False","False",,"False","True","System.String[]","True" -"Q2FNP003","False","False",,"False","False",,"False" -"Q2SQL022","False","False",,"False","True","System.String[]","True" -"Q3FNP003","False","False",,"False","False",,"False" -"Q3SQL022","False","False",,"False","True","System.String[]","True" -"Q4FNP003","False","False",,"False","False",,"False" -"Q4SQL022","False","False",,"False","True","System.String[]","True" -"Q4SQL022B","False","False",,"False","True","System.String[]","True" -"Q4SQL024","False","False",,"False","True","System.String[]","True" -"Q5FNP003","False","False",,"False","False",,"False" -"Q5SQL022","False","False",,"False","True","System.String[]","True" -"QADF001","False","False",,"False","True","System.String[]","True" -"QAPP011","False","False",,"False","True","System.String[]","True" -"QAPP021","False","False",,"False","True","System.String[]","True" -"QAPP031","False","False",,"False","True","System.String[]","True" -"QAPP041","False","False",,"False","True","System.String[]","True" -"QAPP051","False","False",,"False","True","System.String[]","True" -"QBIZ111","False","False",,"False","True","System.String[]","True" -"QBIZ112","False","False",,"False","True","System.String[]","True" -"QBIZ121","True","True",,"False","True","System.String[]","True" -"QBIZ122","False","False",,"False","True","System.String[]","True" -"QBIZ131","False","False",,"False","True","System.String[]","True" -"QBIZ132","False","False",,"False","True","System.String[]","True" -"QBIZ141","False","False",,"False","True","System.String[]","True" -"QBIZ142","False","False",,"False","True","System.String[]","True" -"QBIZ151","False","False",,"False","True","System.String[]","True" -"QBIZ152","False","False",,"False","True","System.String[]","True" -"QCMX001","False","False",,"False","True","System.String[]","True" -"QDRF001","False","False",,"False","True","System.String[]","True" -"QEDI111","False","False",,"False","True","System.String[]","True" -"QEDI112","False","False",,"False","True","System.String[]","True" -"QEDI113","False","False",,"False","True","System.String[]","True" -"QEDI151","False","False",,"False","True","System.String[]","True" -"QEDI152","False","False",,"False","True","System.String[]","True" -"QEDI153","False","False",,"False","True","System.String[]","True" -"QFNP001","False","False",,"False","True","System.String[]","True" -"QFNP003","False","False",,"False","True","System.String[]","True" -"QFNP007","False","False",,"False","True","System.String[]","True" -"QFNP008","False","False",,"False","False",,"False" -"QFNP009","False","False",,"False","False",,"False" -"QIIS005","False","False",,"False","True","System.String[]","True" -"QMFT001","False","False",,"False","True","System.String[]","True" -"QMHB001","False","False",,"False","True","System.String[]","True" -"QMHB002","False","False",,"False","True","System.String[]","True" -"QMHB003","False","False",,"False","True","System.String[]","True" -"QMHB004","False","False",,"False","True","System.String[]","True" -"QNCRASPAPP01","False","False",,"False","False",,"False" -"QNCRASPAPP02","False","False",,"False","False",,"False" -"QNCRASPDC01","False","False",,"False","False",,"False" -"QNCRASPDC02","False","False",,"False","False",,"False" -"QNCRASPOWA01","False","False",,"False","True","System.String[]","True" -"QNCRASPSEA01","False","False",,"False","False",,"False" -"QNCRASPSEA02","False","False",,"False","False",,"False" -"QNCRASPWFE01","False","False",,"False","False",,"False" -"QNCRASPWFE02","False","False",,"False","False",,"False" -"QQATEST01","False","False",,"False","True","System.String[]","True" -"QRDS001","False","False",,"False","True","System.String[]","True" -"QRDS002","False","False",,"False","True","System.String[]","True" -"QRSH001","False","False",,"False","True","System.String[]","True" -"QRSH002","False","False",,"False","True","System.String[]","True" -"QRSH021","False","False",,"False","True","System.String[]","True" -"QRSH022","False","False",,"False","True","System.String[]","True" -"QRSH023","False","False",,"False","True","System.String[]","True" -"QRSH031","False","False",,"False","True","System.String[]","True" -"QRSH041","False","False",,"False","False",,"False" -"QRSH051","False","False",,"False","True","System.String[]","True" -"QRSH101","False","False",,"False","True","System.String[]","True" -"QRSH111","False","False",,"False","True","System.String[]","True" -"QRSH112","False","False",,"False","False",,"False" -"QSCH011","False","False",,"False","False",,"False" -"QSCH012","False","False",,"False","False",,"False" -"QSCH013","False","False",,"False","False",,"False" -"QSCH014","False","False",,"False","False",,"False" -"QSIS001","False","False",,"False","False",,"False" -"QSIS002","False","False",,"False","False",,"False" -"QSIS003","False","False",,"False","True","System.String[]","True" -"QSQL006","False","False",,"False","True","System.String[]","True" -"QSQL028","False","False",,"False","True","System.String[]","True" -"QSQL029","False","False",,"False","True","System.String[]","True" -"QSQL030","False","False",,"False","True","System.String[]","True" -"QSRS001","False","False",,"False","False",,"False" -"QSRS004","False","False",,"False","True","System.String[]","True" -"QTABL001","False","False",,"False","True","System.String[]","True" -"QUTL012","False","False",,"False","False",,"False" -"QVST011","False","False",,"False","True","System.String[]","True" -"QVST012","False","False",,"False","True","System.String[]","True" -"QVST021","False","False",,"False","True","System.String[]","True" -"QVST022","False","False",,"False","True","System.String[]","True" diff --git a/dump/WSUS_Scripts/Files/PENDING-Reboots-10-08-2019.csv b/dump/WSUS_Scripts/Files/PENDING-Reboots-10-08-2019.csv deleted file mode 100644 index 91758af..0000000 --- a/dump/WSUS_Scripts/Files/PENDING-Reboots-10-08-2019.csv +++ /dev/null @@ -1,308 +0,0 @@ -"Computer","CBServicing","WindowsUpdate","CCMClientSDK","PendComputerRename","PendFileRename","PendFileRenVal","RebootPending" -"PMON003","False","False",,"False","False",,"False" -"PMHB002","False","False",,"False","True","System.String[]","True" -"PSKY001","False","False",,"False","True","System.String[]","True" -"NYMEPALT001","False","False",,"False","False",,"False" -"PLNC001","False","False",,"False","False",,"False" -"PFNP009","False","False",,"False","True","System.String[]","True" -"PFAX002",,"False",,"False","False",,"False" -"PVTS002",,"False",,"False","False",,"False" -"PFNP003","False","False",,"False","False",,"False" -"POCS002","False","False",,"False","False",,"False" -"PARM001","False","False",,"False","True","System.String[]","True" -"PSHP002","False","False",,"False","False",,"False" -"PSSS001","False","False",,"False","True","System.String[]","True" -"PAPC001","False","False",,"False","False",,"False" -"PFNP001","False","False",,"False","False",,"False" -"PFNP005","False","False",,"False","False",,"False" -"PSQL006","False","False",,"False","False",,"False" -"PSPT002","False","False",,"False","False",,"False" -"PVTS003",,"False",,"False","False",,"False" -"PSUF001","False","False",,"False","True","System.String[]","True" -"PFAX005",,"False",,"False","False",,"False" -"PTABL001","False","False",,"False","True","System.String[]","True" -"PIIS006",,"False",,"False","False",,"False" -"PWTS041","False","False",,"False","True","System.String[]","True" -"CTHAPALT001","False","False",,"False","True","System.String[]","True" -"PATV001","False","False",,"False","True","System.String[]","True" -"PSQL001","False","False",,"False","False",,"False" -"PWHD003","False","False",,"False","True","System.String[]","True" -"PMON008","False","False",,"False","False",,"False" -"PVSS011","False","False",,"False","True","System.String[]","True" -"PFNP007","False","False",,"False","False",,"False" -"PSQL014","False","False",,"False","False",,"False" -"PSEV011","False","False",,"False","False",,"False" -"PIIS001",,"False",,"False","False",,"False" -"PUTL005","False","False",,"False","True","System.String[]","True" -"PBIT901","False","False",,"False","True","System.String[]","True" -"PWTS040","False","False",,"False","True","System.String[]","True" -"PSRS001","False","False",,"False","False",,"False" -"PFAX003",,"False",,"False","False",,"False" -"PFAX007","False","False",,"False","True","System.String[]","True" -"PVRS001","False","False",,"False","False",,"False" -"PSEV016","False","False",,"False","False",,"False" -"PPKI004","False","False",,"False","False",,"False" -"PCVV001","False","False",,"False","False",,"False" -"PPCH001","False","False",,"False","False",,"False" -"PSQL007","False","False",,"False","False",,"False" -"PVEO002","False","False",,"False","True","System.String[]","True" -"PSEC002","False","False",,"False","True","System.String[]","True" -"PPGP001","False","False",,"False","False",,"False" -"PFNP011","False","False",,"False","True","System.String[]","True" -"PSEV012","False","False",,"False","True","System.String[]","True" -"PSEV014","False","False",,"False","True","System.String[]","True" -"PPDQ001","False","False",,"False","True","System.String[]","True" -"PVEO001","False","False",,"False","False",,"False" -"PSKY003","False","False",,"False","False",,"False" -"CTHAPALT002","False","False",,"False","False",,"False" -"PSQL008","False","False",,"False","True","System.String[]","True" -"PVTS006",,"False",,"False","False",,"False" -"PVTS004",,"False",,"False","False",,"False" -"PDFS001","False","False",,"False","False",,"False" -"PVVC013","False","False",,"False","False",,"False" -"PSHP001","False","False",,"False","False",,"False" -"PRAD002","False","False",,"False","True","System.String[]","True" -"PIIS002",,"False",,"False","False",,"False" -"CTSTPALT001","False","False",,"False","False",,"False" -"KSOVEPAPP010",,"False",,"False","False",,"False" -"PSQL016","False","False",,"False","True","System.String[]","True" -"PSIS002","False","False",,"False","True","System.String[]","True" -"PVVC015","False","False",,"False","False",,"False" -"PVVC011","False","False",,"False","False",,"False" -"PFNP010","False","False",,"False","True","System.String[]","True" -"PLNC002","False","False",,"False","False",,"False" -"AZPHPALT001","False","False",,"False","False",,"False" -"PCPR001","False","False",,"False","False",,"False" -"PSQL015","False","False",,"False","True","System.String[]","True" -"PDFS002","False","False",,"False","False",,"False" -"PBTS001","False","False",,"False","False",,"False" -"PBLD001","False","False",,"False","True","System.String[]","True" -"KSOPPALT001","False","False",,"False","False",,"False" -"PEZP001","False","False",,"False","True","System.String[]","True" -"PSUF002","False","False",,"False","False",,"False" -"PKEY001","False","False",,"False","True","System.String[]","True" -"PVTS005",,"False",,"False","False",,"False" -"PADF001","False","False",,"False","False",,"False" -"PALT001","False","False",,"False","False",,"False" -"PPCS001","False","False",,"False","False",,"False" -"PSRS003","False","False",,"False","False",,"False" -"PALM001","False","False",,"False","False",,"False" -"PSQL013","False","False",,"False","True","System.String[]","True" -"PVVC014","False","False",,"False","False",,"False" -"PIPM001","False","False",,"False","False",,"False" -"PSRS002","False","False",,"False","False",,"False" -"PSIS001","False","False",,"False","False",,"False" -"PVTS001",,"False",,"False","False",,"False" -"PDFS003","False","False",,"False","False",,"False" -"PMHB001","False","False",,"False","False",,"False" -"PFNP012","False","False",,"False","True","System.String[]","True" -"PDOC001","False","False",,"False","False",,"False" -"PFNP008","False","False",,"False","True","System.String[]","True" -"FLT2PALT001","False","False",,"False","False",,"False" -"PUTL006","False","False",,"False","True","System.String[]","True" -"PIIS003","False","False",,"False","False",,"False" -"PSEV010","False","False",,"False","False",,"False" -"PSEV013","False","False",,"False","False",,"False" -"PUTL011","False","False",,"False","True","System.String[]","True" -"PFAX004",,"False",,"False","False",,"False" -"PSNW001","False","False",,"False","False",,"False" -"PMON007","False","False",,"False","True","System.String[]","True" -"PSQL010","False","False",,"False","True","System.String[]","True" -"PDWH002","False","False",,"False","False",,"False" -"PSQL009","False","False",,"False","True","System.String[]","True" -"PVVC016","False","False",,"False","False",,"False" -"PVCO001","False","False",,"False","False",,"False" -"PFNP002","False","False",,"False","True","System.String[]","True" -"PWHD004","False","False",,"False","False",,"False" -"PDEP001","False","False",,"False","False",,"False" -"PVVC012","False","False",,"False","False",,"False" -"PVSS012","False","False",,"False","False",,"False" -"PVAV001","False","False",,"False","True","System.String[]","True" -"PGAW001","False","False",,"False","True","System.String[]","True" -"PAPP011","False","False",,"False","True","System.String[]","True" -"PSWF001","False","False",,"False","True","System.String[]","True" -"PVRS012","False","False",,"False","True","System.String[]","True" -"PSAP001","False","False",,"False","True","System.String[]","True" -"PFNP006","False","False",,"False","True","System.String[]","True" -"PSQL012","False","False",,"False","True","System.String[]","True" -"PKEY002","False","False",,"False","True","System.String[]","True" -"PSRS004","False","False",,"False","True","System.String[]","True" -"PSEV022","False","False",,"False","False",,"False" -"PSEV015","False","False",,"False","False",,"False" -"PCCR001","False","False",,"False","True","System.String[]","True" -"PSQL026","False","False",,"False","True","System.String[]","True" -"PVRS011","False","False",,"False","True","System.String[]","True" -"PFNP015","False","False",,"False","False",,"False" -"PSEV024","False","False",,"False","False",,"False" -"PVRT006","False","False",,"False","False",,"False" -"PRSH016","False","False",,"False","False",,"False" -"PRSH033","False","False",,"False","False",,"False" -"PRSH036","False","False",,"False","False",,"False" -"PRSH040","False","False",,"False","False",,"False" -"PRSH021","False","False",,"False","False",,"False" -"PRSH032","False","False",,"False","False",,"False" -"PRSH027","False","False",,"False","True","System.String[]","True" -"PRSH182","False","False",,"False","True","System.String[]","True" -"PRSH028","False","False",,"False","False",,"False" -"PRSH175","False","False",,"False","True","System.String[]","True" -"PEDI116","False","False",,"False","True","System.String[]","True" -"PRSH029","False","False",,"False","False",,"False" -"PVRT003","False","False",,"False","False",,"False" -"PRSH014","False","False",,"False","False",,"False" -"PRSH018","False","False",,"False","False",,"False" -"PRSH002","False","False",,"False","False",,"False" -"PRSH005","False","False",,"False","False",,"False" -"PRSH162","False","False",,"False","True","System.String[]","True" -"PRSH176","False","False",,"False","True","System.String[]","True" -"PBIZ112","False","False",,"False","False",,"False" -"PBIZ111","False","False",,"False","False",,"False" -"PRSH000","False","False",,"False","False",,"False" -"PRSH026","False","False",,"False","False",,"False" -"PVRT005","False","False",,"False","False",,"False" -"PRSH030","False","False",,"False","False",,"False" -"PRSH174","False","False",,"False","True","System.String[]","True" -"PRSH013","False","False",,"False","False",,"False" -"PRSH004","False","False",,"False","False",,"False" -"PRSH039","False","False",,"False","False",,"False" -"PRSH008","False","False",,"False","False",,"False" -"PRSH022","False","False",,"False","False",,"False" -"PRSH015","False","False",,"False","False",,"False" -"PRSH019","False","False",,"False","False",,"False" -"PRSH012","False","False",,"False","False",,"False" -"PEDI113","False","False",,"False","True","System.String[]","True" -"PRSH003","False","False",,"False","False",,"False" -"PRSH011","False","False",,"False","False",,"False" -"PRSH102","False","False",,"False","True","System.String[]","True" -"PRSH017","False","False",,"False","False",,"False" -"PRDS001","False","False",,"False","False",,"False" -"PRSH010","False","False",,"False","False",,"False" -"PRSH025","False","False",,"False","False",,"False" -"PRSH181","False","False",,"False","False",,"False" -"PRSH006","False","False",,"False","False",,"False" -"PRSH151","False","False",,"False","True","System.String[]","True" -"PRSH007","False","False",,"False","False",,"False" -"PRSH035","False","False",,"False","False",,"False" -"PRSH037","False","False",,"False","False",,"False" -"PVRT004","False","False",,"False","False",,"False" -"PRSH031","False","False",,"False","False",,"False" -"PRSH009","False","False",,"False","False",,"False" -"PRSH020","False","False",,"False","False",,"False" -"PRSH172","False","False",,"False","True","System.String[]","True" -"PRSH034","False","False",,"False","False",,"False" -"PRSH023","False","False",,"False","False",,"False" -"PEDI112","False","False",,"False","True","System.String[]","True" -"PRSH101","False","False",,"False","True","System.String[]","True" -"PRSH024","False","False",,"False","False",,"False" -"PRSH001","False","False",,"False","False",,"False" -"PRSH038","False","False",,"False","False",,"False" -"PRSH161","False","False",,"False","True","System.String[]","True" -"PVRT001","False","False",,"False","False",,"False" -"PVRT002","False","False",,"False","False",,"False" -"PRSH051","False","False",,"False","False",,"False" -"PSQL025","False","False",,"False","False",,"False" -"PEDI114","False","False",,"False","True","System.String[]","True" -"PEDI111","False","False",,"False","True","System.String[]","True" -"PEDI115","False","False",,"False","True","System.String[]","True" -"PRSH056","False","False",,"False","False",,"False" -"PRSH053","False","False",,"False","False",,"False" -"PRSH173","False","False",,"False","True","System.String[]","True" -"PRDS002","False","False",,"False","True","System.String[]","True" -"PRSH059","False","False",,"False","False",,"False" -"PRSH054","False","False",,"False","False",,"False" -"PRSH058","False","False",,"False","False",,"False" -"PRSH057","False","False",,"False","False",,"False" -"PRSH171","False","False",,"False","True","System.String[]","True" -"PRSH052","False","False",,"False","False",,"False" -"PRSH060","False","False",,"False","False",,"False" -"PRSH050","False","False",,"False","False",,"False" -"PRSH049","False","False",,"False","True","System.String[]","True" -"PRSH055","False","False",,"False","False",,"False" -"KSOVEPOPS001",,"False",,"False","False",,"False" -"PDISKTEST1","False","False",,"False","True","System.String[]","True" -"PAPP001","False","False",,"False","True","System.String[]","True" -"PFNP013","False","False",,"False","True","System.String[]","True" -"PVAV002","False","False",,"False","True","System.String[]","True" -"PVCO007","False","False",,"False","True","System.String[]","True" -"PDMC006","False","False",,"False","True","System.String[]","True" -"FLT2PDMC001","False","False",,"False","True","System.String[]","True" -"CTSTPDMC001","False","False",,"False","False",,"False" -"FLT2PDMC002","False","False",,"False","False",,"False" -"PDMC005","False","False",,"False","True","System.String[]","True" -"KSOPPDMC001","False","False",,"False","False",,"False" -"CTHAPDMC001","False","False",,"False","True","System.String[]","True" -"NYMEPDMC001","False","False",,"False","True","System.String[]","True" -"PDMC004","False","False",,"False","True","System.String[]","True" -"AZPHPDMC001","False","False",,"False","True","System.String[]","True" -"PIAM001","False","False",,"False","True","System.String[]","True" -"PIAM002","False","False",,"False","True","System.String[]","True" -"PIAC001","False","False",,"False","True","System.String[]","True" -"PIWM001","False","False",,"False","True","System.String[]","True" -"PIWM002","False","False",,"False","True","System.String[]","True" -"PICO001","True","False",,"False","True","System.String[]","True" -"POWA001","False","False",,"False","True","System.String[]","True" -"PVAV003","False","False",,"False","True","System.String[]","True" -"PSPT001","False","False",,"False","True","System.String[]","True" -"PBIZ122","False","False",,"False","False",,"False" -"PBIZ124","False","False",,"False","False",,"False" -"PBIZ125","False","False",,"False","False",,"False" -"PBIZ126","False","False",,"False","False",,"False" -"PBIZ123","False","False",,"False","False",,"False" -"PSLK001","False","False",,"False","False",,"False" -"PBIZ121","False","False",,"False","False",,"False" -"PFAX014","False","False",,"False","False",,"False" -"PDRF001","False","False",,"False","True","System.String[]","True" -"PSNX001","False","False",,"False","True","System.String[]","True" -"PIAP002","False","False",,"False","True","System.String[]","True" -"PFNP014","False","False",,"False","False",,"False" -"PFAX013","False","False",,"False","False",,"False" -"PMFT001","False","False",,"False","True","System.String[]","True" -"PFAX015","False","False",,"False","True","System.String[]","True" -"PIAP001","False","False",,"False","True","System.String[]","True" -"PMON006","False","False",,"False","True","System.String[]","True" -"PMQS001","False","False",,"False","True","System.String[]","True" -"PFOG001","False","False",,"False","True","System.String[]","True" -"PADS001","False","False",,"False","False",,"False" -"PFAX012","False","False",,"False","False",,"False" -"PRMS002","False","False",,"False","False",,"False" -"PRMS001","False","False",,"False","False",,"False" -"PFAX011","False","False",,"False","True","System.String[]","True" -"PFNP016","False","False",,"False","False",,"False" -"PFNP017","False","False",,"False","False",,"False" -"PJMP001","False","False",,"False","True","System.String[]","True" -"PKEY003","False","False",,"False","True","System.String[]","True" -"PUTL012","False","False",,"False","True","System.String[]","True" -"PIQV001","False","False",,"False","True","System.String[]","True" -"PSUS001","False","False",,"False","True","System.String[]","True" -"PSQL022","False","False",,"False","True","System.String[]","True" -"PSQL023B","False","False",,"False","True","System.String[]","True" -"PSQL022B","False","False",,"False","True","System.String[]","True" -"PSQL023","False","False",,"False","True","System.String[]","True" -"PSQL024","False","False",,"False","True","System.String[]","True" -"PSQL028B","False","False",,"False","True","System.String[]","True" -"PSIS003","False","False",,"False","False",,"False" -"PSQL029A","False","False",,"False","True","System.String[]","True" -"PSQL029B","False","False",,"False","True","System.String[]","True" -"PSQL028A","False","False",,"False","True","System.String[]","True" -"PCMX001","False","False",,"False","True","System.String[]","True" -"PSSP001","False","False",,"False","True","System.String[]","True" -"PSSP002","False","False",,"False","True","System.String[]","True" -"PSQL030A","False","False",,"False","True","System.String[]","True" -"PSQL030B","False","False",,"False","True","System.String[]","True" -"PAPJNKSSLA201","False","False",,"False","True","System.String[]","True" -"PNCRAFILE001","False","False",,"False","True","System.String[]","True" -"PSSP004","False","False",,"False","True","System.String[]","True" -"PSSP003","False","False",,"False","True","System.String[]","True" -"PNCRAFILE005","False","False",,"False","True","System.String[]","True" -"FLT2VEB002","False","False",,"False","False",,"False" -"PNCRAFILE003","False","False",,"False","True","System.String[]","True" -"PNCRANTRX002","False","False",,"False","False",,"False" -"FLT2VEB003","False","False",,"False","False",,"False" -"PNCRAVERIDX003","False","False",,"False","False",,"False" -"PNCRAVERVLT002","False","False",,"False","True","System.String[]","True" -"PNCRAMSMQ001","False","False",,"False","True","System.String[]","True" -"PNCRAVERVLT003","False","False",,"False","False",,"False" -"PNCRAVERVLT001","False","False",,"False","True","System.String[]","True" -"PNCRAVERIDX002","False","False",,"False","False",,"False" -"PNCRAVERIDX001","False","False",,"False","False",,"False" -"PNCRAVERDA001","False","False",,"False","False",,"False" -"PRSH152","False","False",,"False","True","System.String[]","True" diff --git a/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ2-10-29-2019.csv b/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ2-10-29-2019.csv deleted file mode 100644 index b4f5ebe..0000000 --- a/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ2-10-29-2019.csv +++ /dev/null @@ -1,6 +0,0 @@ -"Computer","CBServicing","WindowsUpdate","CCMClientSDK","PendComputerRename","PendFileRename","PendFileRenVal","RebootPending" -"Q2FNP003","False","False",,"False","False",,"False" -"QRSH022","False","False",,"False","True","System.String[]","True" -"QRSH021","False","False",,"False","False",,"False" -"QRSH023","False","False",,"False","False",,"False" -"Q2SQL022","False","False",,"False","True","System.String[]","True" diff --git a/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ4-10-23-2019.csv b/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ4-10-23-2019.csv deleted file mode 100644 index 83765c6..0000000 --- a/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ4-10-23-2019.csv +++ /dev/null @@ -1,8 +0,0 @@ -"Computer","CBServicing","WindowsUpdate","CCMClientSDK","PendComputerRename","PendFileRename","PendFileRenVal","RebootPending" -"QBIZ142","False","False",,"False","False",,"False" -"QBIZ141","False","False",,"False","False",,"False" -"QAPP041","False","False",,"False","True","System.String[]","True" -"QRSH041","False","False",,"False","False",,"False" -"Q4SQL022B","False","False",,"False","True","System.String[]","True" -"Q4FNP003","False","False",,"False","False",,"False" -"Q4SQL022","False","False",,"False","True","System.String[]","True" diff --git a/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ5-10-22-2019.csv b/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ5-10-22-2019.csv deleted file mode 100644 index 56d2f72..0000000 --- a/dump/WSUS_Scripts/Files/PENDING-Reboots-CCXQ5-10-22-2019.csv +++ /dev/null @@ -1,6 +0,0 @@ -"Computer","CBServicing","WindowsUpdate","CCMClientSDK","PendComputerRename","PendFileRename","PendFileRenVal","RebootPending" -"QAPP051","False","False",,"False","True","System.String[]","True" -"QRSH051","False","False",,"False","False",,"False" -"Q5FNP003","False","False",,"False","False",,"False" -"QBIZ152","False","False",,"False","True","System.String[]","True" -"Q5SQL022","False","False",,"False","True","System.String[]","True" diff --git a/dump/WSUS_Scripts/Files/new-Patch-WSUSGroup-backup1.ps1 b/dump/WSUS_Scripts/Files/new-Patch-WSUSGroup-backup1.ps1 deleted file mode 100644 index b4d8c50..0000000 --- a/dump/WSUS_Scripts/Files/new-Patch-WSUSGroup-backup1.ps1 +++ /dev/null @@ -1,76 +0,0 @@ -<# - -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" -#> - -################################################################################################################################# -#$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" - -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -#$servers = "W2012A","W2012B","slfkjsdl" -#$WSUSGroup = "Test GGroupp" -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() - -$servers | Out-File $Location\Patching-Day\"$WSUSGroup"-Server-Patching-Today-$Dte.txt -$servers | Out-File E:\WSUS_Scripts\Patching-Day\"$WSUSGroup"-Server-Patching-Today-Backup-$Dte.txt - -Foreach ($server in $servers) { - - $Patch_Job += Start-Job -ScriptBlock { Param($server) Install-WindowsUpdate -ComputerName $server } -Name "$server-Patching" -ArgumentList $server - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell" - }#endInvoke - - - - - #Install-WindowsUpdate -ComputerName $server -AsJob - - - - -}#endForeach - -Get-Job - -$Patch_Job | Export-Csv $Location\Patching-Day\Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv E:\WSUS_Scripts\Patching-Day\Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" - - - - - - - - - - \ No newline at end of file diff --git a/dump/WSUS_Scripts/Lock_Script.txt b/dump/WSUS_Scripts/Lock_Script.txt deleted file mode 100644 index e69de29..0000000 diff --git a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupFailedUpdates.ps1 b/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupFailedUpdates.ps1 deleted file mode 100644 index a8557b7..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupFailedUpdates.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$WSUSGroup = Read-Host "Enter Target Group Name" -$Computers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -foreach ($computer in $computers){ -if(!(Test-Connection -Cn $computer -BufferSize 16 -Count 1 -ea 0 -quiet)) -{write-host "cannot reach $computer" -f red} - -else {$Session = New-Object -ComObject "Microsoft.Update.Session" - -$Searcher = $Session.CreateUpdateSearcher() - -$historyCount = $Searcher.GetTotalHistoryCount() - -$Searcher.QueryHistory(0, $historyCount) | Select-Object @{Name="Computer"; Expression={$Computer}}, Date, - - @{name="Operation"; expression={switch($_.operation){ - - 1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}}, - - @{name="Status"; expression={switch($_.resultcode){ - - 1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"}; - - 4 {"Failed"}; 5 {"Aborted"} - -}}},Title| Where {$_.Status -eq "Failed"}|Write-Host|Export-Csv -NoType "$Env:userprofile\Desktop\$wsusgroup-Failed-WindowsUpdates.csv" -Append}} \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupPatchInProgress.ps1 b/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupPatchInProgress.ps1 deleted file mode 100644 index b602935..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupPatchInProgress.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$WSUSGroup = Read-Host "Enter Target Group Name" -$Computers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -foreach ($computer in $computers){ -if(!(Test-Connection -Cn $computer -BufferSize 16 -Count 1 -ea 0 -quiet)) -{write-host "cannot reach $computer" -f red} - -else {$Session = New-Object -ComObject "Microsoft.Update.Session" - -$Searcher = $Session.CreateUpdateSearcher() - -$historyCount = $Searcher.GetTotalHistoryCount() - -$Searcher.QueryHistory(0, $historyCount) | Select-Object @{Name="Computer"; Expression={$Computer}}, Date, - - @{name="Operation"; expression={switch($_.operation){ - - 1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}}, - - @{name="Status"; expression={switch($_.resultcode){ - - 1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"}; - - 4 {"Failed"}; 5 {"Aborted"} - -}}},Title| Where {$_.Status -eq "In Progress"}|Write-Host}} \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupPatchStatus.ps1 b/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupPatchStatus.ps1 deleted file mode 100644 index b602935..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupPatchStatus.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$WSUSGroup = Read-Host "Enter Target Group Name" -$Computers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -foreach ($computer in $computers){ -if(!(Test-Connection -Cn $computer -BufferSize 16 -Count 1 -ea 0 -quiet)) -{write-host "cannot reach $computer" -f red} - -else {$Session = New-Object -ComObject "Microsoft.Update.Session" - -$Searcher = $Session.CreateUpdateSearcher() - -$historyCount = $Searcher.GetTotalHistoryCount() - -$Searcher.QueryHistory(0, $historyCount) | Select-Object @{Name="Computer"; Expression={$Computer}}, Date, - - @{name="Operation"; expression={switch($_.operation){ - - 1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}}, - - @{name="Status"; expression={switch($_.resultcode){ - - 1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"}; - - 4 {"Failed"}; 5 {"Aborted"} - -}}},Title| Where {$_.Status -eq "In Progress"}|Write-Host}} \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupUpdatesInProgress.ps1 b/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupUpdatesInProgress.ps1 deleted file mode 100644 index 9fa538a..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Get-WSUSGroupUpdatesInProgress.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#https://gallery.technet.microsoft.com/scriptcenter/Get-Installed-FailedWindows-9f28742a - -$WSUSGroup = Read-Host "Enter Target Group Name" -$Computers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -foreach ($computer in $computers){ -if(!(Test-Connection -Cn $computer -BufferSize 16 -Count 1 -ea 0 -quiet)) -{write-host "cannot reach $computer" -f red} - -else {$Session = New-Object -ComObject "Microsoft.Update.Session" - -$Searcher = $Session.CreateUpdateSearcher() - -$historyCount = $Searcher.GetTotalHistoryCount() - -$Searcher.QueryHistory(0, $historyCount) | Select-Object @{Name="Computer"; Expression={$Computer}}, Date, - - @{name="Operation"; expression={switch($_.operation){ - - 1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}}, - - @{name="Status"; expression={switch($_.resultcode){ - - 1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"}; - - 4 {"Failed"}; 5 {"Aborted"} - -}}},Title| Where {$_.Status -eq "In Progress"}}} \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/NewSorting.ps1 b/dump/WSUS_Scripts/Old-Scripts/NewSorting.ps1 deleted file mode 100644 index 766152e..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/NewSorting.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -Import-Module ActiveDirectory -Import-Module WindowsUpdate - - -$ServerList = Import-Csv 'C:\Users\abamaso-ccxadmin\Desktop\CompletedProd_WindowsServers - Classifications.csv' - - -foreach ($Server in $ServerList) { -$patchingtier = $Server.Classification - -switch ($patchingtier){ - -"Tier0 - Infrastructure" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier0 - Infrastructure"} -"Tier1 - Critical Infrastructure" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier1 - Critical Infrastructure"} -"Tier2 - File Servers" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier2 - File Servers"} -"Tier2 - Application Servers" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier2 - Application Servers"} -} -Write-host $Server.'Server Name'" Sorted into Group" -} \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/Patch Checklist.xlsx b/dump/WSUS_Scripts/Old-Scripts/Patch Checklist.xlsx deleted file mode 100644 index d6adc60..0000000 Binary files a/dump/WSUS_Scripts/Old-Scripts/Patch Checklist.xlsx and /dev/null differ diff --git a/dump/WSUS_Scripts/Old-Scripts/Sorting_Hat.ps1 b/dump/WSUS_Scripts/Old-Scripts/Sorting_Hat.ps1 deleted file mode 100644 index 853a8b0..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Sorting_Hat.ps1 +++ /dev/null @@ -1,603 +0,0 @@ -# -# WSUS_Sorting_HAT.PS1 -# -#DOCUMENTATION: -#Written by Kevin Trent, kevin.trent@carecentrix.com - -#CHANGE LOG: - #Version 1.0 6/12/2018 - First functional edition - Kevin Trent - -#UPGRADES: - # Planned: - # Add auto detection of new OU and auto creation of new function. - KJT - -#DESCRIPTION: -#WSUS Server-Side targeting chosen to enable flexibility with group assignment. Sorting Hat, takes the place of client-side targeting in a GPO. -#Servers are still added to the unassigned computers group via linked GPO: - #(Prod Server SUS 2016 - PSUS002 - Server Side Targeting, DEV Server SUS 2016 - PSUS002 - Server Side Targeting, QA Server SUS 2016 - PSUS002 - Server Side Targeting) -#Each function sorts systems from the WSUS unassigned computers group to an appropriate target group based on the AD OU. - -#MAINTENANCE: -#NEW Active Directory OUs require reciprocal functions to be added. - #New Function Copy/Paste existing function and make these required changes: - #Function name = WSUS Group Name, remove spaces - between each word. - #Variable name - WSUS Group Name, remove spaces change - to _. TargetGroupName = WSUS Group name. - #Canonicalname = OU with wildcard (*) in place of machine name(s). - #Find Canonicalname of a group by running the following command against a machine in that OU: Get-ADComputer -Identity qbiz111 -Properties *|select CanonicalName - #Add Group function to the Run function: (If $newservers.count -gt 0) Scriptblock near the bottom, so that the new function is called when the script is executed. - #Add comment to the ChangeLog remark above - -#Module Import. This Script requires RSAT and PowerShell v3.0 or higher on the executing system. -Import-Module ActiveDirectory -Import-Module WindowsUpdate - -#System Collection: -#Building the collections to be sorted from the WSUS unassigned computers group removes the need to validate each member. - #Each array memeber can only be in the collection if it passed cetificate, protocol, and connectivity requirements. -$newserversfull = Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -ComputerTargetGroups "Unassigned Computers"|select Fulldomainname -ExpandProperty Fulldomainname - -#Shortening the array member names to a useable Get-ADComputer Identity -$newservers = Foreach ($server in $newserversfull) {$server.split(‘.’)[0]} - -#SORTING FUNCTIONS: -#Each function runs each memeber of the collection through a loop that contains an AD-OU query. If the member(s) are in the specified AD-OU they are inserted into the WSUS Target Group. -#For simplified locating; functions are grouped under comments with the WSUS group parent name. Example, NCRA QUALITY ASSURANCE SERVERS or CTHA PRODUCTION SERVERS - -#CTHA PRODUCTION SERVERS -Function CTHA-Verint-PROD { - $CTHA_Verint_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/CTHA/Servers/Production Servers/Verint Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $CTHA_Verint_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "CTHA - Verint - PROD" - } - -} - -#KSOP PRODUCTION SERVERS -Function KSOP-Verint-PROD { - $KSOP_Verint_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/KSOP/Servers/Production Servers/Verint Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $KSOP_Verint_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "KSOP - Verint - PROD" - } - -} - -#AZPH PRODUCTION SERVERS -Function AZPH-Verint-PROD { - $AZPH_Verint_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/AZPH/Servers/Production Servers/Verint Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $AZPH_Verint_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "AZPH - Verint - PROD" - } - -} - -#FLT2 PRODUCTION SERVERS -Function FLT2-Application-PROD { - $FLT2_Application_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/FLT2/Servers/Production Servers/Application Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $FLT2_Application_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "FLT2 - Application - PROD" - } - -} - -Function FLT2-Verint-PROD { - $FLT2_Verint_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/FLT2/Servers/Production Servers/Verint Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $FLT2_Verint_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "FLT2 - Verint - PROD" - } - -} - -Function FLT2-Voice-PROD { - $FLT2_Voice_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/FLT2/Servers/Production Servers/Voice Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $FLT2_Voice_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "FLT2 - Voice - PROD" - } - -} - -#NCRA DEVELOPMENT SERVERS -Function NCRA-Application-DEV { - $NCRA_Application_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/Application Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Application_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Application - DEV" - } - -} - -Function NCRA-BizTalk-DEV { - $NCRA_BizTalk_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/BizTalk Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_BizTalk_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - BizTalk - DEV" - } - -} - -Function NCRA-Edifecs-DEV { - $NCRA_Edifecs_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/Edifecs Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Edifecs_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Edifecs - DEV" - } - -} - -Function NCRA-Remote-Desktop-DEV{ - $NCRA_Remote_Desktop_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/Remote Desktop Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Remote_Desktop_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Remote Desktop - DEV" - } - -} - -Function NCRA-SQL-DEV { - $NCRA_SQL_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/SQL Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_SQL_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - SQL - DEV" - } - -} - -Function NCRA-Terminal-Servers-DEV { - $NCRA_Terminal_Servers_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/Terminal Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Application_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Terminal Servers - DEV" - } - -} - -Function NCRA-Voice-DEV { - $NCRA_Voice_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/Voice Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Voice_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Voice - DEV" - } - -} - -Function NCRA-Web-DEV { - $NCRA_Web_DEV = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Development Servers/Web Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Web_DEV) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Web - DEV" - } - -} - -#NCRA PRODUCTION SERVERS: -Function NCRA-Application-PROD { - $NCRA_Application_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Application Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Application_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Application - PROD" - } - -} - -Function NCRA-BizTalk-PROD { - $NCRA_BizTalk_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/BizTalk Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_BizTalk_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - BizTalk - PROD" - } - -} - -Function NCRA-Edifecs-PROD { - $NCRA_Edifecs_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Edifecs Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Edifecs_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Edifecs - PROD" - } - -} - -Function NCRA-Exchange-PROD { - $NCRA_Exchange_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Exchange Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Exchange_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Exchange - PROD" - } - -} - -Function NCRA-Mail-Terminal-Servers-PROD { - $NCRA_Mail_Terminal_Servers_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Mail Terminal Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Mail_Terminal_Servers_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Mail Terminal Servers - PROD" - } - -} - -Function NCRA-Remote-Desktop-Prod { - $NCRA_Remote_Desktop_Prod = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Remote Desktop Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Remote_Desktop_Prod) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Remote Desktop - PROD" - } - -} - -Function NCRA-SQL-PROD { - $NCRA_SQL_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/SQL Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_SQL_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - SQL - PROD" - } - -} - -Function NCRA-Terminal-Servers-PROD { - $NCRA_Terminal_Servers_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Terminal Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Terminal_Servers_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Terminal Servers - PROD" - } - -} - -Function NCRA-Tidal-PROD { - $NCRA_Tidal_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Tidal Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Tidal_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Tidal - PROD" - } - -} - -Function NCRA-Verint-PROD { - $NCRA_Verint_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Verint Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Verint_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Verint - PROD" - } - -} - -Function NCRA-Vistar-Terminal-Servers-PROD { - $NCRA_Vistar_Terminal_Servers_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Vistar Terminal Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Vistar_Terminal_Servers_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Vistar Terminal Servers - PROD" - } - -} - -Function NCRA-Voice-PROD { - $NCRA_Voice_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Voice Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Voice_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Voice - PROD" - } - -} - -Function NCRA-Web-PROD { - $NCRA_Web_PROD = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/Production Servers/Web Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Web_PROD) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Web - PROD" - } - -} - -#NCRA QUALITY ASSURANCE SERVERS: -Function NCRA-Application-QA { - $NCRA_Application_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/Application Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Application_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Application - QA" - } - -} - -Function NCRA-BizTalk-QA { - $NCRA_BizTalk_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/BizTalk Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_BizTalk_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - BizTalk - QA" - } - -} - -Function NCRA-Edifecs-QA { - $NCRA_Edifecs_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/Edifecs Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Edifecs_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Edifecs - QA" - } - -} - -Function NCRA-Remote-Desktop-QA { - $NCRA_Remote_Desktop_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/Remote Desktop Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Remote_Desktop_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Remote Desktop - QA" - } - -} - -Function NCRA-SQL-QA { - $NCRA_SQL_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/Remote Desktop Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_SQL_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - SQL - QA" - } - -} - -Function NCRA-Terminal-Servers-QA { - $NCRA_Terminal_Servers_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/Remote Desktop Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Terminal_Servers_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Terminal Servers - QA" - } - -} - -Function NCRA-Tidal-QA { - $NCRA_Tidal_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/Tidal Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Tidal_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - Tidal - QA" - } - -} - -Function NCRA-Web-QA { - $NCRA_Web_QA = Foreach ($server in $newservers) { - Get-ADComputer -Identity $server -Properties * | - Select dnshostname,canonicalname -ExpandProperty canonicalname| - Where canonicalname -Like "ccx.carecentrix.com/NCRA/Servers/QA Servers/Web Servers/*"| - Select dnshostname -ExpandProperty dnshostname - } - - Foreach ($server in $NCRA_Web_QA) { - Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server|Add-WsusComputer -TargetGroupName "NCRA - WEb - QA" - } - -} - -#RUN: -# This function executes the script if there are new/unsorted servers in the Unassigned Computers group on the WSUS server -Function Run { - -If ($newservers.Count -gt 0) - { - CTHA-Verint-PROD - KSOP-Verint-PROD - AZPH-Verint-PROD - FLT2-Application-PROD - FLT2-Verint-PROD - FLT2-Voice-PROD - NCRA-Application-DEV - NCRA-BizTalk-DEV - NCRA-Edifecs-DEV - NCRA-Remote-Desktop-DEV - NCRA-SQL-DEV - NCRA-Terminal-Servers-DEV - NCRA-Voice-DEV - NCRA-Web-DEV - NCRA-Application-PROD - NCRA-BizTalk-PROD - NCRA-Edifecs-PROD - NCRA-Exchange-PROD - NCRA-Mail-Terminal-Servers-PROD - NCRA-Remote-Desktop-Prod - NCRA-SQL-PROD - NCRA-Terminal-Servers-PROD - NCRA-Tidal-PROD - NCRA-Verint-PROD - NCRA-Vistar-Terminal-Servers-PROD - NCRA-Voice-PROD - NCRA-Web-PROD - NCRA-Application-QA - NCRA-BizTalk-QA - NCRA-Edifecs-QA - NCRA-Remote-Desktop-QA - NCRA-SQL-QA - NCRA-Terminal-Servers-QA - NCRA-Tidal-QA - NCRA-Web-QA - - - } - Else {Send-MailMessage -SmtpServer smtp.ccx.carecentrix.com -From WSUS-Sorting-Hat@carecentrix.com -To kevin.trent@carecentrix.com -Subject "No new unassigned computers" - -Body "Sorting Hat did not dectect any new servers in the WSUS unassigned computers group. No action was taken."} -} - -Run - -#REPORTING: - #Still working on this section. Sudo-code below. - -#Servers Not Registered with WSUS: - #$wsus = get-wsusserver -name psus002 -portnumber 8530|get-wsuscomputer|select -ExpandProperty Fulldomainname - #$windows = Get-ADComputer -Properties * -Filter {(OperatingSystem -like "*Windows Server*")}|Select DNSHostName -ExpandProperty DNSHostName - #$nonreg = Compare-Object $wsus $windows|ForEach-Object {$_.InputObject} - -#Servers still in the Unassigned Group - #$unassed = Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -ComputerTargetGroups "Unassigned Computers"|select Fulldomainname -ExpandProperty Fulldomainname - diff --git a/dump/WSUS_Scripts/Old-Scripts/Start-Backups.ps1 b/dump/WSUS_Scripts/Old-Scripts/Start-Backups.ps1 deleted file mode 100644 index f28c1fa..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Start-Backups.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -#Enable VEEAM Job Scheduler at the end of maintenance -Add-PSSnapin -Name VeeamPSSnapIn -Connect-VBRServer -Server PVEB001 -Get-VBRJob | where {$_.JobTargetType -eq "Backup" -and $_.IsScheduleEnabled -eq $true} | Enable-VBRJobSchedule -Disconnect-VBRServer -Send-MailMessage -SmtpServer smtp.ccx.carecentrix.com -To windows-admins@carecentrix.com -From backups@carecentrix.com -Subject "Veeam Backups Started" -Body "The Veeam Backup Jobs have been rescheduled after the infrastructure weekend.Please verify they are running as expected." -Exit \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/Stop-Backups.ps1 b/dump/WSUS_Scripts/Old-Scripts/Stop-Backups.ps1 deleted file mode 100644 index 1a9220f..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Stop-Backups.ps1 +++ /dev/null @@ -1,6 +0,0 @@ -#Disable VEEAM Job Schedule - Schedule to Run at 7pm on maintenance day -Add-PSSnapin -Name VeeamPSSnapIn -Connect-VBRServer -Server PVEB001 -Get-VBRJob | where {$_.JobTargetType -eq "Backup" -and $_.IsScheduleEnabled -eq $true} | Disable-VBRJobSchedule - -Disconnect-VBRServer diff --git a/dump/WSUS_Scripts/Old-Scripts/Test-WSUS-Patch-WSUSGroup.ps1 b/dump/WSUS_Scripts/Old-Scripts/Test-WSUS-Patch-WSUSGroup.ps1 deleted file mode 100644 index 2cd108b..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/Test-WSUS-Patch-WSUSGroup.ps1 +++ /dev/null @@ -1,68 +0,0 @@ -<# - -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" -#> - -################################################################################################################################# -#$ErrorActionPreference = "Ignore" -#$WSUSGroup = Read-Host "Enter Target Group Name" - -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -$servers = "W2012A","W2012B","slfkjsdl" -$WSUSGroup = "Test GGroupp" -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() - -$servers | Out-File $Location\Patching-Day\"$WSUSGroup"-Server-Patching-Today-$Dte.txt -$servers | Out-File E:\WSUS_Scripts\Patching-Day\"$WSUSGroup"-Server-Patching-Today-$Dte.txt - -Foreach ($server in $servers) { - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Started" -ErrorAction SilentlyContinue - New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Finished" -ErrorAction SilentlyContinue - New-EventLog -LogName System -Source "Powershell-Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell" - }#endInvoke - - #Install-WindowsUpdate -ComputerName $server -AsJob - - $Patch_Job += Start-Job -ScriptBlock { Param($server) Install-WindowsUpdate -ComputerName $server } -Name "$server-Patching" -ArgumentList $server - - -}#endForeach -$Patch_Job | Export-Csv $Location\Patching-Day\Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv E:\WSUS_Scripts\Patching-Day\Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" - -$servers | % { Get-EventLog -LogName Application -ComputerName $_ -ErrorAction SilentlyContinue | ? { $_.EventID -eq '7890' -and $_.TimeWritten -like "*$Dte*" } } -#Collect event log - - - - - - - diff --git a/dump/WSUS_Scripts/Old-Scripts/WSUSComputerCheck.ps1 b/dump/WSUS_Scripts/Old-Scripts/WSUSComputerCheck.ps1 deleted file mode 100644 index 906d14b..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/WSUSComputerCheck.ps1 +++ /dev/null @@ -1,35 +0,0 @@ -Import-Module ActiveDirectory -Import-Module WindowsUpdate - - -$ServerList = Import-Csv 'C:\Users\abamaso-ccxadmin\Desktop\CompletedProd_WindowsServers - Classifications.csv' - -$AllServers = @() - -foreach ($Server in $ServerList) { -$patchingtier = $Server.Classification -$ServerObject = New-Object psobject - -$ComputerValidation = $null - -$WSUSComputerObject = Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name' - -$ComputerValidation = $wsuscomputerobject.FullDomainName - -$ServerObject | Add-Member -MemberType NoteProperty -Name "Server Name" -Value $server.'Server Name' -$ServerObject | Add-Member -MemberType NoteProperty -Name "Operating System" -Value $server.'Operating System' -$ServerObject | Add-Member -MemberType NoteProperty -Name "Application" -Value $server.Application - -if ($ComputerValidation -eq $null) { -$ServerObject | Add-Member -MemberType NoteProperty -Name "WSUS Status" -Value "Server is not in WSUS" -} -else { -$ServerObject | Add-Member -MemberType NoteProperty -Name "WSUS Status" -Value "Server is in WSUS" -} - -$AllServers +=$ServerObject - -Write-host $Server.'Server Name'" checked in WSUS" -} - -$AllServers | export-csv C:\Users\abamaso-ccxadmin\Desktop\WSUSComputers.csv \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup-2.ps1 b/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup-2.ps1 deleted file mode 100644 index 968195e..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup-2.ps1 +++ /dev/null @@ -1,110 +0,0 @@ -<# - -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" -#> - -################################################################################################################################# -#$ErrorActionPreference = "Ignore" - -#$servers = "W2012A","W2012B","slfkjsdl" -#$WSUSGroup = "Test GGroupppppp" -################################################################################################################################# -If(Test-Path E:\WSUS_Scripts\Lock_Script.txt) { - Write-Host "The Script is locked for protection. If you are not running it by mistake - Delete the file (E:\WSUS_Scripts\Lock_Script.txt) and run the Script again" -ForegroundColor Yellow - Break -} -Else { New-Item -Path E:\WSUS_Scripts -Name Lock_Script.txt -ItemType File } -################################################################################################################################# - -Get-Job | Remove-Job - -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -############################################################ -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -$Current_Month = (Get-Date -UFormat %B) - -############################################################ -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() -$Failed_Jobs = @() -$Receive_Jobs = @() - -If(!(Test-Path E:\WSUS_Scripts\Patching-Day\$WSUSGroup-$Current_Month-Patching)) { New-Item -Path "E:\WSUS_Scripts\Patching-Day" -ItemType Directory -Name $WSUSGroup-$Current_Month-Patching } - -$servers = "" -$WSUSGroup = Read-Host "Enter Target Group Name" - -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select -ExpandProperty Fulldomainname -$Group_Folder = "$WSUSGroup-$Current_Month-Patching" - -$Servers_Reboot_Only = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\CCXQ1-November-Prep-Files\Manual-$WSUSGroup-OperatingSystems-$Current_Month.csv -$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\CCXQ1-November-Prep-Files\$WSUSGroup-Target-Group-Computers-$Current_Month.csv | select -ExpandProperty FullDomainName - -$servers = $servers | ? { $_ -notin $Servers_Reboot_Only.FullDomainName } - -#$Failed_Ping_Test = gc $Location\Files\$WSUSGroup-Ping-Failed-$Current_Month.txt -#$servers = $servers | ? { $_ -notin $Failed_Ping_Test } - -$servers | Out-File $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Today-$Dte.txt -$servers | Out-File E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Today-Backup-$Dte.txt - -Foreach ($server in $servers) { - - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -ComputerName $server -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Remote" -ComputerName $server -ErrorAction SilentlyContinue -verbose - - $Patch_Job += Start-Job -ScriptBlock { Param($server) WindowsUpdate\Install-WindowsUpdate -ComputerName $server } -Name "$WSUSGroup-$server-Patching" -ArgumentList $server - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Invoke" -verbose - }#endInvoke - -}#endForeach - -#Get-Job - -$Patch_Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - - -<# - -$Failed_Jobs += $Patch_Job | ? { $_.State -eq "Failed" } - -$Failed_Jobs | ft -autosize - -$Failed_Jobs | Export-Csv "E:\WSUS_Scripts\Patching-Day\NCRA - Quality Assurance Servers-November-Patching\failed-jobs.csv" -NoTypeInformation - -#> - - -### Running Count -## ( $Patch_Job | ? { $_.State -eq "Running" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Completed" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Failed" } ).count - - - \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup-3.ps1 b/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup-3.ps1 deleted file mode 100644 index 968195e..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup-3.ps1 +++ /dev/null @@ -1,110 +0,0 @@ -<# - -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" -#> - -################################################################################################################################# -#$ErrorActionPreference = "Ignore" - -#$servers = "W2012A","W2012B","slfkjsdl" -#$WSUSGroup = "Test GGroupppppp" -################################################################################################################################# -If(Test-Path E:\WSUS_Scripts\Lock_Script.txt) { - Write-Host "The Script is locked for protection. If you are not running it by mistake - Delete the file (E:\WSUS_Scripts\Lock_Script.txt) and run the Script again" -ForegroundColor Yellow - Break -} -Else { New-Item -Path E:\WSUS_Scripts -Name Lock_Script.txt -ItemType File } -################################################################################################################################# - -Get-Job | Remove-Job - -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -############################################################ -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -$Current_Month = (Get-Date -UFormat %B) - -############################################################ -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() -$Failed_Jobs = @() -$Receive_Jobs = @() - -If(!(Test-Path E:\WSUS_Scripts\Patching-Day\$WSUSGroup-$Current_Month-Patching)) { New-Item -Path "E:\WSUS_Scripts\Patching-Day" -ItemType Directory -Name $WSUSGroup-$Current_Month-Patching } - -$servers = "" -$WSUSGroup = Read-Host "Enter Target Group Name" - -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select -ExpandProperty Fulldomainname -$Group_Folder = "$WSUSGroup-$Current_Month-Patching" - -$Servers_Reboot_Only = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\CCXQ1-November-Prep-Files\Manual-$WSUSGroup-OperatingSystems-$Current_Month.csv -$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\CCXQ1-November-Prep-Files\$WSUSGroup-Target-Group-Computers-$Current_Month.csv | select -ExpandProperty FullDomainName - -$servers = $servers | ? { $_ -notin $Servers_Reboot_Only.FullDomainName } - -#$Failed_Ping_Test = gc $Location\Files\$WSUSGroup-Ping-Failed-$Current_Month.txt -#$servers = $servers | ? { $_ -notin $Failed_Ping_Test } - -$servers | Out-File $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Today-$Dte.txt -$servers | Out-File E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Today-Backup-$Dte.txt - -Foreach ($server in $servers) { - - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -ComputerName $server -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Remote" -ComputerName $server -ErrorAction SilentlyContinue -verbose - - $Patch_Job += Start-Job -ScriptBlock { Param($server) WindowsUpdate\Install-WindowsUpdate -ComputerName $server } -Name "$WSUSGroup-$server-Patching" -ArgumentList $server - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Invoke" -verbose - }#endInvoke - -}#endForeach - -#Get-Job - -$Patch_Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - - -<# - -$Failed_Jobs += $Patch_Job | ? { $_.State -eq "Failed" } - -$Failed_Jobs | ft -autosize - -$Failed_Jobs | Export-Csv "E:\WSUS_Scripts\Patching-Day\NCRA - Quality Assurance Servers-November-Patching\failed-jobs.csv" -NoTypeInformation - -#> - - -### Running Count -## ( $Patch_Job | ? { $_.State -eq "Running" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Completed" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Failed" } ).count - - - \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup.ps1 b/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup.ps1 deleted file mode 100644 index 0f8d339..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/new-Patch-WSUSGroup.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -<# - -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" -#> - -################################################################################################################################# -#$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" - -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -#$servers = "W2012A","W2012B","slfkjsdl" -#$WSUSGroup = "Test GGroupppppp" - -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() - -$servers | Out-File $Location\Patching-Day\"$WSUSGroup"-Server-Patching-Today-$Dte.txt -$servers | Out-File E:\WSUS_Scripts\Patching-Day\"$WSUSGroup"-Server-Patching-Today-Backup-$Dte.txt - -Foreach ($server in $servers) { - - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -ComputerName $server - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -ComputerName $server - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -ComputerName $server - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Remote" -ComputerName $server -ErrorAction SilentlyContinue - - $Patch_Job += Start-Job -ScriptBlock { Param($server) Install-WindowsUpdate -ComputerName $server } -Name "$server-Patching" -ArgumentList $server - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Invoke" - }#endInvoke - - Install-WindowsUpdate -ComputerName $server -AsJob - -}#endForeach - -Get-Job - -$Patch_Job | Export-Csv $Location\Patching-Day\Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv E:\WSUS_Scripts\Patching-Day\Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - - - - - - - - - \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/new-Reboot-WSUSGroup-2.ps1 b/dump/WSUS_Scripts/Old-Scripts/new-Reboot-WSUSGroup-2.ps1 deleted file mode 100644 index ffaf1aa..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/new-Reboot-WSUSGroup-2.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -################################################################################################################################# -$Dte = Get-Date -UFormat %m-%d-%Y -$Current_Month = (Get-Date -UFormat %B) -$WSUSGroup = "NCRA - Development Servers" -$Group_Folder = "$WSUSGroup-$Current_Month-Patching" -$Group = "NCRA - Development Servers" -################################################################################################################################# -#$WSUSGroup = Read-Host "Enter Target Group Name" -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -$servers = Import-Csv E:\WSUS_Scripts\Files\*$Group*.csv -#$servers = "w2012a","w2012b","testtest" - -$servers | Out-File $Location\Patching-Day\$Group_Folder\$WSUSGroup-Servers-Rebooting-$Dte.txt -ErrorAction SilentlyContinue -$servers | Out-File E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Servers-Rebooting-Backup-$Dte.txt -ErrorAction SilentlyContinue - -$Patch_Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Get-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Get-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Collect-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Collect-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation - -Foreach ($server in $servers) { - - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Remote" -ComputerName $server.Computer -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Remote" -ComputerName $server.Computer -ErrorAction SilentlyContinue - - Invoke-Command $server.Computer -ErrorAction SilentlyContinue { - #New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Finished" -ErrorAction SilentlyContinue - #New-EventLog -LogName System -Source "Powershell-Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Invoke" -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Invoke" -ErrorAction SilentlyContinue - }#endInvoke - Restart-Computer -ComputerName $server.Computer -Force -Verbose - -}#endForeach - -<# - -$servers.computer | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } - } - - -#> \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/new-Reboot-WSUSGroup.ps1 b/dump/WSUS_Scripts/Old-Scripts/new-Reboot-WSUSGroup.ps1 deleted file mode 100644 index 3efdd2f..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/new-Reboot-WSUSGroup.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -$Dte = Get-Date -UFormat %m-%d-%Y - -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -$servers | Out-File $Location\Patching-Day\"$WSUSGroup"-Servers-Rebooting-$Dte.txt -ErrorAction SilentlyContinue -$servers | Out-File E:\WSUS_Scripts\Patching-Day\"$WSUSGroup"-Servers-Rebooting-Backup-$Dte.txt -ErrorAction SilentlyContinue - -$Patch_Job | Export-Csv $Location\Patching-Day\Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -Get-Job | Export-Csv $Location\Patching-Day\Patching-Get-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Get-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\Patching-Collect-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\Patching-Collect-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation - -Foreach ($server in $servers) { - - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Remote" -ComputerName $server -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Remote" -ComputerName $server -ErrorAction SilentlyContinue - - Invoke-Command $server -ErrorAction SilentlyContinue { - #New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Finished" -ErrorAction SilentlyContinue - #New-EventLog -LogName System -Source "Powershell-Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Invoke" -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Invoke" -ErrorAction SilentlyContinue - }#endInvoke - Restart-Computer -ComputerName $server -Force -Verbose - -}#endForeach \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/old-Patch-WSUSGroup.ps1 b/dump/WSUS_Scripts/Old-Scripts/old-Patch-WSUSGroup.ps1 deleted file mode 100644 index ba10956..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/old-Patch-WSUSGroup.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" \ No newline at end of file diff --git a/dump/WSUS_Scripts/Old-Scripts/old-Reboot-WSUSGroup.ps1 b/dump/WSUS_Scripts/Old-Scripts/old-Reboot-WSUSGroup.ps1 deleted file mode 100644 index a4c54d5..0000000 --- a/dump/WSUS_Scripts/Old-Scripts/old-Reboot-WSUSGroup.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force} \ No newline at end of file diff --git a/dump/WSUS_Scripts/PSUS_ConnectivityTests.ps1 b/dump/WSUS_Scripts/PSUS_ConnectivityTests.ps1 deleted file mode 100644 index 765955c..0000000 --- a/dump/WSUS_Scripts/PSUS_ConnectivityTests.ps1 +++ /dev/null @@ -1,141 +0,0 @@ -$ServerList1 = Get-ADComputer -Filter {(Enabled -eq $true)} -SearchBase "OU=Servers,OU=NCRA,DC=ccx,DC=carecentrix,DC=com" | Select-Object DNSHostName -$ServerList2 = Get-ADComputer -Filter {(Enabled -eq $true)} -SearchBase "OU=Servers,OU=FLT2,DC=ccx,DC=carecentrix,DC=com" | Select-Object DNSHostName -$ServerList3 = Get-ADComputer -Filter {(Enabled -eq $true)} -SearchBase "OU=Servers,OU=AZPH,DC=ccx,DC=carecentrix,DC=com" | Select-Object DNSHostName -$ServerList4 = Get-ADComputer -Filter {(Enabled -eq $true)} -SearchBase "OU=Servers,OU=CLVA1,DC=ccx,DC=carecentrix,DC=com" | Select-Object DNSHostName -$ServerList5 = Get-ADComputer -Filter {(Enabled -eq $true)} -SearchBase "OU=Servers,OU=CTHA,DC=ccx,DC=carecentrix,DC=com" | Select-Object DNSHostName -$ServerList6 = Get-ADComputer -Filter {(Enabled -eq $true)} -SearchBase "OU=Servers,OU=KSOP,DC=ccx,DC=carecentrix,DC=com" | Select-Object DNSHostName -$ServerList = $ServerList1+$ServerList2+$ServerList3+$ServerList4+$ServerList5+$ServerList6 - -$ServerReport = @() - -$port1 = "8530" -$port2 = "8531" -$wsusserver = "psus002.ccx.carecentrix.com" - - - -foreach ($Server in $ServerList) { -$ServerName = $Server.DNSHostName - -$pssession = New-PSSession -ComputerName $ServerName -ErrorAction SilentlyContinue -$CurrentServer = New-Object System.Object -$CurrentServer | Add-Member -MemberType NoteProperty -Name "Name" -Value $ServerName -#Enter-PSSession $pssession - -if ($null -ne $pssession){ - write-host "Connected to $ServerName" - $CurrentServer | Add-Member -MemberType NoteProperty -Name "Status" -Value "Accessible" - $CurrentServer.Name = $ServerName - - - #Check HTTP Port - #Clear Port Variables - $port8530= @() - $port8531= @() - $port8530 = Invoke-Command -Session $pssession -ScriptBlock {invoke-webrequest http://psus002.ccx.carecentrix.com:8530/CLientWebService/Client.asmx -UseBasicParsing} -ErrorAction SilentlyContinue - if ($port8530.StatusCode -eq "200"){ - Write-host "Port 8530 Accessible" - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8530" -Value "Open" - } - - elseif ($null -eq $port8530) { - $TestNetConnection = New-Object Net.Sockets.TcpClient - $testnetconnection.connect($wsusserver,$port1) - - if ($testnetconnection.Connected){ - $TestNetConnection.Close() - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8530" -Value "Open" - } - else { - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8530" -Value "Unable to Verify" - Write-host "Invoke Webrequest not recognized" - } - } - - else { - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8530" -Value "Closed" - Write-host "Port 8531 Inaccessible" - - } - # Check HTTPS Port - $port8531 = Invoke-Command -Session $pssession -ScriptBlock {invoke-webrequest https://psus002.ccx.carecentrix.com:8531/CLientWebService/Client.asmx -UseBasicParsing} -ErrorAction SilentlyContinue - - - if ($port8531.StatusCode -eq "200"){ - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8531" -Value "Open" - Write-host "Port 8531 Accessible" - } - - elseif ($null -eq $port8531) { - $TestNetConnection = New-Object Net.Sockets.TcpClient - $testnetconnection.connect($wsusserver,$port2) - - if ($testnetconnection.Connected){ - $TestNetConnection.Close() - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8531" -Value "Open" - } - else{ - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8531" -Value "Unable to Verify" - Write-host "Invoke Webrequest not recognized" - } - } - - else { - $CurrentServer | Add-Member -MemberType NoteProperty -Name "8531" -Value "Blocked" - Write-host "Port 8531 Inaccessible" - } - - #Check C: Drive Space - $DriveCheck =Invoke-Command -Session $pssession -ScriptBlock {get-WmiObject win32_logicaldisk -Filter "DeviceID='C:'"} - $HDFreespace = [Math]::Round($DriveCheck.Freespace / 1GB) - $HDSize =[Math]::Round($DriveCheck.Size / 1GB) - $CurrentServer | Add-Member -MemberType NoteProperty -Name "C: Size" -Value $HDSize - $CurrentServer | Add-Member -MemberType NoteProperty -Name "C: Freespace" -Value $HDFreespace - if ($HDFreespace -lt 5) { - $CurrentServer | Add-Member -MemberType NoteProperty -Name "SpaceCheck" -Value "Consider adding Space to C:" - Write-host "C: Drive does not have enough space" - } - else { - $CurrentServer | Add-Member -MemberType NoteProperty -Name "SpaceCheck" -Value "Server has sufficient space for Windows Updates" - Write-host "C: has plenty of space" - } - - $DriveCheck = @() - - #Windows Update Details - $failedupdates = Invoke-Command -Session $pssession -ScriptBlock { - $Session = New-Object -ComObject "Microsoft.Update.Session" - - $Searcher = $Session.CreateUpdateSearcher() - - $historyCount = $Searcher.GetTotalHistoryCount() - - $Searcher.QueryHistory(0, $historyCount) | Select-Object @{Name="Computer"; Expression={$Computer}}, Date, - - @{name="Operation"; expression={switch($_.operation){ - - 1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}}, - - @{name="Status"; expression={switch($_.resultcode){ - - 1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"}; - - 4 {"Failed"}; 5 {"Aborted"} - - }}},Title| Where-Object {$_.Status -eq "Failed"} -} -$failedupdates |Export-Csv -NoType "E:\Windows Update Failures\UpdateAudit-$ServerName-Failed-WindowsUpdates.csv" - # Exit-PSSession - $ServerReport += $CurrentServer - Get-PSSession | Remove-PSSession - #Copy-Item -Path \\$ServerName\Users\abamaso-ccxadmin\Desktop\UpdateAudit-$ServerName-Failed-WindowsUpdates.csv -Destination 'C:\Users\abamaso-ccxadmin\Desktop\WIndows Update Failures' -} -#outSide PSSession if -else { - $CurrentServer | Add-Member -MemberType NoteProperty -Name "Status" -Value "Inaccessible" - Write-host "$ServerName Inaccessible" - $ServerReport += $CurrentServer -} -} -#outside for each -$ServerReport | Export-Csv "E:\Windows Update Failures\ServerReport.csv" \ No newline at end of file diff --git a/dump/WSUS_Scripts/Patching-Day/Get-WSUSGroupPatchInProgress2.ps1 b/dump/WSUS_Scripts/Patching-Day/Get-WSUSGroupPatchInProgress2.ps1 deleted file mode 100644 index b602935..0000000 --- a/dump/WSUS_Scripts/Patching-Day/Get-WSUSGroupPatchInProgress2.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$WSUSGroup = Read-Host "Enter Target Group Name" -$Computers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname - -foreach ($computer in $computers){ -if(!(Test-Connection -Cn $computer -BufferSize 16 -Count 1 -ea 0 -quiet)) -{write-host "cannot reach $computer" -f red} - -else {$Session = New-Object -ComObject "Microsoft.Update.Session" - -$Searcher = $Session.CreateUpdateSearcher() - -$historyCount = $Searcher.GetTotalHistoryCount() - -$Searcher.QueryHistory(0, $historyCount) | Select-Object @{Name="Computer"; Expression={$Computer}}, Date, - - @{name="Operation"; expression={switch($_.operation){ - - 1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}}, - - @{name="Status"; expression={switch($_.resultcode){ - - 1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"}; - - 4 {"Failed"}; 5 {"Aborted"} - -}}},Title| Where {$_.Status -eq "In Progress"}|Write-Host}} \ No newline at end of file diff --git a/dump/WSUS_Scripts/Patching-Day/Patching Groups Host UI.txt b/dump/WSUS_Scripts/Patching-Day/Patching Groups Host UI.txt deleted file mode 100644 index d1a8139..0000000 --- a/dump/WSUS_Scripts/Patching-Day/Patching Groups Host UI.txt +++ /dev/null @@ -1,27 +0,0 @@ -PROD: - -NCRA -$Host.UI.RawUI.WindowTitle = "NCRA - AD - Servers" -$Host.UI.RawUI.WindowTitle = "NCRA - Application - Prod" -$Host.UI.RawUI.WindowTitle = "NCRA - BizTalk - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Edifecs - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Exchange - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - File Servers - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Mail Terminal Servers - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Remote Desktop - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - SQL - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Terminal Servers - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Verint - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Vistar Terminal Servers - PROD" -$Host.UI.RawUI.WindowTitle = "NCRA - Web - PROD" - -OTHERS: -$Host.UI.RawUI.WindowTitle = "CTHA - Production Servers" -$Host.UI.RawUI.WindowTitle = "FLT2 - Application - PROD" - -MANUAL: -$Host.UI.RawUI.WindowTitle = "CyberArc - PROD" -$Host.UI.RawUI.WindowTitle = "Exchange - PROD" -$Host.UI.RawUI.WindowTitle = "Infrastructure Weekend" -$Host.UI.RawUI.WindowTitle = "Last AD Controller" -$Host.UI.RawUI.WindowTitle = "Tidal - PROD" diff --git a/dump/WSUS_Scripts/Patching-Day/temp.txt b/dump/WSUS_Scripts/Patching-Day/temp.txt deleted file mode 100644 index 70ec74a..0000000 --- a/dump/WSUS_Scripts/Patching-Day/temp.txt +++ /dev/null @@ -1,27 +0,0 @@ -psrs001 -psql007 -psis002 -pcpr001 -psql015 -psrs003 - -prsh182-failed connect -prsh028-failed connect -prsh175 -pedi116 -prsh029-failed connect -pvrt003 -prsh014-failed connect -prsh018-failed connect -prsh002-failed connect - -pedi114-failed connect -pedi111-failed connect -pedi115-failed connect -pspt001 -pbiz122 -pbiz124 -pbiz125 -pbiz126 -pbiz123 -pbiz121 \ No newline at end of file diff --git a/dump/WSUS_Scripts/ReRun-Quick.ps1 b/dump/WSUS_Scripts/ReRun-Quick.ps1 deleted file mode 100644 index 08f027f..0000000 --- a/dump/WSUS_Scripts/ReRun-Quick.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -$servers = Import-Csv "E:\WSUS_Scripts\Patching-Day\December-2019\Tier0-December-Patching\ReRun\.csv" | select name -Get-Job | Remove-Job -$S2 = @() -$T = @() -$servers | % { $T += $_.Name.Split('#')[1] } -$P_Job_Failed_Servers = @() - -Foreach ($S in $T) { - #$S = $T.name - $P_Job_Failed_Servers += Start-Job -ScriptBlock { Param($S) WindowsUpdate\Install-WindowsUpdate -ComputerName $S } -Name "$WSUSGroup-#$S#-Patching" -ArgumentList $S - -}#endForeach - -$P_Job_Failed_Servers | ft -AutoSize - - -<# - - -$Failed_J = Get-Job | ? { $_.State -eq "Failed" } | Select Name -$Failed_J | % { $S2 += $_.Name.Split('#')[1] } - - -#> - - - - diff --git a/dump/WSUS_Scripts/Reboot-QATidal.ps1 b/dump/WSUS_Scripts/Reboot-QATidal.ps1 deleted file mode 100644 index 16bfbfd..0000000 --- a/dump/WSUS_Scripts/Reboot-QATidal.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -Restart-Computer -ComputerName qsch013.ccx.carecentrix.com -Force -Write-Host "qsch013.ccx.carecentrix.com restart initiated" -Start-Sleep -Seconds 180 -$ServerStatusCheck = Test-NetConnection -ComputerName qsch013.ccx.carecentrix.com -$ServerStatusOnline = $ServerStatusCheck.PingSucceeded -if ($ServerStatusOnline -eq $true) { -Write-Host "qsch013 is Online" -} -else { -Write-Host "qsch013 is not online" -} - -Restart-Computer -ComputerName qsch014.ccx.carecentrix.com -Force -Write-Host "qsch014.ccx.carecentrix.com restart initiated" -Start-Sleep -Seconds 180 -$ServerStatusCheck = Test-NetConnection -ComputerName qsch014.ccx.carecentrix.com -$ServerStatusOnline = $ServerStatusCheck.PingSucceeded -if ($ServerStatusOnline -eq $true) { -Write-Host "qsch014 is Online" -} -else { -Write-Host "qsch014 is not online" -} -Restart-Computer -ComputerName qsch011.ccx.carecentrix.com -Force -Write-Host "qsch011.ccx.carecentrix.com restart initiated" -Start-Sleep -Seconds 180 -$ServerStatusCheck = Test-NetConnection -ComputerName qsch011.ccx.carecentrix.com -$ServerStatusOnline = $ServerStatusCheck.PingSucceeded -if ($ServerStatusOnline -eq $true) { -Write-Host "qsch011 is Online" -} -else { -Write-Host "qsch011 is not online" -} -Restart-Computer -ComputerName qsch012.ccx.carecentrix.com -Force -Write-Host "qsch012.ccx.carecentrix.com restart initiated" -Start-Sleep -Seconds 180 -$ServerStatusCheck = Test-NetConnection -ComputerName qsch012.ccx.carecentrix.com -$ServerStatusOnline = $ServerStatusCheck.PingSucceeded -if ($ServerStatusOnline -eq $true) { -Write-Host "qsch012 is Online" -} -else { -Write-Host "qsch012 is not online" -} \ No newline at end of file diff --git a/dump/WSUS_Scripts/Reboot-Tidal.ps1 b/dump/WSUS_Scripts/Reboot-Tidal.ps1 deleted file mode 100644 index f2b69e2..0000000 --- a/dump/WSUS_Scripts/Reboot-Tidal.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -$ErrorActionPreference = "Ignore" -Restart-Computer -ComputerName psch013.ccx.carecentrix.com -Force -Start-Sleep -Seconds 600 -Restart-Computer -ComputerName psch014.ccx.carecentrix.com -Force -Start-Sleep -Seconds 600 -Restart-Computer -ComputerName psch011.ccx.carecentrix.com -Force -Start-Sleep -Seconds 600 -Restart-Computer -ComputerName psch012.ccx.carecentrix.com -Force \ No newline at end of file diff --git a/dump/WSUS_Scripts/Reset-WindowsUpdateAgent.ps1 b/dump/WSUS_Scripts/Reset-WindowsUpdateAgent.ps1 deleted file mode 100644 index 3b065a8..0000000 --- a/dump/WSUS_Scripts/Reset-WindowsUpdateAgent.ps1 +++ /dev/null @@ -1,120 +0,0 @@ -<# -.SYNOPSIS -Reset-WindowsUpdate.ps1 - Resets the Windows Update components - -.DESCRIPTION -This script will reset all of the Windows Updates components to DEFAULT SETTINGS. - -.OUTPUTS -Results are printed to the console. Future releases will support outputting to a log file. - -.NOTES -Written by: Ryan Nemeth - -Find me on: - -* My Blog: http://www.geekyryan.com -* Twitter: https://twitter.com/geeky_ryan -* LinkedIn: https://www.linkedin.com/in/ryan-nemeth-b0b1504b/ -* Github: https://github.com/rnemeth90 -* TechNet: https://social.technet.microsoft.com/profile/ryan%20nemeth/ - -Change Log -V1.00, 05/21/2015 - Initial version -V1.10, 09/22/2016 - Fixed bug with call to sc.exe -V1.20, 11/13/2017 - Fixed environment variables -#> - - -$arch = Get-WMIObject -Class Win32_Processor -ComputerName LocalHost | Select-Object AddressWidth - -Write-Host "1. Stopping Windows Update Services..." -Stop-Service -Name BITS -Stop-Service -Name wuauserv -Stop-Service -Name appidsvc -Stop-Service -Name cryptsvc - -Write-Host "2. Remove QMGR Data file..." -Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue - -Write-Host "3. Renaming the Software Distribution and CatRoot Folder..." -Rename-Item $env:systemroot\SoftwareDistribution SoftwareDistribution.bak -ErrorAction SilentlyContinue -Rename-Item $env:systemroot\System32\Catroot2 catroot2.bak -ErrorAction SilentlyContinue - -Write-Host "4. Removing old Windows Update log..." -Remove-Item $env:systemroot\WindowsUpdate.log -ErrorAction SilentlyContinue - -Write-Host "5. Resetting the Windows Update Services to defualt settings..." -"sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)" -"sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)" - -Set-Location $env:systemroot\system32 - -Write-Host "6. Registering some DLLs..." -regsvr32.exe /s atl.dll -regsvr32.exe /s urlmon.dll -regsvr32.exe /s mshtml.dll -regsvr32.exe /s shdocvw.dll -regsvr32.exe /s browseui.dll -regsvr32.exe /s jscript.dll -regsvr32.exe /s vbscript.dll -regsvr32.exe /s scrrun.dll -regsvr32.exe /s msxml.dll -regsvr32.exe /s msxml3.dll -regsvr32.exe /s msxml6.dll -regsvr32.exe /s actxprxy.dll -regsvr32.exe /s softpub.dll -regsvr32.exe /s wintrust.dll -regsvr32.exe /s dssenh.dll -regsvr32.exe /s rsaenh.dll -regsvr32.exe /s gpkcsp.dll -regsvr32.exe /s sccbase.dll -regsvr32.exe /s slbcsp.dll -regsvr32.exe /s cryptdlg.dll -regsvr32.exe /s oleaut32.dll -regsvr32.exe /s ole32.dll -regsvr32.exe /s shell32.dll -regsvr32.exe /s initpki.dll -regsvr32.exe /s wuapi.dll -regsvr32.exe /s wuaueng.dll -regsvr32.exe /s wuaueng1.dll -regsvr32.exe /s wucltui.dll -regsvr32.exe /s wups.dll -regsvr32.exe /s wups2.dll -regsvr32.exe /s wuweb.dll -regsvr32.exe /s qmgr.dll -regsvr32.exe /s qmgrprxy.dll -regsvr32.exe /s wucltux.dll -regsvr32.exe /s muweb.dll -regsvr32.exe /s wuwebv.dll - -Write-Host "7) Removing WSUS client settings..." -REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f -REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f -REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f - -Write-Host "8) Resetting the WinSock..." -netsh winsock reset -netsh winhttp reset proxy - -Write-Host "9) Delete all BITS jobs..." -Get-BitsTransfer | Remove-BitsTransfer - -Write-Host "10) Attempting to install the Windows Update Agent..." -if($arch -eq 64){ - wusa Windows8-RT-KB2937636-x64 /quiet -} -else{ - wusa Windows8-RT-KB2937636-x86 /quiet -} - -Write-Host "11) Starting Windows Update Services..." -Start-Service -Name BITS -Start-Service -Name wuauserv -Start-Service -Name appidsvc -Start-Service -Name cryptsvc - -Write-Host "12) Forcing discovery..." -wuauclt /resetauthorization /detectnow - -Write-Host "Process complete. Please reboot your computer." \ No newline at end of file diff --git a/dump/WSUS_Scripts/new-Get-EventLogs.ps1 b/dump/WSUS_Scripts/new-Get-EventLogs.ps1 deleted file mode 100644 index 5888825..0000000 --- a/dump/WSUS_Scripts/new-Get-EventLogs.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -[DateTime]$Check_Date = "10/1/2019" -$Event_ID = "7890","7891" -"w2012a","w2012b" | % { - $Comp_Name = $_ - Write-Host "Checking Server: $_" - $Event_ID | % { - $E_ID = $_ - Write-Host "Checking EventID: $_" - Get-EventLog -LogName Application -ComputerName $Comp_Name | ? { $_.EventID -eq $E_ID -and $_.TimeGenerated -like "*$Check_Date*" } | select MachineName,EventID,EntryType,Source,Message,TimeGenerated,TimeWritten - }#end% - - }#end% \ No newline at end of file diff --git a/dump/WSUS_Scripts/new-Patch-WSUSGroup-4.ps1 b/dump/WSUS_Scripts/new-Patch-WSUSGroup-4.ps1 deleted file mode 100644 index b3f43ae..0000000 --- a/dump/WSUS_Scripts/new-Patch-WSUSGroup-4.ps1 +++ /dev/null @@ -1,110 +0,0 @@ -<# - -$ErrorActionPreference = "Ignore" -$WSUSGroup = Read-Host "Enter Target Group Name" -$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob} - -#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below. -#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}} - -#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group" -Read-Host -Prompt "Press Enter to exit" -#> - -################################################################################################################################# -#$ErrorActionPreference = "Ignore" - -#$servers = "W2012A","W2012B","slfkjsdl" -#$WSUSGroup = "Test GGroupppppp" -################################################################################################################################# -If(Test-Path E:\WSUS_Scripts\Lock_Script.txt) { - Write-Host "The Script is locked for protection. If you are not running it by mistake - Delete the file (E:\WSUS_Scripts\Lock_Script.txt) and run the Script again" -ForegroundColor Yellow - Break -} -Else { New-Item -Path E:\WSUS_Scripts -Name Lock_Script.txt -ItemType File } -################################################################################################################################# - -Get-Job | Remove-Job - -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -############################################################ -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -$Current_Month = (Get-Date -UFormat %B) - -############################################################ -$Dte = Get-Date -UFormat %m-%d-%Y -$Collect_Jobs = @() -$Patch_Job = @() -$Failed_Jobs = @() -$Receive_Jobs = @() - -If(!(Test-Path E:\WSUS_Scripts\Patching-Day\$WSUSGroup-$Current_Month-Patching)) { New-Item -Path "E:\WSUS_Scripts\Patching-Day" -ItemType Directory -Name $WSUSGroup-$Current_Month-Patching } - -$servers = "" -$WSUSGroup = Read-Host "Enter Target Group Name" - -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select -ExpandProperty Fulldomainname -$Group_Folder = "$WSUSGroup-$Current_Month-Patching" - -#$Servers_Reboot_Only = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\CCXQ1-November-Prep-Files\Manual-$WSUSGroup-OperatingSystems-$Current_Month.csv -$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Target-Group-Computers-$Current_Month.csv | select -ExpandProperty FullDomainName - -$servers = $servers | ? { $_ -notin $Servers_Reboot_Only.FullDomainName } - -#$Failed_Ping_Test = gc $Location\Files\$WSUSGroup-Ping-Failed-$Current_Month.txt -#$servers = $servers | ? { $_ -notin $Failed_Ping_Test } - -$servers | Out-File $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Today-$Dte.txt -$servers | Out-File E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Today-Backup-$Dte.txt - -Foreach ($server in $servers) { - - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -ComputerName $server -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -ComputerName $server -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Remote" -ComputerName $server -ErrorAction SilentlyContinue -verbose - - $Patch_Job += Start-Job -ScriptBlock { Param($server) WindowsUpdate\Install-WindowsUpdate -ComputerName $server } -Name "$WSUSGroup-#$server#-Patching" -ArgumentList $server - - Invoke-Command $server -ErrorAction SilentlyContinue { - New-EventLog -LogName Application -Source "Patching-Started" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName Application -Source "Patching-Finished" -ErrorAction SilentlyContinue -verbose - New-EventLog -LogName System -Source "Reboot-After-Patching" -ErrorAction SilentlyContinue -verbose - Write-EventLog -LogName Application -Source "Patching-Started" -EntryType Information -EventId 7890 -Message "Server Patching Started with Powershell - Invoke" -verbose - }#endInvoke - -}#endForeach - -#Get-Job - -$Patch_Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte.csv -NoTypeInformation -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Collect-Patching-Jobs-$Dte.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Collect-Patching-Jobs-Backup-$Dte.csv -NoTypeInformation - -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Jobs-ChildJobs-$Dte.csv -NoTypeInformation -$Patch_Job | Select @{n="Server";e={$_.Name.Split('-')[0]}},@{n="MainJobID";e={$_.ID}},@{n="MainJobName";e={$_.Name}},@{n="ChildJobID";e={$_.Childjobs.ID}},@{n="ChildJobState";e={$_.Childjobs.State}},PSBeginTime,PSEndTime,Command | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Jobs-ChildJobs-Backup-$Dte.csv -NoTypeInformation - - -<# - -$Failed_Jobs += $Patch_Job | ? { $_.State -eq "Failed" } - -$Failed_Jobs | ft -autosize - -$Failed_Jobs | Export-Csv "E:\WSUS_Scripts\Patching-Day\NCRA - Quality Assurance Servers-November-Patching\failed-jobs.csv" -NoTypeInformation - -#> - - -### Running Count -## ( $Patch_Job | ? { $_.State -eq "Running" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Completed" } ).count - -## ( $Patch_Job | ? { $_.State -eq "Failed" } ).count - - - \ No newline at end of file diff --git a/dump/WSUS_Scripts/new-Reboot-WSUSGroup-3.ps1 b/dump/WSUS_Scripts/new-Reboot-WSUSGroup-3.ps1 deleted file mode 100644 index 6b29cc6..0000000 --- a/dump/WSUS_Scripts/new-Reboot-WSUSGroup-3.ps1 +++ /dev/null @@ -1,67 +0,0 @@ - -$Location = Split-Path $MyInvocation.MyCommand.Path -Parent -################################################################################################################################# -$Dte = Get-Date -UFormat %m-%d-%Y -$Current_Month = (Get-Date -UFormat %B) -#$WSUSGroup = gc H:\Scripts\Patching\_Group-Config-File\Config-WSUS-Group.txt -#$Group_Folder = "$WSUSGroup-$Current_Month-Patching" -#$Group = "NCRA - Development Servers" -################################################################################################################################# -$servers = "" -$WSUSGroup = Read-Host "Enter Target Group Name" -#$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname -$Group_Folder = "$WSUSGroup-$Current_Month-Patching" - -#$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\December-2019\$Group_Folder\CCXQ1-November-Prep-Files\$WSUSGroup-Target-Group-Computers-$Current_Month.csv | select -ExpandProperty FullDomainName -$servers = Import-Csv E:\WSUS_Scripts\Patching-Day\December-2019\$WSUSGroup.csv | select -ExpandProperty FullDomainName - - -$servers | Out-File $Location\Patching-Day\$Group_Folder\$WSUSGroup-Servers-Rebooting-$Dte.txt -ErrorAction SilentlyContinue -$servers | Out-File E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Servers-Rebooting-Backup-$Dte.txt -ErrorAction SilentlyContinue - -#$servers = $servers | ? { $_ -ne "qadf001.ccx.carecentrix.com"} - -$Patch_Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -$Patch_Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Get-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -ErrorAction SilentlyContinue -Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Get-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation -ErrorAction SilentlyContinue - -$Collect_Jobs = Get-Job | Export-Csv $Location\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Collect-Patching-Jobs-$Dte-Before-Reboot.csv -NoTypeInformation -$Collect_Jobs = Get-Job | Export-Csv E:\WSUS_Scripts\Patching-Day\$Group_Folder\$WSUSGroup-Patching-Collect-Patching-Jobs-$Dte-Before-Reboot-Backup.csv -NoTypeInformation - -Foreach ($server in $servers) { - - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Remote" -ComputerName $server -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Remote" -ComputerName $server -ErrorAction SilentlyContinue - - Invoke-Command $server -ErrorAction SilentlyContinue { - #New-EventLog -LogName Application -Source "Powershell-WSUS-Patching-Finished" -ErrorAction SilentlyContinue - #New-EventLog -LogName System -Source "Powershell-Reboot-After-Patching" -ErrorAction SilentlyContinue - Write-EventLog -LogName Application -Source "Patching-Finished" -EntryType Information -EventId 7891 -Message "Powershell-WSUS-Patching-Finished - Invoke" -ErrorAction SilentlyContinue - Write-EventLog -LogName System -Source "Reboot-After-Patching" -EntryType Information -EventId 7892 -Message "Server Rebooting After Patching - Invoke" -ErrorAction SilentlyContinue - }#endInvoke - Restart-Computer -ComputerName $server -Force -Verbose - -}#endForeach - - - -<# - -$servers | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue - If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red } - } - - -#> - -# $Servers | % { Get-EventLog -LogName System -ComputerName $_.computer | ? { $_.EventID -eq '7893' } } - - -# $Servers | % { gwmi win32_operatingsystem -ComputerName $_ | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} - - - - - diff --git a/dump/WmiExplorer_2.0.0.2/WmiExplorer.exe b/dump/WmiExplorer_2.0.0.2/WmiExplorer.exe deleted file mode 100644 index 91d958d..0000000 Binary files a/dump/WmiExplorer_2.0.0.2/WmiExplorer.exe and /dev/null differ diff --git a/dump/_11PM-Production-Patching-File-Servers.txt b/dump/_11PM-Production-Patching-File-Servers.txt deleted file mode 100644 index ed56ed6..0000000 Binary files a/dump/_11PM-Production-Patching-File-Servers.txt and /dev/null differ diff --git a/dump/_9PM-Production-Patching.txt b/dump/_9PM-Production-Patching.txt deleted file mode 100644 index 05c4666..0000000 Binary files a/dump/_9PM-Production-Patching.txt and /dev/null differ diff --git a/dump/_Get-SCCMSoftwareUpdateStatus.ps1 b/dump/_Get-SCCMSoftwareUpdateStatus.ps1 deleted file mode 100644 index eed9825..0000000 --- a/dump/_Get-SCCMSoftwareUpdateStatus.ps1 +++ /dev/null @@ -1,145 +0,0 @@ -function Get-SCCMSoftwareUpdateStatus { -<# -.Synopsis - This will output the device status for the Software Update Deployments within SCCM. - For updated help and examples refer to -Online version. - - -.DESCRIPTION - This will output the device status for the Software Update Deployments within SCCM. - For updated help and examples refer to -Online version. - - -.NOTES - Name: Get-SCCMSoftwareUpdateStatus - Author: The Sysadmin Channel - Version: 1.0 - DateCreated: 2018-Nov-10 - DateUpdated: 2018-Nov-10 - -.LINK - https://thesysadminchannel.com/get-sccm-software-update-status-powershell - - - -.EXAMPLE - For updated help and examples refer to -Online version. - -#> - - [CmdletBinding()] - - param( - [Parameter()] - [switch] $DeploymentIDFromGUI, - - [Parameter(Mandatory = $false)] - [Alias('ID', 'AssignmentID')] - [string] $DeploymentID, - - [Parameter(Mandatory = $false)] - [ValidateSet('Success', 'InProgress', 'Error', 'Unknown')] - [Alias('Filter')] - [string] $Status - - - ) - - BEGIN { - $Site_Code = 'CCX' - $Site_Server = 'PNCRASCCM001' - $HasErrors = $False - - if ($Status -eq 'Success') { - $StatusType = 1 - } - - if ($Status -eq 'InProgress') { - $StatusType = 2 - } - - if ($Status -eq 'Unknown') { - $StatusType = 4 - } - - if ($Status -eq 'Error') { - $StatusType = 5 - } - - } - - PROCESS { - try { - if ($DeploymentID -and $DeploymentIDFromGUI) { - Write-Error "Select the DeploymentIDFromGUI or DeploymentID Parameter. Not Both" - $HasErrors = $True - throw - } - - if ($DeploymentIDFromGUI) { - $ShellLocation = Get-Location - Import-Module (Join-Path $(Split-Path $env:SMS_ADMIN_UI_PATH) ConfigurationManager.psd1) - - #Checking to see if module has been imported. If not abort. - if (Get-Module ConfigurationManager) { - Set-Location "$($Site_Code):\" - $DeploymentID = Get-CMSoftwareUpdateDeployment | select AssignmentID, AssignmentName | Out-GridView -OutputMode Single -Title "Select a Deployment and Click OK" | Select -ExpandProperty AssignmentID - Set-Location $ShellLocation - } else { - Write-Error "The SCCM Module wasn't imported successfully. Aborting." - $HasErrors = $True - throw - } - } - - if ($DeploymentID) { - $DeploymentNameWithID = Get-WMIObject -ComputerName $Site_Server -Namespace root\sms\site_$Site_Code -class SMS_SUMDeploymentAssetDetails -Filter "AssignmentID = $DeploymentID" | select AssignmentID, AssignmentName - $DeploymentName = $DeploymentNameWithID.AssignmentName | select -Unique - } else { - Write-Error "A Deployment ID was not specified. Aborting." - $HasErrors = $True - throw - } - - if ($Status) { - $Output = Get-WMIObject -ComputerName $Site_Server -Namespace root\sms\site_$Site_Code -class SMS_SUMDeploymentAssetDetails -Filter "AssignmentID = $DeploymentID and StatusType = $StatusType" | ` - select DeviceName, CollectionName, @{Name = 'StatusTime'; Expression = {$_.ConvertToDateTime($_.StatusTime) }}, @{Name = 'Status' ; Expression = {if ($_.StatusType -eq 1) {'Success'} elseif ($_.StatusType -eq 2) {'InProgress'} elseif ($_.StatusType -eq 5) {'Error'} elseif ($_.StatusType -eq 4) {'Unknown'} }} - - } else { - $Output = Get-WMIObject -ComputerName $Site_Server -Namespace root\sms\site_$Site_Code -class SMS_SUMDeploymentAssetDetails -Filter "AssignmentID = $DeploymentID" | ` - select DeviceName, CollectionName, @{Name = 'StatusTime'; Expression = {$_.ConvertToDateTime($_.StatusTime) }}, @{Name = 'Status' ; Expression = {if ($_.StatusType -eq 1) {'Success'} elseif ($_.StatusType -eq 2) {'InProgress'} elseif ($_.StatusType -eq 5) {'Error'} elseif ($_.StatusType -eq 4) {'Unknown'} }} - } - - if (-not $Output) { - Write-Error "A Deployment with ID: $($DeploymentID) is not valid. Aborting" - $HasErrors = $True - throw - - } - - } catch { - - - } finally { - if (($HasErrors -eq $false) -and ($Output)) { - Write-Output "" - Write-Output "Deployment Name: $DeploymentName" - Write-Output "Deployment ID: $DeploymentID" - Write-Output "" - Write-Output $Output | Sort-Object Status - } - } - } - - END {} - -} - - - - - -# $T = Get-SCCMSoftwareUpdateStatus -DeploymentID 16777850 - -# Get-SCCMSoftwareUpdateStatus -DeploymentIDFromGUI | ? { $_.Assignmentname -like "dsfsdfsd" } - -# Get-SCCMSoftwareUpdateStatus -DeploymentIDFromGUI diff --git a/dump/_Post-Patching-Steps.txt b/dump/_Post-Patching-Steps.txt deleted file mode 100644 index 8517fac..0000000 --- a/dump/_Post-Patching-Steps.txt +++ /dev/null @@ -1,11 +0,0 @@ -One Note - Search Sop - -1. Log on to PAPP001 with Tidal/T1d@l$ Account and run locally as Administrator : \\PAPP001\Apps\CTP PDF Creator\ctppdfprocess.bat -batch file from PAPP001 locally if run remotely it will fail to create the log file they are looking for - - --- Open the following shortcut on PCCR001 desktop \\sharepoint@ssl\sites\rcm\cignaredirect. Close the window and close the session. - - -2. Login to PSRS004 as tidal/T1d@l$ user and close the session. - -3. Login to PWHD003, stop Webhelpdesk, then start webhelpdesk from start menu \ No newline at end of file diff --git a/dump/temp-tool1.ps1 b/dump/temp-tool1.ps1 deleted file mode 100644 index 9eab0bf..0000000 --- a/dump/temp-tool1.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -<# - -$Count = 0 -$W = $ServerName | % { $S = $_ - Write-host "Checking Server: $S" - $Count++ ;gci \\$S\c$\windows\ccmcache -ErrorAction SilentlyContinue | ? { $_.LastWriteTime -gt ((Get-Date).AddDays(-4))} | select -First 1 | select @{n="Num";e={$Count}},@{n="Server";e={$S}},Lastwritetime,Name } - - -$W | sort LastWritetime -Descending - -write-host "Collection Name: $DeviceCollection_Name" -ForegroundColor Yellow - - -#> - -<###################################################################### - -$Responding = @() -$NotResponding = @() - -$DeviceCollection_ServerNames.Name | % { - - If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) { - Write-Host "Responding:---- $_ " -ForegroundColor Green - $Responding += $_ - - }#endIf - - Else { $NotResponding += $_ } - -}#end% - write-host "-------------------------------------------------------" - Write-host "$($Responding.count) / $($DeviceCollection_ServerNames.Name.count) -- Responding" -foregroundcolor Green - Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames.Name.count) -- NOT Responding" -foregroundcolor Red - - -Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red - - - - -$Responding | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | ft -autosize - - - -#> diff --git a/dump/temp/collection-membership.ps1 b/dump/temp/collection-membership.ps1 deleted file mode 100644 index 203cbbe..0000000 --- a/dump/temp/collection-membership.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -$Dev = "w2012a","w2012b" -$Temp = @() -$Dev | % { $S = $_ - $W = (Get-WmiObject -ComputerName pncrasccm001 -Namespace root\SMS\site_ccx -Query "SELECT SMS_Collection.* FROM SMS_FullCollectionMembership, SMS_Collection where name = '$S' and SMS_FullCollectionMembership.CollectionID = SMS_Collection.CollectionID").name - - $W | % { - $Obj = New-Object -TypeName PSObject - $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $S - $Obj | Add-Member -MemberType NoteProperty -Name Collection -Value $_ - $Obj - $Temp += $Obj - } - -}#end% - - - - - - #$Collections | select name \ No newline at end of file diff --git a/Install-Docker-Desktop.ps1 b/intune/App Installs/Install-Docker-Desktop.ps1 similarity index 100% rename from Install-Docker-Desktop.ps1 rename to intune/App Installs/Install-Docker-Desktop.ps1 diff --git a/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_CreateScheduledTask.ps1 b/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_CreateScheduledTask.ps1 new file mode 100644 index 0000000..b90ae70 --- /dev/null +++ b/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_CreateScheduledTask.ps1 @@ -0,0 +1,246 @@ +# ------------------------------------------------------------------------------------------------------------ # +# Author(s) : Peter Klapwijk - www.inthecloud247.com # +# Version : 1.0 # +# # +# Description : Create a Scheduled task to connect drive mapping(s). Task runs on network change. # +# # +# Changes : v1.0 - Initial version # +# # +# This script is provide "As-Is" without any warranties # +# # +#------------------------------------------------------------------------------------------------------------- # + +# Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell +If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { + Try { + &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH + } + Catch { + Throw "Failed to start $PSCOMMANDPATH" + } + Exit +} + +# ------------------------------------------------------------------------------------------------------- # +# Variables +# ------------------------------------------------------------------------------------------------------- # +$CompanyName = "CareCentrix" +$TaskScriptName = "DriveMappingsv1.0_ScriptRunFromTaskScheduler.vbs" +$TaskScriptName2 = "DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1" +$TaskScriptFolder = "C:\Program Files\Common Files\$CompanyName\DriveMappings" +$ScriptSourceDirectory = ".\" + +#region Functions +Function CleanUpAndExit() { + Param( + [Parameter(Mandatory=$True)][String]$ErrorLevel + ) + + # Write results to registry for Intune Detection + $Key = "HKEY_LOCAL_MACHINE\Software\$CompanyName\DriveMappings\v1.0" + $NOW = Get-Date -Format "yyyyMMdd-hhmmss" + + If ($ErrorLevel -eq "0") { + [microsoft.win32.registry]::SetValue($Key, "Scheduled", $NOW) + } else { + [microsoft.win32.registry]::SetValue($Key, "Failure", $NOW) + [microsoft.win32.registry]::SetValue($Key, "Error Code", $Errorlevel) + } + + # Exit Script with the specified ErrorLevel + Stop-Transcript | Out-Null + EXIT $ErrorLevel +} + +#endregion Functions + + +# ------------------------------------------------------------------------------------------------------- # +# Start Transcript +# ------------------------------------------------------------------------------------------------------- # +$Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" +Start-Transcript -Path $Transcript | Out-Null + + +# ------------------------------------------------------------------------------------------------------- # +# Create local copy of the script to be run from the Task Scheduler +# ------------------------------------------------------------------------------------------------------- # +if (!(Test-Path -path $TaskScriptFolder)) { +# Target Folder does not yet exist + Write-Host "Creating Folder '$TaskScriptFolder' ..." + New-Item $TaskScriptFolder -Type Directory | Out-Null +} + +try { + Write-Host "Source folder to copy script from: '$ScriptSourceDirectory'" + Copy-Item "$ScriptSourceDirectory\$TaskScriptName" -Destination "$TaskScriptFolder" -ErrorAction Stop | Out-Null + Write-Host "Created local copy of the script '$TaskScriptName' in folder: '$TaskScriptFolder'" +} catch { + Write-Host "ERROR creating local copy of the script '$TaskScriptName' in folder: '$TaskScriptFolder'" + CleanUpAndExit -ErrorLevel 1 +} + +try { + Write-Host "Source folder to copy script from: '$ScriptSourceDirectory'" + Copy-Item "$ScriptSourceDirectory\$TaskScriptName2" -Destination "$TaskScriptFolder" -ErrorAction Stop | Out-Null + Write-Host "Created local copy of the script '$TaskScriptName2' in folder: '$TaskScriptFolder'" +} catch { + Write-Host "ERROR creating local copy of the script '$TaskScriptName2' in folder: '$TaskScriptFolder'" + CleanUpAndExit -ErrorLevel 1 +} + +# ------------------------------------------------------------------------------------------------------- # +# Create Scheduled Task to run At Logon +# ------------------------------------------------------------------------------------------------------- # +# General parameters +$TaskName = "Drive mappings" +$TaskDescription = "Connect drive mappings" +$TaskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -MultipleInstances IgnoreNew -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -Hidden -StartWhenAvailable +# Define the triggers of the scheduled task +# Configure a trigger to run the script when a network change is detected +$class = cimclass MSFT_TaskEventTrigger root/Microsoft/Windows/TaskScheduler +$trigger = $class | New-CimInstance -ClientOnly +$trigger +$trigger.Enabled = $true +$trigger.Subscription = '' +# Define the action of the Scheduled task +$TaskAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "`"$TaskScriptFolder\$TaskScriptName2`"" +#Define the principal +$TaskPrincipal = New-ScheduledTaskPrincipal -GroupId "S-1-5-32-545" +# Register the Scheduled task +Register-ScheduledTask -Action $TaskAction -Trigger $Trigger -Settings $TaskSettings -TaskPath $CompanyName -TaskName $TaskName -Description $TaskDescription -Principal $TaskPrincipal -Force + + +# ------------------------------------------------------------------------------------------------------- # +# Check End State +# ------------------------------------------------------------------------------------------------------- # +try { + Get-ScheduledTask -TaskName $TaskName -ErrorAction Stop | Out-Null + write-host "SUCCESS: Task is Scheduled." + CleanUpAndExit -ErrorLevel 0 +} catch { + write-host "ERROR: Scheduled Task could not be found." + CleanUpAndExit -ErrorLevel 2 +} + +# SIG # Begin signature block +# MIIWKAYJKoZIhvcNAQcCoIIWGTCCFhUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB +# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR +# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUys1bykPJUlvLsGv/XWKelbN6 +# CSmgghNzMIIFuTCCBKGgAwIBAgITEwAF2WJyfRrDOWPSpAAAAAXZYjANBgkqhkiG +# 9w0BAQsFADBnMRMwEQYKCZImiZPyLGQBGRYDY29tMRswGQYKCZImiZPyLGQBGRYL +# Y2FyZWNlbnRyaXgxEzARBgoJkiaJk/IsZAEZFgNjY3gxHjAcBgNVBAMTFUNDWCBE +# b21haW4gSXNzdWluZyBDQTAeFw0yMzAzMTYxNDE0MzRaFw0yODAzMTQxNDE0MzRa +# MIGUMRMwEQYKCZImiZPyLGQBGRYDY29tMRswGQYKCZImiZPyLGQBGRYLY2FyZWNl +# bnRyaXgxEzARBgoJkiaJk/IsZAEZFgNjY3gxGTAXBgNVBAsTEFNlcnZlcmxlc3Mg +# U2l0ZXMxFzAVBgNVBAsTDldvcmsgRnJvbSBIb21lMRcwFQYDVQQDEw5BbWFzb24s +# IEFuZHJldzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMLCjBaNvPFh +# rtISwkR9DTn3Wx6YlH/AjKFLH+6MEbKdwWWUPyWQ6XUcMug/PbAvKuSMmEodBN+h +# r2pFKPT/YXGZGCWisJMlkR7nQrdnzb6oGiWxhoS7ElD6YUqTriVBxBOj8Dx494Lc +# /P76Jshby0ral37gJsd2nRL8Yw9TzzJP2H6aFuwJ9T/W8vdibYWef4jUxfgTJ+sA +# rePJONZwRTYkZHfCCQTQgGvaBv6RJ3WMWSzCLewnm6cAqu7rgeknmNfC2/gasBg2 +# UPXyITK6edSx1XfXTfUr5TbJpi+cWOKuixUqOmNYJaRf/4jlTvnsDCKtBRtMA6WT +# gYGrNx59RFUCAwEAAaOCAi4wggIqMD0GCSsGAQQBgjcVBwQwMC4GJisGAQQBgjcV +# CIe8uiGEwuM0zYklgq6SOoSJ8HiBD4flphKDp98YAgFkAgEDMBMGA1UdJQQMMAoG +# CCsGAQUFBwMDMA4GA1UdDwEB/wQEAwIHgDAbBgkrBgEEAYI3FQoEDjAMMAoGCCsG +# AQUFBwMDMB0GA1UdDgQWBBRpLREEN8ouqVAjy36kDfV4M4YSTzAfBgNVHSMEGDAW +# gBSWx7Rvmiz0f0ZAwCpnHof4LRWcKTBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8v +# cGtpLmNjeC5jYXJlY2VudHJpeC5jb20vY2VydGVucm9sbC9DQ1glMjBEb21haW4l +# MjBJc3N1aW5nJTIwQ0EuY3JsMIGBBggrBgEFBQcBAQR1MHMwcQYIKwYBBQUHMAKG +# ZWh0dHA6Ly9wa2kuY2N4LmNhcmVjZW50cml4LmNvbS9jZXJ0ZW5yb2xsL1BQS0kw +# MDQuY2N4LmNhcmVjZW50cml4LmNvbV9DQ1glMjBEb21haW4lMjBJc3N1aW5nJTIw +# Q0EuY3J0MDgGA1UdEQQxMC+gLQYKKwYBBAGCNxQCA6AfDB1hbmRyZXcuYW1hc29u +# QGNhcmVjZW50cml4LmNvbTBNBgkrBgEEAYI3GQIEQDA+oDwGCisGAQQBgjcZAgGg +# LgQsUy0xLTUtMjEtMTE3OTk0ODU1LTE2OTk3ODc3LTM1ODA5NTM0MzgtODI0MDkw +# DQYJKoZIhvcNAQELBQADggEBAFDwW1McWcyvVDe+vYaKdi3raEkRXlDAUnyblXzw +# juBRARJS/G4SdIT7sWYMefvRDjY6LF+aaJKpBtp/VlIveUaeNZ+wpai7bwXYtxKb +# ZF6dnKFhnSzzmApi09ep3jkD/WADgy6jZ4k5i6GZvqHN3r9s5Wc7/AP45pcgOLXF +# n7yVa+5nlHJ/I4orxGvJuj0H/wOhoH3ESaUJuWXo6ANcfnCsP8ETWfBlm9jrW0tG +# MST88T1GuP8vvL651uacOKYjy5LMIm4zFwjhEtg/fSfXIIybsOUkzrt1FB1OEkiL +# pimivoRafSa2zfZNx2/jws0Q3KVSADB5NI3MHvJiBdGQz1owgga3MIIFn6ADAgEC +# AhMTAAAAAquNE9NCf3mRAAAAAAACMA0GCSqGSIb3DQEBCwUAMCsxKTAnBgNVBAMT +# IENhcmVDZW50cml4IENvcnBvcmF0ZSBSb290IENBIElJMB4XDTE2MDMwMzE5MDQw +# OFoXDTM2MDMwMzE3NDgxMFowLDEqMCgGA1UEAxMhQ2FyZUNlbnRyaXggQ29ycG9y +# YXRlIFBvbGljeSBDQSBJMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +# mih9mZKxa2GGpc3RxX6Y8zQlP8lRsZ05KtC+RkIEJAs9ucIbEvWCTExjqG2Wmt9w +# 0Ph6+ZOxafEa0awsMzvRa2upsBs6rEqhvuWKySoXxtSJE/eJyYqAqwa6qmIeFZYA +# mE6ewprnyO+1r9HSbW+OHWAe7LMWnGLCdX/ls3yB9p9ax/DGR/3xX+XBrEreevOF +# srAUDzcgHpi4vAh4j1TQdvH2AtZ47AsHirakZI1vBrygf9uLPWSxKwyMy9xebiZl +# mKc4WPR51aYXwt8nsUy6MnjTjOvFJto+dHakWQngEW/dYDy3JUh5LIkuYDJvIm5v +# MQyug7Yh02CZs4+1NMVsPQIDAQABo4ID0TCCA80wEAYJKwYBBAGCNxUBBAMCAQAw +# HQYDVR0OBBYEFMP+zZMzw1VnJs8h5P18DA4SsUN0MIGpBgNVHSAEgaEwgZ4wgZsG +# IiqGSIb3FAG+QJN6s3DjBYGPDoGSSILqTYLehhyF1N84AmQwdTA6BggrBgEFBQcC +# AjAuHiwATABlAGcAYQBsACAAUABvAGwAaQBjAHkAIABTAHQAYQB0AGUAbQBlAG4A +# dDA3BggrBgEFBQcCARYraHR0cDovL3BraS5jY3guY2FyZWNlbnRyaXguY29tL3Br +# aS9jcHMudHh0ADAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMC +# AYYwEgYDVR0TAQH/BAgwBgEB/wIBATAfBgNVHSMEGDAWgBSrs2vcHt1Q/sf0tn+I +# DWEvItiT3TCCAUcGA1UdHwSCAT4wggE6MIIBNqCCATKgggEuhoHTbGRhcDovLy9D +# Tj1DYXJlQ2VudHJpeCUyMENvcnBvcmF0ZSUyMFJvb3QlMjBDQSUyMElJLENOPVBQ +# S0kwMDEsQ049Q0RQLENOPVB1YmxpYyUyMEtleSUyMFNlcnZpY2VzLENOPVNlcnZp +# Y2VzLENOPUNvbmZpZ3VyYXRpb24sREM9Q2FyZUNlbnRyaXgsREM9Q29tP2NlcnRp +# ZmljYXRlUmV2b2NhdGlvbkxpc3Q/YmFzZT9vYmplY3RDbGFzcz1jUkxEaXN0cmli +# dXRpb25Qb2ludIZWaHR0cDovL3BraS5jY3guY2FyZWNlbnRyaXguY29tL2NlcnRl +# bnJvbGwvQ2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBSb290JTIwQ0ElMjBJSS5j +# cmwwggFEBggrBgEFBQcBAQSCATYwggEyMIHLBggrBgEFBQcwAoaBvmxkYXA6Ly8v +# Q049Q2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBSb290JTIwQ0ElMjBJSSxDTj1B +# SUEsQ049UHVibGljJTIwS2V5JTIwU2VydmljZXMsQ049U2VydmljZXMsQ049Q29u +# ZmlndXJhdGlvbixEQz1DYXJlQ2VudHJpeCxEQz1Db20/Y0FDZXJ0aWZpY2F0ZT9i +# YXNlP29iamVjdENsYXNzPWNlcnRpZmljYXRpb25BdXRob3JpdHkwYgYIKwYBBQUH +# MAKGVmh0dHA6Ly9wa2kuY2N4LmNhcmVjZW50cml4LmNvbS9jZXJ0ZW5yb2xsL0Nh +# cmVDZW50cml4JTIwQ29ycG9yYXRlJTIwUm9vdCUyMENBJTIwSUkuY3J0MA0GCSqG +# SIb3DQEBCwUAA4IBAQBGcGvwx7dsRpHryqeJKG9U60dL6WA3fWHw5laVScvL8TPD +# gh0Jb4fTtkV+pSxfszlPlWzzgHWlUvL/t7QNSLNjeE6eS+17QRxi37sGqBT0xfk3 +# iwXK9ydqLz4MUlBL0XBJdM1fd/DLruowgMKaIks7getYzPM6WfJ6ghdk8DWYBdsX +# YwZRw3TU3KD0hS3aAoF41/jZ1OdimXDZpE7xPhcf1eNYyZiGttwidGh0MEouFcuD +# 78Lc/7C0F8F/CyL1IWeaMsqWjksup71owXcTdEqrL0+hOI846KomZXT/6gRsSqJl +# SNf+0/10R7eBWAmNk0ey2kTFGa2fAeCKCBTblcmUMIIG9zCCBd+gAwIBAgITNAAA +# AATg0fZdj7qTuwAAAAAABDANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDEyFDYXJl +# Q2VudHJpeCBDb3Jwb3JhdGUgUG9saWN5IENBIEkwHhcNMTYwMzE3MjAyNzU3WhcN +# MzYwMzAzMTc0ODEwWjBnMRMwEQYKCZImiZPyLGQBGRYDY29tMRswGQYKCZImiZPy +# LGQBGRYLY2FyZWNlbnRyaXgxEzARBgoJkiaJk/IsZAEZFgNjY3gxHjAcBgNVBAMT +# FUNDWCBEb21haW4gSXNzdWluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +# AQoCggEBAJXYrY06ABvry0Gx0t04eEl/UUvtb9yJ5Il+pUIjx5MuR0ya13sEk85J +# p+L4hf1zVf3EniLJDLVn38j3BGxyIJQKkUmsE05JQ2oV1I5Q5bnHesBJSPs/ccRi +# BGAhKxGyx7rMUn5zV/tBzhuDzmLNoWdEeUanbkS38IXOEjlbr/O7PjznCGB0B/8O +# WDE8hBqbceIL3E7Sk/8chcDK24sMTq/5u7NBjGAa7q7R2Qa+WtcqeG1tuNbZiqMk +# wUnIBNy4FVcRIFpEl0AM9zOavGoAUV2o2xCR9yQ3pzhLaUhQr/ozQX1sV+RWCkz8 +# WeROkqEkFXoA28vLXRs2KGFo/gD3H4kCAwEAAaOCA9UwggPRMBAGCSsGAQQBgjcV +# AQQDAgEAMB0GA1UdDgQWBBSWx7Rvmiz0f0ZAwCpnHof4LRWcKTCBqQYDVR0gBIGh +# MIGeMIGbBiIqhkiG9xQBvkCTerNw4wWBjw6BkkiC6k2C3oYchdTfOAJkMHUwOgYI +# KwYBBQUHAgIwLh4sAEwAZQBnAGEAbAAgAFAAbwBsAGkAYwB5ACAAUwB0AGEAdABl +# AG0AZQBuAHQwNwYIKwYBBQUHAgEWK2h0dHA6Ly9wa2kuY2N4LmNhcmVjZW50cml4 +# LmNvbS9wa2kvY3BzLnR4dAAwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYD +# VR0PBAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUw/7NkzPD +# VWcmzyHk/XwMDhKxQ3QwggFJBgNVHR8EggFAMIIBPDCCATigggE0oIIBMIaB1Gxk +# YXA6Ly8vQ049Q2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBQb2xpY3klMjBDQSUy +# MEksQ049UFBLSTAwMixDTj1DRFAsQ049UHVibGljJTIwS2V5JTIwU2VydmljZXMs +# Q049U2VydmljZXMsQ049Q29uZmlndXJhdGlvbixEQz1DYXJlQ2VudHJpeCxEQz1j +# b20/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdD9iYXNlP29iamVjdENsYXNzPWNS +# TERpc3RyaWJ1dGlvblBvaW50hldodHRwOi8vcGtpLmNjeC5jYXJlY2VudHJpeC5j +# b20vY2VydGVucm9sbC9DYXJlQ2VudHJpeCUyMENvcnBvcmF0ZSUyMFBvbGljeSUy +# MENBJTIwSS5jcmwwggFGBggrBgEFBQcBAQSCATgwggE0MIHMBggrBgEFBQcwAoaB +# v2xkYXA6Ly8vQ049Q2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBQb2xpY3klMjBD +# QSUyMEksQ049QUlBLENOPVB1YmxpYyUyMEtleSUyMFNlcnZpY2VzLENOPVNlcnZp +# Y2VzLENOPUNvbmZpZ3VyYXRpb24sREM9Q2FyZUNlbnRyaXgsREM9Y29tP2NBQ2Vy +# dGlmaWNhdGU/YmFzZT9vYmplY3RDbGFzcz1jZXJ0aWZpY2F0aW9uQXV0aG9yaXR5 +# MGMGCCsGAQUFBzAChldodHRwOi8vcGtpLmNjeC5jYXJlY2VudHJpeC5jb20vY2Vy +# dGVucm9sbC9DYXJlQ2VudHJpeCUyMENvcnBvcmF0ZSUyMFBvbGljeSUyMENBJTIw +# SS5jcnQwDQYJKoZIhvcNAQELBQADggEBABdT37EVfHA6MyrYGsYRqcCEqPTAnO3G +# z8u8XDKea4TWA9pEoziLFWD89TJZSYvaUDIdLCwi1/UPyVNpLBrjKhX68FqOZejD +# i2wfaVGXIX/5vT2o4uttXSmIUn+zNx+k2n84u3CwVv0PrO+/8RBdH2Vgm1m+aho7 +# G31tgK/63HX9RsJ0gVHLj090dO4GaaSU+0MeeXyouGj933H5r6mYr84uaXyBgs6V +# T1YRWYOGByq6HkS0Y0nYEkwxYeOJO6QxydZdtQN2DL1OPjkTVz20IJ46c8XBEDvo +# Gz2FD2qZw+H4h7mK1DJWPgdpaHLRJFM5lBUmfUVMzed37fE9d7UNhEQxggIfMIIC +# GwIBATB+MGcxEzARBgoJkiaJk/IsZAEZFgNjb20xGzAZBgoJkiaJk/IsZAEZFgtj +# YXJlY2VudHJpeDETMBEGCgmSJomT8ixkARkWA2NjeDEeMBwGA1UEAxMVQ0NYIERv +# bWFpbiBJc3N1aW5nIENBAhMTAAXZYnJ9GsM5Y9KkAAAABdliMAkGBSsOAwIaBQCg +# eDAYBgorBgEEAYI3AgEMMQowCKACgAChAoAAMBkGCSqGSIb3DQEJAzEMBgorBgEE +# AYI3AgEEMBwGCisGAQQBgjcCAQsxDjAMBgorBgEEAYI3AgEVMCMGCSqGSIb3DQEJ +# BDEWBBQQjwIEel8sIz8q9Yg9axjlDa2YkTANBgkqhkiG9w0BAQEFAASCAQAPvviq +# GJZYzD47MLIGRepgimkB6pFxPS9zaF7QhxGKntZa3W3jcXDEF0g5COE8uoaoHcKv +# QmrnRD18CODOlOZTR6xzLss3iTQ4AWsRYCnpT13gA//OndGvjEAKSrASJQMs+g5o +# TXLoVLjFX2+xC5im7S3h2LGZYSA2jej5aB0TCSD3z+hK6eXke2olEOtqs3GFHfGG +# 7jFROrIa4S9kvm3B7kIRyBPGIaBooMnNvVHmHO1mmqb0tdvzbdstFR+3NcHU4ewZ +# mYZ7K5EbsWMc0F5fPH/wof1UvWGBIVy9rwT+jMm5At0lJ0E0XFL0QKY93WK3bCp+ +# TU6LXTL0T+HGZ0Mr +# SIG # End signature block diff --git a/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1 b/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1 new file mode 100644 index 0000000..657776c --- /dev/null +++ b/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1 @@ -0,0 +1,429 @@ +# ------------------------------------------------------------------------------------------------------------ # +# Author(s) : Peter Klapwijk - www.inthecloud247.com # +# Version : 1.0 # +# # +# Description : Script that runs on network change and connects drive mapping(s) # +# # +# Changes : v1.0 - Initial version # +# # +# This script is provide "As-Is" without any warranties # +# # +#------------------------------------------------------------------------------------------------------------- # + +# ------------------------------------------------------------------------------------------------------- # +# Functions +# ------------------------------------------------------------------------------------------------------- # +Function CleanUpAndExit() { + Param( + [Parameter(Mandatory=$True)][String]$ErrorLevel + ) + + # Write results to log file + $NOW = Get-Date -Format "yyyyMMdd-hhmmss" + + If ($ErrorLevel -eq "0") { + Write-Host "Drive mappings connected successfully at $NOW" + } else { + Write-Host "Connecting drive mappings failed at $NOW with error $Errorlevel" + } + + # Exit Script with the specified ErrorLevel + Stop-Transcript | Out-Null + EXIT $ErrorLevel +} + +function Test-DCConnection +{ + $DCConnection = Test-Connection ldap.ccx.carecentrix.com -Count 1 + return ($DCConnection -ne $null) + } + +function Test-DriveMappingG +{ + $DriveMappingG = Get-PSDrive -Name "G" -erroraction 'silentlycontinue' + return ($DriveMappingG -ne $null) + } + +function Test-DriveMappingO +{ + $DriveMappingO = Get-PSDrive -Name "O" -erroraction 'silentlycontinue' + return ($DriveMappingO -ne $null) + } + +function Test-DriveMappingR +{ + $DriveMappingR = Get-PSDrive -Name "R" -erroraction 'silentlycontinue' + return ($DriveMappingR -ne $null) + } +function Test-DriveMappingW +{ + $DriveMappingW = Get-PSDrive -Name "W" -erroraction 'silentlycontinue' + return ($DriveMappingW -ne $null) + } +function Test-DriveMappingY +{ + $DriveMappingW = Get-PSDrive -Name "Y" -erroraction 'silentlycontinue' + return ($DriveMappingY -ne $null) + } +# ------------------------------------------------------------------------------------------------------- # +# Start Transcript +# ------------------------------------------------------------------------------------------------------- # +$Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" +Start-Transcript -Path $Transcript | Out-Null + + +# ------------------------------------------------------------------------------------------------------- # +# Check domain connectivity +# ------------------------------------------------------------------------------------------------------- # + +if (Test-DCConnection -eq $True){ + Write-Host "STATUS: Domain connection OK" + } + else { + Write-Host "STATUS: No connection with the domain. Unable to connect drive mappings!" + CleanUpAndExit -ErrorLevel 1 + } + +# ------------------------------------------------------------------------------------------------------- # +# Get User AD Information +# ------------------------------------------------------------------------------------------------------- # + + #$userinfo = Get-ADUser -Identity $env:username -Server ccx.carecentrix.com -Properties HomeDirectory + + $username = $env:username + $filter = "SamAccountName=$username" + $searcher = [DirectoryServices.DirectorySearcher]::new($ad,$filter) + $user = $searcher.FindOne() + $userinfo = $user.Properties + +# ------------------------------------------------------------------------------------------------------- # +# Add drive mapping(s) +# ------------------------------------------------------------------------------------------------------- # + +# ------------------------------------------------------------------------------------------------------- # +# Standard Mappings +# ------------------------------------------------------------------------------------------------------- # + +if (Test-DriveMappingG -eq $True){ + Write-Host "A drive with the name 'G' already exists" + } + else { + New-PSDrive -Name "G" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares" -Persist -Scope Global + Write-Host "Drive G: is connected" + } +if (Test-DriveMappingY -eq $True){ + Write-Host "A drive with the name 'Y' already exists" + } + else { + New-PSDrive -Name "Y" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\apps\ebins_legacy" -Persist -Scope Global + Write-Host "Drive Y: is connected" + } +# ------------------------------------------------------------------------------------------------------- # +# Dept Specific Mappings +# ------------------------------------------------------------------------------------------------------- # + + + + +if (Test-DriveMappingO -eq $True){ + Write-Host "A drive with the name 'O' already exists" + } + else { + switch ($userinfo.DistinguishedName) { + ($userinfo.DistinguishedName -like "*AZPH*"){ + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx\AZPH" -Persist -Scope Global + Write-Host "Drive O: is connected" + break} + ($userinfo.DistinguishedName -like "*FLT2*"){ + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx\FLTA" -Persist -Scope Global + Write-Host "Drive O: is connected" + break} + ($userinfo.DistinguishedName -like "*FLTA*"){ + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx\FLTA" -Persist -Scope Global + Write-Host "Drive O: is connected" + break} + ($userinfo.DistinguishedName -like "*KSOP*"){ + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx\KSOP" -Persist -Scope Global + Write-Host "Drive O: is connected" + break} + ($userinfo.DistinguishedName -like "*CTHA*"){ + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx\CTHA" -Persist -Scope Global + Write-Host "Drive O: is connected" + break} + ($userinfo.DistinguishedName -like "*CTST*"){ + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx\CTHA" -Persist -Scope Global + Write-Host "Drive O: is connected" + break} + ($userinfo.DistinguishedName -like "*NYME*"){ + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx\NYME" -Persist -Scope Global + Write-Host "Drive O: is connected" + break} + default { + New-PSDrive -Name "O" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\ccx" -Persist -Scope Global + Write-Host "Drive O: is connected" + } + } + + } + +if (Test-DriveMappingR -eq $True){ + Write-Host "A drive with the name 'R' already exists" + } + else { + switch ($userinfo.DistinguishedName) { + ($userinfo.DistinguishedName -like "*AZPH*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\AZPH" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + ($userinfo.DistinguishedName -like "*FLT2*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\FLTA" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + ($userinfo.DistinguishedName -like "*FLTA*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\FLTA" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + ($userinfo.DistinguishedName -like "*KSOP*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\KSOP" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + ($userinfo.DistinguishedName -like "*CTHA*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\CTHA" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + ($userinfo.DistinguishedName -like "*CTST*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\CTHA" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + ($userinfo.DistinguishedName -like "*NYME*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\NYME" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + ($userinfo.DistinguishedName -like "*NMAL*"){ + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\NMAL" -Persist -Scope Global + Write-Host "Drive R is connected" + break} + default { + New-PSDrive -Name "R" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts" -Persist -Scope Global + Write-Host "Drive R is connected" + } + } + + } + +if (Test-DriveMappingW -eq $True){ + Write-Host "A drive with the name 'W' already exists" + } + else { + switch ($userinfo.DistinguishedName) { + ($userinfo.DistinguishedName -like "*AZPH*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\AZPH" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + ($userinfo.DistinguishedName -like "*FLT2*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\FLTA" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + ($userinfo.DistinguishedName -like "*FLTA*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\FLTA" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + ($userinfo.DistinguishedName -like "*KSOP*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\KSOP" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + ($userinfo.DistinguishedName -like "*CTHA*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\CTHA" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + ($userinfo.DistinguishedName -like "*CTST*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\CTHA" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + ($userinfo.DistinguishedName -like "*NYME*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\NYME" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + ($userinfo.DistinguishedName -like "*NMAL*"){ + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts\NMAL" -Persist -Scope Global + Write-Host "Drive W is connected" + break} + default { + New-PSDrive -Name "W" -PSProvider FileSystem -Root "\\ccx.carecentrix.com\shares\Depts" -Persist -Scope Global + Write-Host "Drive W is connected" + } + } + + } + +# ------------------------------------------------------------------------------------------------------- # +# Check end state +# ------------------------------------------------------------------------------------------------------- # +if (Test-DriveMappingG -eq $True){ + Write-Host "STATUS: G: drive connected" + } + else { + Write-Host "STATUS: G: drive not connected, unknown error" + CleanUpAndExit -ErrorLevel 2 + } + if (Test-DriveMappingY -eq $True){ + Write-Host "STATUS: Y: drive connected" + } + else { + Write-Host "STATUS: Y: drive not connected, unknown error" + CleanUpAndExit -ErrorLevel 2 + } +if (Test-DriveMappingO -eq $True){ + Write-Host "STATUS: O: drive connected" + } + else { + Write-Host "STATUS: O: drive not connected, unknown error" + CleanUpAndExit -ErrorLevel 2 + } + +if (Test-DriveMappingP -eq $True){ + Write-Host "STATUS: P: drive connected" + CleanUpAndExit -ErrorLevel 0 + } + else { + Write-Host "STATUS: P: drive not connected, unknown error" + CleanUpAndExit -ErrorLevel 2 + } +if (Test-DriveMappingR -eq $True){ + Write-Host "STATUS: R: drive connected" + CleanUpAndExit -ErrorLevel 0 + } + else { + Write-Host "STATUS: R: drive not connected, unknown error" + CleanUpAndExit -ErrorLevel 2 + } +if (Test-DriveMappingW -eq $True){ + Write-Host "STATUS: W: drive connected" + CleanUpAndExit -ErrorLevel 0 + } + else { + Write-Host "STATUS: W: drive not connected, unknown error" + CleanUpAndExit -ErrorLevel 2 + } + +# SIG # Begin signature block +# MIIWKAYJKoZIhvcNAQcCoIIWGTCCFhUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB +# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR +# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUXds1YbXTOMQCeX+MxCkjU5+u +# 5I6gghNzMIIFuTCCBKGgAwIBAgITEwAF2WJyfRrDOWPSpAAAAAXZYjANBgkqhkiG +# 9w0BAQsFADBnMRMwEQYKCZImiZPyLGQBGRYDY29tMRswGQYKCZImiZPyLGQBGRYL +# Y2FyZWNlbnRyaXgxEzARBgoJkiaJk/IsZAEZFgNjY3gxHjAcBgNVBAMTFUNDWCBE +# b21haW4gSXNzdWluZyBDQTAeFw0yMzAzMTYxNDE0MzRaFw0yODAzMTQxNDE0MzRa +# MIGUMRMwEQYKCZImiZPyLGQBGRYDY29tMRswGQYKCZImiZPyLGQBGRYLY2FyZWNl +# bnRyaXgxEzARBgoJkiaJk/IsZAEZFgNjY3gxGTAXBgNVBAsTEFNlcnZlcmxlc3Mg +# U2l0ZXMxFzAVBgNVBAsTDldvcmsgRnJvbSBIb21lMRcwFQYDVQQDEw5BbWFzb24s +# IEFuZHJldzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMLCjBaNvPFh +# rtISwkR9DTn3Wx6YlH/AjKFLH+6MEbKdwWWUPyWQ6XUcMug/PbAvKuSMmEodBN+h +# r2pFKPT/YXGZGCWisJMlkR7nQrdnzb6oGiWxhoS7ElD6YUqTriVBxBOj8Dx494Lc +# /P76Jshby0ral37gJsd2nRL8Yw9TzzJP2H6aFuwJ9T/W8vdibYWef4jUxfgTJ+sA +# rePJONZwRTYkZHfCCQTQgGvaBv6RJ3WMWSzCLewnm6cAqu7rgeknmNfC2/gasBg2 +# UPXyITK6edSx1XfXTfUr5TbJpi+cWOKuixUqOmNYJaRf/4jlTvnsDCKtBRtMA6WT +# gYGrNx59RFUCAwEAAaOCAi4wggIqMD0GCSsGAQQBgjcVBwQwMC4GJisGAQQBgjcV +# CIe8uiGEwuM0zYklgq6SOoSJ8HiBD4flphKDp98YAgFkAgEDMBMGA1UdJQQMMAoG +# CCsGAQUFBwMDMA4GA1UdDwEB/wQEAwIHgDAbBgkrBgEEAYI3FQoEDjAMMAoGCCsG +# AQUFBwMDMB0GA1UdDgQWBBRpLREEN8ouqVAjy36kDfV4M4YSTzAfBgNVHSMEGDAW +# gBSWx7Rvmiz0f0ZAwCpnHof4LRWcKTBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8v +# cGtpLmNjeC5jYXJlY2VudHJpeC5jb20vY2VydGVucm9sbC9DQ1glMjBEb21haW4l +# MjBJc3N1aW5nJTIwQ0EuY3JsMIGBBggrBgEFBQcBAQR1MHMwcQYIKwYBBQUHMAKG +# ZWh0dHA6Ly9wa2kuY2N4LmNhcmVjZW50cml4LmNvbS9jZXJ0ZW5yb2xsL1BQS0kw +# MDQuY2N4LmNhcmVjZW50cml4LmNvbV9DQ1glMjBEb21haW4lMjBJc3N1aW5nJTIw +# Q0EuY3J0MDgGA1UdEQQxMC+gLQYKKwYBBAGCNxQCA6AfDB1hbmRyZXcuYW1hc29u +# QGNhcmVjZW50cml4LmNvbTBNBgkrBgEEAYI3GQIEQDA+oDwGCisGAQQBgjcZAgGg +# LgQsUy0xLTUtMjEtMTE3OTk0ODU1LTE2OTk3ODc3LTM1ODA5NTM0MzgtODI0MDkw +# DQYJKoZIhvcNAQELBQADggEBAFDwW1McWcyvVDe+vYaKdi3raEkRXlDAUnyblXzw +# juBRARJS/G4SdIT7sWYMefvRDjY6LF+aaJKpBtp/VlIveUaeNZ+wpai7bwXYtxKb +# ZF6dnKFhnSzzmApi09ep3jkD/WADgy6jZ4k5i6GZvqHN3r9s5Wc7/AP45pcgOLXF +# n7yVa+5nlHJ/I4orxGvJuj0H/wOhoH3ESaUJuWXo6ANcfnCsP8ETWfBlm9jrW0tG +# MST88T1GuP8vvL651uacOKYjy5LMIm4zFwjhEtg/fSfXIIybsOUkzrt1FB1OEkiL +# pimivoRafSa2zfZNx2/jws0Q3KVSADB5NI3MHvJiBdGQz1owgga3MIIFn6ADAgEC +# AhMTAAAAAquNE9NCf3mRAAAAAAACMA0GCSqGSIb3DQEBCwUAMCsxKTAnBgNVBAMT +# IENhcmVDZW50cml4IENvcnBvcmF0ZSBSb290IENBIElJMB4XDTE2MDMwMzE5MDQw +# OFoXDTM2MDMwMzE3NDgxMFowLDEqMCgGA1UEAxMhQ2FyZUNlbnRyaXggQ29ycG9y +# YXRlIFBvbGljeSBDQSBJMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +# mih9mZKxa2GGpc3RxX6Y8zQlP8lRsZ05KtC+RkIEJAs9ucIbEvWCTExjqG2Wmt9w +# 0Ph6+ZOxafEa0awsMzvRa2upsBs6rEqhvuWKySoXxtSJE/eJyYqAqwa6qmIeFZYA +# mE6ewprnyO+1r9HSbW+OHWAe7LMWnGLCdX/ls3yB9p9ax/DGR/3xX+XBrEreevOF +# srAUDzcgHpi4vAh4j1TQdvH2AtZ47AsHirakZI1vBrygf9uLPWSxKwyMy9xebiZl +# mKc4WPR51aYXwt8nsUy6MnjTjOvFJto+dHakWQngEW/dYDy3JUh5LIkuYDJvIm5v +# MQyug7Yh02CZs4+1NMVsPQIDAQABo4ID0TCCA80wEAYJKwYBBAGCNxUBBAMCAQAw +# HQYDVR0OBBYEFMP+zZMzw1VnJs8h5P18DA4SsUN0MIGpBgNVHSAEgaEwgZ4wgZsG +# IiqGSIb3FAG+QJN6s3DjBYGPDoGSSILqTYLehhyF1N84AmQwdTA6BggrBgEFBQcC +# AjAuHiwATABlAGcAYQBsACAAUABvAGwAaQBjAHkAIABTAHQAYQB0AGUAbQBlAG4A +# dDA3BggrBgEFBQcCARYraHR0cDovL3BraS5jY3guY2FyZWNlbnRyaXguY29tL3Br +# aS9jcHMudHh0ADAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMC +# AYYwEgYDVR0TAQH/BAgwBgEB/wIBATAfBgNVHSMEGDAWgBSrs2vcHt1Q/sf0tn+I +# DWEvItiT3TCCAUcGA1UdHwSCAT4wggE6MIIBNqCCATKgggEuhoHTbGRhcDovLy9D +# Tj1DYXJlQ2VudHJpeCUyMENvcnBvcmF0ZSUyMFJvb3QlMjBDQSUyMElJLENOPVBQ +# S0kwMDEsQ049Q0RQLENOPVB1YmxpYyUyMEtleSUyMFNlcnZpY2VzLENOPVNlcnZp +# Y2VzLENOPUNvbmZpZ3VyYXRpb24sREM9Q2FyZUNlbnRyaXgsREM9Q29tP2NlcnRp +# ZmljYXRlUmV2b2NhdGlvbkxpc3Q/YmFzZT9vYmplY3RDbGFzcz1jUkxEaXN0cmli +# dXRpb25Qb2ludIZWaHR0cDovL3BraS5jY3guY2FyZWNlbnRyaXguY29tL2NlcnRl +# bnJvbGwvQ2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBSb290JTIwQ0ElMjBJSS5j +# cmwwggFEBggrBgEFBQcBAQSCATYwggEyMIHLBggrBgEFBQcwAoaBvmxkYXA6Ly8v +# Q049Q2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBSb290JTIwQ0ElMjBJSSxDTj1B +# SUEsQ049UHVibGljJTIwS2V5JTIwU2VydmljZXMsQ049U2VydmljZXMsQ049Q29u +# ZmlndXJhdGlvbixEQz1DYXJlQ2VudHJpeCxEQz1Db20/Y0FDZXJ0aWZpY2F0ZT9i +# YXNlP29iamVjdENsYXNzPWNlcnRpZmljYXRpb25BdXRob3JpdHkwYgYIKwYBBQUH +# MAKGVmh0dHA6Ly9wa2kuY2N4LmNhcmVjZW50cml4LmNvbS9jZXJ0ZW5yb2xsL0Nh +# cmVDZW50cml4JTIwQ29ycG9yYXRlJTIwUm9vdCUyMENBJTIwSUkuY3J0MA0GCSqG +# SIb3DQEBCwUAA4IBAQBGcGvwx7dsRpHryqeJKG9U60dL6WA3fWHw5laVScvL8TPD +# gh0Jb4fTtkV+pSxfszlPlWzzgHWlUvL/t7QNSLNjeE6eS+17QRxi37sGqBT0xfk3 +# iwXK9ydqLz4MUlBL0XBJdM1fd/DLruowgMKaIks7getYzPM6WfJ6ghdk8DWYBdsX +# YwZRw3TU3KD0hS3aAoF41/jZ1OdimXDZpE7xPhcf1eNYyZiGttwidGh0MEouFcuD +# 78Lc/7C0F8F/CyL1IWeaMsqWjksup71owXcTdEqrL0+hOI846KomZXT/6gRsSqJl +# SNf+0/10R7eBWAmNk0ey2kTFGa2fAeCKCBTblcmUMIIG9zCCBd+gAwIBAgITNAAA +# AATg0fZdj7qTuwAAAAAABDANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDEyFDYXJl +# Q2VudHJpeCBDb3Jwb3JhdGUgUG9saWN5IENBIEkwHhcNMTYwMzE3MjAyNzU3WhcN +# MzYwMzAzMTc0ODEwWjBnMRMwEQYKCZImiZPyLGQBGRYDY29tMRswGQYKCZImiZPy +# LGQBGRYLY2FyZWNlbnRyaXgxEzARBgoJkiaJk/IsZAEZFgNjY3gxHjAcBgNVBAMT +# FUNDWCBEb21haW4gSXNzdWluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +# AQoCggEBAJXYrY06ABvry0Gx0t04eEl/UUvtb9yJ5Il+pUIjx5MuR0ya13sEk85J +# p+L4hf1zVf3EniLJDLVn38j3BGxyIJQKkUmsE05JQ2oV1I5Q5bnHesBJSPs/ccRi +# BGAhKxGyx7rMUn5zV/tBzhuDzmLNoWdEeUanbkS38IXOEjlbr/O7PjznCGB0B/8O +# WDE8hBqbceIL3E7Sk/8chcDK24sMTq/5u7NBjGAa7q7R2Qa+WtcqeG1tuNbZiqMk +# wUnIBNy4FVcRIFpEl0AM9zOavGoAUV2o2xCR9yQ3pzhLaUhQr/ozQX1sV+RWCkz8 +# WeROkqEkFXoA28vLXRs2KGFo/gD3H4kCAwEAAaOCA9UwggPRMBAGCSsGAQQBgjcV +# AQQDAgEAMB0GA1UdDgQWBBSWx7Rvmiz0f0ZAwCpnHof4LRWcKTCBqQYDVR0gBIGh +# MIGeMIGbBiIqhkiG9xQBvkCTerNw4wWBjw6BkkiC6k2C3oYchdTfOAJkMHUwOgYI +# KwYBBQUHAgIwLh4sAEwAZQBnAGEAbAAgAFAAbwBsAGkAYwB5ACAAUwB0AGEAdABl +# AG0AZQBuAHQwNwYIKwYBBQUHAgEWK2h0dHA6Ly9wa2kuY2N4LmNhcmVjZW50cml4 +# LmNvbS9wa2kvY3BzLnR4dAAwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYD +# VR0PBAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHwYDVR0jBBgwFoAUw/7NkzPD +# VWcmzyHk/XwMDhKxQ3QwggFJBgNVHR8EggFAMIIBPDCCATigggE0oIIBMIaB1Gxk +# YXA6Ly8vQ049Q2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBQb2xpY3klMjBDQSUy +# MEksQ049UFBLSTAwMixDTj1DRFAsQ049UHVibGljJTIwS2V5JTIwU2VydmljZXMs +# Q049U2VydmljZXMsQ049Q29uZmlndXJhdGlvbixEQz1DYXJlQ2VudHJpeCxEQz1j +# b20/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdD9iYXNlP29iamVjdENsYXNzPWNS +# TERpc3RyaWJ1dGlvblBvaW50hldodHRwOi8vcGtpLmNjeC5jYXJlY2VudHJpeC5j +# b20vY2VydGVucm9sbC9DYXJlQ2VudHJpeCUyMENvcnBvcmF0ZSUyMFBvbGljeSUy +# MENBJTIwSS5jcmwwggFGBggrBgEFBQcBAQSCATgwggE0MIHMBggrBgEFBQcwAoaB +# v2xkYXA6Ly8vQ049Q2FyZUNlbnRyaXglMjBDb3Jwb3JhdGUlMjBQb2xpY3klMjBD +# QSUyMEksQ049QUlBLENOPVB1YmxpYyUyMEtleSUyMFNlcnZpY2VzLENOPVNlcnZp +# Y2VzLENOPUNvbmZpZ3VyYXRpb24sREM9Q2FyZUNlbnRyaXgsREM9Y29tP2NBQ2Vy +# dGlmaWNhdGU/YmFzZT9vYmplY3RDbGFzcz1jZXJ0aWZpY2F0aW9uQXV0aG9yaXR5 +# MGMGCCsGAQUFBzAChldodHRwOi8vcGtpLmNjeC5jYXJlY2VudHJpeC5jb20vY2Vy +# dGVucm9sbC9DYXJlQ2VudHJpeCUyMENvcnBvcmF0ZSUyMFBvbGljeSUyMENBJTIw +# SS5jcnQwDQYJKoZIhvcNAQELBQADggEBABdT37EVfHA6MyrYGsYRqcCEqPTAnO3G +# z8u8XDKea4TWA9pEoziLFWD89TJZSYvaUDIdLCwi1/UPyVNpLBrjKhX68FqOZejD +# i2wfaVGXIX/5vT2o4uttXSmIUn+zNx+k2n84u3CwVv0PrO+/8RBdH2Vgm1m+aho7 +# G31tgK/63HX9RsJ0gVHLj090dO4GaaSU+0MeeXyouGj933H5r6mYr84uaXyBgs6V +# T1YRWYOGByq6HkS0Y0nYEkwxYeOJO6QxydZdtQN2DL1OPjkTVz20IJ46c8XBEDvo +# Gz2FD2qZw+H4h7mK1DJWPgdpaHLRJFM5lBUmfUVMzed37fE9d7UNhEQxggIfMIIC +# GwIBATB+MGcxEzARBgoJkiaJk/IsZAEZFgNjb20xGzAZBgoJkiaJk/IsZAEZFgtj +# YXJlY2VudHJpeDETMBEGCgmSJomT8ixkARkWA2NjeDEeMBwGA1UEAxMVQ0NYIERv +# bWFpbiBJc3N1aW5nIENBAhMTAAXZYnJ9GsM5Y9KkAAAABdliMAkGBSsOAwIaBQCg +# eDAYBgorBgEEAYI3AgEMMQowCKACgAChAoAAMBkGCSqGSIb3DQEJAzEMBgorBgEE +# AYI3AgEEMBwGCisGAQQBgjcCAQsxDjAMBgorBgEEAYI3AgEVMCMGCSqGSIb3DQEJ +# BDEWBBStTVz+56O45cbuEIQpf6Rj2TfVXjANBgkqhkiG9w0BAQEFAASCAQC58lXC +# i6QwnaFZOdjMSICRTBkkATm3wei1ofU3JuTEhVP5epZxxnPmx88fPWAwnDmf593l +# mU1GsBDH5coxA1aSb17nCfLg4ugaz6PUpd5NXJFgrYIW9W4/XOeoBxS1gZ8zGbmK +# jwNk6QqTyARSmQMUrcanH42U07e/iaRkvXtfI+dDcJDR/SH7iT/x2tPWoEHGZ70J +# fYh/17QDmsBduYbkqy1symQB8hTqmsmoCvnqjXbkCBIhufVCvESGw7sj17N8VZXX +# K3M8EL3MqAk2bkySgjhTukCX4d2ugk26Wdv9CmttSHV59WV9jrtbFap7dXxtKCGv +# BCzxF835hs3tO6u4 +# SIG # End signature block diff --git a/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.vbs b/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.vbs new file mode 100644 index 0000000..d682379 --- /dev/null +++ b/intune/Desktop Scripts/Drive Mappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.vbs @@ -0,0 +1,5 @@ +'Change COMPANY in your own company name +Dim strArgs +Set oShell = CreateObject ("Wscript.Shell") +strArgs = "powershell.exe -executionpolicy bypass -windowstyle hidden -file C:\Program Files\Common Files\Carecentrix\DriveMappings\DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1" +oShell.Run strArgs, 0, false \ No newline at end of file