update
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
$Navigation = @(
|
||||
New-UDListItem -Label 'Home' -OnClick {
|
||||
Invoke-UDRedirect -Url '/Home'
|
||||
}
|
||||
New-UDListItem -Label 'CMDB Ci Lookup' -OnClick {
|
||||
Invoke-UDRedirect -Url '/CMDBServerList'
|
||||
}
|
||||
New-UDListItem -Label 'Server Build Request V1 (Current) Lookup' -OnClick {
|
||||
Invoke-UDRedirect -Url '/ServerBuildRequestV1'
|
||||
}
|
||||
New-UDListItem -Label 'Application Server V2 (Previous) Lookup' -OnClick {
|
||||
Invoke-UDRedirect -Url '/ApplicationServerV2'
|
||||
}
|
||||
New-UDListItem -Label 'AppNameLookup' -OnClick {
|
||||
Invoke-UDRedirect -Url '/AppNameLookup'
|
||||
}
|
||||
New-UDListItem -Label 'CiLookup' -OnClick {
|
||||
Invoke-UDRedirect -Url '/CiLookup'
|
||||
}
|
||||
New-UDListItem -Label 'AzureSizeHelper' -OnClick {
|
||||
Invoke-UDRedirect -Url '/AzureVmSizeHelper'
|
||||
}
|
||||
)
|
||||
AppNameLookup.ps1 - /AppNameLookup
|
||||
New-UDApp -Title 'PowerShell Universal' -Pages @(
|
||||
Get-UDPage -Name 'Home'
|
||||
Get-UDPage -Name 'CMDBServerList'
|
||||
Get-UDPage -Name 'ServerBuildRequestV1'
|
||||
Get-UDPage -Name 'ApplicationServerV2'
|
||||
Get-UDPage -Name 'AppNameLookup'
|
||||
Get-UDPage -Name 'CiLookup'
|
||||
Get-UDPage -Name 'AzureVmSizeHelper'
|
||||
) -Navigation $Navigation
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
New-UDPage -Url "/AppNameLookup" -Name "AppNameLookup" -Content {
|
||||
New-UDTypography -Id "disclaimer" -Text "This is querying the cmdb_ci_service_auto table in ServiceNow. This is live data being shown."
|
||||
|
||||
|
||||
New-ITDServiceNowSession -Environment Production -Credential $Secret:snow_vmcred
|
||||
$PropertyList = @(
|
||||
@{
|
||||
name = "name";
|
||||
expression = { $_.name.display_value };
|
||||
},
|
||||
@{
|
||||
name = "sys_id";
|
||||
expression = { $_.sys_id.value } ;
|
||||
},
|
||||
@{
|
||||
name = "u_primary_systems_admin";
|
||||
expression = { $_.u_primary_systems_admin.display_value } ;
|
||||
},
|
||||
@{
|
||||
name = "u_secondary_systems_admin";
|
||||
expression = { $_.u_secondary_systems_admin.display_value } ;
|
||||
},
|
||||
@{
|
||||
name = 'u_systems_owner';
|
||||
expression = { $_.u_systems_owner.display_value};
|
||||
}
|
||||
)
|
||||
#$Result = Get-ITDServiceNowRecord -Table cmdb_ci_server -Filter ("nameLIKE" + $EventData.CiName) -IncludeTotalCount | Select-Object -Property $PropertyList
|
||||
$GetITDServiceNowRecordParams = @{
|
||||
Table = 'cmdb_ci_service_auto';
|
||||
IncludeTotalCount = $true;
|
||||
Fields = @(
|
||||
'name',
|
||||
'sys_id',
|
||||
'u_primary_systems_admin',
|
||||
'u_secondary_systems_admin',
|
||||
'u_systems_owner'
|
||||
)
|
||||
}
|
||||
$Result = Get-ITDServiceNowRecord @GetITDServiceNowRecordParams | Select-Object -Property $PropertyList
|
||||
$CmdbCiUrl = "https://northdakota.service-now.com/nav_to.do?uri=" + $Result.sys_class_name + ".do?sys_id=" + $Result.sys_id
|
||||
|
||||
New-UDTable -Columns @(
|
||||
New-UDTableColumn -Property 'SNowUrl' -Title 'CmdbCiUrl' -Render { #https://northdakota.service-now.com/nav_to.do?uri=cmdb_ci_win_server.do?sys_id=8bc3ecd11b0154509d7ada01dd4bcb59
|
||||
New-UDLink -Url ("https://northdakota.service-now.com/nav_to.do?uri=cmdb_ci_service_auto.do?sys_id=" + $EventData.sys_id) -Id "lnkSNow" -Content {
|
||||
New-UDImage -Url "https://psuniversal.nd.gov/PSUniversal_Extras/servicenow_logo_icon_168835.png" -Height 20 -Width 20
|
||||
}
|
||||
}
|
||||
New-UDTableColumn -Property 'name' -Title 'name' -ShowSort -ShowFilter
|
||||
#New-UDTableColumn -Property 'sys_id' -Title 'sys_id' -ShowSort -ShowFilter
|
||||
New-UDTableColumn -Property 'u_primary_systems_admin' -Title 'u_primary_systems_admin' -ShowSort -ShowFilter
|
||||
New-UDTableColumn -Property 'u_secondary_systems_admin' -Title 'u_secondary_systems_admin' -ShowSort -ShowFilter
|
||||
New-UDTableColumn -Property 'u_systems_owner' -Title 'u_systems_owner' -ShowSort -ShowFilter
|
||||
) -Data ($Result | sort-object Name) -ShowPagination -Dense -PageSize 50
|
||||
} -Title "AppNameLookup" -Icon @{
|
||||
id = '9fdceac8-807e-4d5e-acda-3d477d77fdb4'
|
||||
type = 'icon'
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
New-UDPage -Url "/ApplicationServerV2" -Name "ApplicationServerV2" -Content {
|
||||
New-UDTypography -Text 'Application Server request items (RITMs) submitted between 2023/02/27 and 2024/06/25 in which the field "VM Work Needed" is set to "Yes"'
|
||||
|
||||
|
||||
$ServerInstance = "itdintsql22p1.nd.gov\INTSQL22P1"
|
||||
$Database = "ITD-Systems-Automation"
|
||||
$Table = 'ServiceNow_RitmDump_ApplicationServerV2'
|
||||
|
||||
$SqlQuery = "SELECT [number],[sys_id],[opened_at],[requested_for],[short_description],[request_type],[application_name],[environment],[additional_comments],[vm_work_needed],[server_name],[host_name],[server_type],[operating_system],[target_platform],[processors],[memory_gb],[cidr_block],[data_center],[licensing_restrictions],[agency_name],[application_info],[support_hours],[dr_protection],[startup_priority],[disk_1_os],[disk_2_swap_disk],[disk_3],[disk_4],[disk_5],[disk_6],[disk_7],[disk_8],[disk_9],[disk_10],[disk_11],[disk_12],[disk_13],[disk_14],[disk_15],[disk_16] FROM [$Database].[dbo].[$Table] WHERE vm_work_needed = '1'"
|
||||
$SqlRecords = Invoke-Sqlcmd -ServerInstance $ServerInstance -Database $Database -Query $SqlQuery -Credential $Secret:sql_itdpsu1 -Verbose
|
||||
|
||||
New-UDTable -Columns @(
|
||||
New-UDTableColumn -Property 'number' -Title 'number' -ShowSort
|
||||
New-UDTableColumn -Property 'opened_at' -Title 'opened_at'
|
||||
New-UDTableColumn -Property 'server_name' -Title 'server_name' -ShowFilter
|
||||
New-UDTableColumn -Property 'host_name' -Title 'host_name' -ShowFilter
|
||||
New-UDTableColumn -Property 'requested_for' -Title 'requested_for' -ShowFilter
|
||||
New-UDTableColumn -Property 'request_type' -Title 'request_type' -ShowFilter
|
||||
New-UDTableColumn -Property 'environment' -Title 'environment' -ShowFilter
|
||||
New-UDTableColumn -Property 'additional_comments' -Title 'additional_comments' -ShowFilter
|
||||
) -Data ($SqlRecords | Select *,@{n='Open';e={$_.sys_id}} | Sort-Object -Descending number) -Dense -ShowPagination -PageSize 20
|
||||
} -Title "ApplicationServerV2" -Icon @{
|
||||
id = 'd9dc64f6-9f4b-432a-866a-d3189529528b'
|
||||
type = 'icon'
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
New-UDPage -Url "/AzureVmSizeHelper" -Name "AzureVmSizeHelper" -Content {
|
||||
$tenantId = '2dea0464-da51-4a88-bae2-b3db94bc0c54'
|
||||
$AppId = '60244573-7130-4026-9c6d-47de73f8ca29'
|
||||
$SecureStringPwd = $Secret:azure_iaasserviceprincipal
|
||||
$PSCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AppId, ($SecureStringPwd | ConvertTo-SecureString -AsPlainText -Force)
|
||||
Connect-AzAccount -ServicePrincipal -Credential $PSCredential -Tenant $tenantId
|
||||
|
||||
$TableData = Get-AzVmSize -Location centralus | Select *,`
|
||||
@{n='MemoryInGB';e={$_.MemoryInMb / 1024}}, `
|
||||
@{n='OSDiskSizeInGB'; e={$_.OsDiskSizeInMb / 1024}}, `
|
||||
@{n='ResourceDiskSizeInGB'; e={$_.ResourceDiskSizeInMB / 1024}} | Sort-Object NumberOfCores,MemoryInGB
|
||||
|
||||
New-UDTable -Columns @(
|
||||
New-UDTableColumn -Property 'Name' -Title 'Name' -ShowSort -ShowFilter
|
||||
New-UDTableColumn -Property 'NumberOfCores' -Title 'NumberOfCores' -ShowSort -ShowFilter
|
||||
New-UDTableColumn -Property 'MemoryInGB' -Title 'MemoryInGB' -ShowFilter -ShowSort
|
||||
New-UDTableColumn -Property 'OSDiskSizeInGB' -Title 'OSDiskSizeInGB' -ShowFilter -ShowSort
|
||||
New-UDTableColumn -Property 'ResourceDiskSizeInGB' -Title 'ResourceDiskSizeInGB' -ShowFilter -ShowSort
|
||||
) -Data $TableData -Dense
|
||||
} -Title "AzureVmSizeHelper" -Icon @{
|
||||
type = 'icon'
|
||||
id = 'f45c0541-5f78-4c00-899b-548e1bbabb04'
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
New-UDPage -Url "/CMDBServerList" -Name "CMDBServerList" -Content {
|
||||
# Use Get-UDPage -Name 'CmdbServer' to use this page in your dashboard
|
||||
|
||||
<#
|
||||
New-UDCard -Content {
|
||||
New-UDList -children {
|
||||
New-UDListItem -Label "Enter the Name of the Cmdb Ci. Usually host name, not FQDN. `nFor example: itdsccmp2.nd.gov, enter itdsccmp2. The search is using 'LIKE' comparsion operator, so wildcards are automatically applied at both sides of the entered value. "
|
||||
New-UDListItem -Label 'This search is a live query of the ServiceNow Cmdb.'
|
||||
New-UDListItem -Label 'This is a work in progress. Use at your own discretion.'
|
||||
}
|
||||
}#>
|
||||
|
||||
|
||||
|
||||
|
||||
New-UDForm -Id 'CiLookup' -Content {
|
||||
New-UDRow -Columns {
|
||||
New-UDColumn -SmallSize 6 -LargeSize 6 -Content {
|
||||
New-UDTextbox -Id 'CiName'
|
||||
}
|
||||
}
|
||||
} -OnValidate {
|
||||
$FormContent = $EventData
|
||||
if ($FormContent.CiName -eq $null -or $FormContent.VMName -eq '') {
|
||||
New-UDFormValidationResult -ValidationError "CiName is required"
|
||||
}
|
||||
else {
|
||||
New-UDFormValidationResult -Valid
|
||||
}
|
||||
} -OnSubmit {
|
||||
Show-UDToast -Message ("Querying ServiceNow table cmdb_ci_server for record with name " + $EventData.Name) -Duration 20000
|
||||
|
||||
New-ITDServiceNowSession -Environment Production -Credential $Secret:snow_vmcred
|
||||
$PropertyList = @(
|
||||
@{
|
||||
name = "name";
|
||||
expression = { $_.name.display_value };
|
||||
},
|
||||
@{
|
||||
name = "dns_domain";
|
||||
expression = { $_.dns_domain.display_value } ;
|
||||
},
|
||||
@{
|
||||
name = "environment";
|
||||
expression = { $_.environment.display_value } ;
|
||||
},
|
||||
@{
|
||||
name = 'operational_status';
|
||||
expression = { $_.operational_status.display_value};
|
||||
}
|
||||
@{
|
||||
name = 'sys_id';
|
||||
expression = { $_.sys_id.value };
|
||||
}
|
||||
@{
|
||||
name = 'sys_class_name';
|
||||
expression = { $_.sys_class_name.value }
|
||||
},
|
||||
@{
|
||||
name = "u_nd_type";
|
||||
expression = { $_.u_nd_type.display_value }
|
||||
},
|
||||
@{
|
||||
name = "u_nd_application_svc";
|
||||
expression = { $_.u_nd_application_svc.display_value }
|
||||
},
|
||||
@{
|
||||
name = "u_nd_licensing_restrictions";
|
||||
expression = { $_.u_nd_licensing_restrictions.display_value }
|
||||
},
|
||||
@{
|
||||
name = "u_support_hours";
|
||||
expression = { $_.u_support_hours.display_value }
|
||||
},
|
||||
@{
|
||||
name = "u_nd_dr_protection";
|
||||
expression = { $_.u_nd_dr_protection.display_value };
|
||||
},
|
||||
@{
|
||||
name = "u_srm_recovery_type";
|
||||
expression = { $_.u_srm_recovery_type.display_value }
|
||||
},
|
||||
@{
|
||||
name = "os";
|
||||
expression = { $_.os.display_value }
|
||||
},
|
||||
@{
|
||||
name = "os_version";
|
||||
expression = { $_.os_version.display_value }
|
||||
},
|
||||
@{
|
||||
name = "model_id";
|
||||
expression = { $_.model_id.display_value }
|
||||
}
|
||||
)
|
||||
#$Result = Get-ITDServiceNowRecord -Table cmdb_ci_server -Filter ("nameLIKE" + $EventData.CiName) -IncludeTotalCount | Select-Object -Property $PropertyList
|
||||
$GetITDServiceNowRecordParams = @{
|
||||
#Filter = "model_id=3161ee6c1bf810502653997fbd4bcb4c^ORmodel_id%253Da75f244c1bd75014bba0113fad4bcb72"
|
||||
Filter = "model_idLIKEVMware^ORmodel_idLIKEMicrosoft"
|
||||
Table = 'cmdb_ci_server';
|
||||
IncludeTotalCount = $true;
|
||||
Fields = @(
|
||||
'name',
|
||||
'sys_id',
|
||||
'dns_domain',
|
||||
'sys_class_name',
|
||||
'operational_status',
|
||||
'environment',
|
||||
'u_nd_type',
|
||||
'model_id',
|
||||
'os',
|
||||
'os_version',
|
||||
'u_nd_application_svc',
|
||||
'u_nd_licensing_restrictions',
|
||||
'u_nd_dr_protection',
|
||||
'u_srm_recovery_type',
|
||||
'u_support_hours'
|
||||
)
|
||||
}
|
||||
$Result = Get-ITDServiceNowRecord @GetITDServiceNowRecordParams | Select-Object -Property $PropertyList
|
||||
$CmdbCiUrl = "https://northdakota.service-now.com/nav_to.do?uri=" + $Result.sys_class_name + ".do?sys_id=" + $Result.sys_id
|
||||
|
||||
New-UDTable -Columns @(
|
||||
New-UDTableColumn -Property 'CmdbCiUrl' -Title 'CmdbCiUrl' -Render { #https://northdakota.service-now.com/nav_to.do?uri=cmdb_ci_win_server.do?sys_id=8bc3ecd11b0154509d7ada01dd4bcb59
|
||||
New-UDLink -Url ("https://northdakota.service-now.com/nav_to.do?uri=" + $EventData.sys_class_name + ".do?sys_id=" + $EventData.sys_id) -Id "lnkCmdbCi" -Content {
|
||||
New-UDImage -Url "https://psuniversal.nd.gov/PSUniversal_Extras/servicenow_logo_icon_168835.png" -Height 20 -Width 20
|
||||
}
|
||||
}
|
||||
New-UDTableColumn -Property 'name' -Title 'name' -ShowSort -ShowFilter
|
||||
New-UDTableColumn -Property 'dns_domain' -Title 'dns_domain' -ShowFilter
|
||||
New-UDTableColumn -Property 'u_nd_application_svc' -Title 'u_nd_application_svc' -ShowFilter
|
||||
New-UDTableColumn -Property 'environment' -Title 'environment' -ShowFilter
|
||||
New-UDTableCOlumn -Property 'operational_status' -Title 'operational_status' -ShowFilter
|
||||
New-UDTableColumn -Property 'u_nd_type' -Title 'u_nd_type' -ShowFilter
|
||||
#New-UDTableColumn -Property 'model_id' -Title 'model_id' -ShowFilter
|
||||
#New-UDTableColumn -Property 'os' -Title 'os' -ShowFilter
|
||||
#New-UDTableColumn -Property 'os_version' -Title 'os_version' -ShowFilter
|
||||
New-UDTableColumn -Property 'u_nd_licensing_restrictions' -Title 'u_nd_licensing_restrictions' -ShowFilter
|
||||
New-UDTableColumn -Property 'u_support_hours' -Title 'u_support_hours' -ShowFilter
|
||||
New-UDTableColumn -Property 'u_nd_dr_protection' -Title 'u_nd_dr_protection' -ShowFilter
|
||||
New-UDTableColumn -Property 'u_srm_recovery_type' -Title 'u_srm_recovery_type' -ShowFilter
|
||||
) -Data ($Result | sort-object Name) -ShowPagination -Dense -PageSize 50
|
||||
|
||||
|
||||
} -OnProcessing {
|
||||
|
||||
}
|
||||
|
||||
|
||||
New-UDCard -Id 'Result'
|
||||
} -Title "CMDBServerList" -Icon @{
|
||||
id = 'dc0de7d9-022b-4e24-a7c7-7f0e59710542'
|
||||
type = 'icon'
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
New-UDPage -Url "/CiLookup" -Name "CiLookup" -Content {
|
||||
New-UDGrid -Container -Children {
|
||||
New-UDGrid -Item -ExtraSmallSize 4 -Children {
|
||||
New-UDCard -Title "General Information" -Content {
|
||||
#New-UDButton -Text "Button 1"
|
||||
New-UDRow -Columns {
|
||||
New-UDColumn -Size 4 -Content {
|
||||
New-UDTextBox -Label "Name" -Id "Name" -Value "itddefghijklmno.ndcloud.gov" -FullWidth
|
||||
}
|
||||
New-UDColumn -Size 4 -Content {
|
||||
New-UDTextBox -Label "LicensingRestrictions" -Id "LicensingRestrictions" -Value "Microsoft SQL Enterprise"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
New-UDGrid -Item -ExtraSmallSize 4 -Children {
|
||||
New-UDCard -Title "Support Information" -Content {
|
||||
#New-UDButton -Text "Button 2"
|
||||
New-UDRow -Columns {
|
||||
New-UDColumn -Size 4 -Content {
|
||||
New-UDTextBox -Label "AppName" -Id "AppName"
|
||||
}
|
||||
New-UDColumn -Size 4 -Content {
|
||||
New-UDTextBox -Label "Support Hours" -Id "Support Hours"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} -Id "GridGeneral"
|
||||
|
||||
New-UDContainer -Content {
|
||||
New-UDLayout -Columns 2 - -Content {
|
||||
#New-UDTypography "Row 1, Col 1"
|
||||
New-UDTextBox -Label "Name" -Value "itddefghijklmno.ndcloud.gov" -FullWidth
|
||||
#New-UDTypography "Row 1, Col 2"
|
||||
New-UDTextBox -Label "AppName" -Value "Infra-POS-SomeStupidApp" -FullWidth
|
||||
New-UDTypography "Row 2, Col 1"
|
||||
New-UDTypography "Row 2, Col 2"
|
||||
}
|
||||
}
|
||||
|
||||
$tablePwd = [ordered]@{
|
||||
'Password Expiration' = "itdsomething.nd.gov"
|
||||
'Account Expiration' = "ITD-POS-StupidName"
|
||||
'Last Logon Timestamp' = "Microsoft SQL Enterperise"
|
||||
}
|
||||
|
||||
|
||||
$Data = , @($tablePwd.GetEnumerator())
|
||||
$DateColumns = @(
|
||||
New-UDTableColumn -Property Name -Title " "
|
||||
New-UDTableColumn -Property Value -Title " "
|
||||
)
|
||||
New-UDTable -Id "PasswordInfo" -Title "Password and Account Info" -Data $Data[0] -Columns $DateColumns -Dense
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
New-UDButton -Text 'Full Width' -OnClick {
|
||||
Show-UDModal -Content {
|
||||
New-UDGrid -Container -Children {
|
||||
New-UDCard -Title "General" -Content {
|
||||
New-UDElement -Tag 'div' -Id 'addElement'
|
||||
New-UDTextBox -Id "Name" -Label "Name" -Value "servernamehere.nd.gov"
|
||||
New-UDTextBox -Id "Operational Status" -Label "Status" -Value "Operational"
|
||||
New-UDTextBox -Id "AppName" -Label "AppName" -Value "ITD-POS-StupidNameHere"
|
||||
New-UDTextBox -Id "Support Hours" -Label "Support Hours" -Value "All Day Every Day"
|
||||
}
|
||||
New-UDCard -Title "Hardware" -Content {
|
||||
New-UDTextBox -Id "Datacenter" -Label "Datacenter" -Value "Bismarck"
|
||||
New-UDTextBox -Id "Environment" -Label "Environment" -Value "Production"
|
||||
New-UDTextBox -Id "DR Protection" -Label "DR Protection" -Value "VMware: RPO 04:00"
|
||||
New-UDTextBox -Id "Datacenter" -Label "Datacenter" -Value "Bismarck"
|
||||
New-UDTextBox -Id "Environment" -Label "Environment" -Value "Production"
|
||||
New-UDTextBox -Id "DR Protection" -Label "DR Protection" -Value "VMware: RPO 04:00"
|
||||
New-UDTextBox -Id "OperatingSystem" -Label "Operating System" -Value "Windows Server 2022"
|
||||
New-UDTextBox -Id "CPU" -Label "CPU" -Value "4"
|
||||
New-UDTextBox -Id "MemoryGB" -Label "MemoryGB" -Value "12"
|
||||
New-UDTextBox -Id "DiskGB" -Label "DiskGB" -Value "1197"
|
||||
}
|
||||
New-UDCard -Title "Software" -Content {
|
||||
New-UDTextBox -Id "LicensingRestrictions" -Label "LicensingRestrictions" -Value "Microsoft SQL Enterprise"
|
||||
New-UDTextBox -Id "OperatingSystem" -Label "Operating System" -Value "Windows Server 2022"
|
||||
}
|
||||
}
|
||||
|
||||
#New-UDDynamic
|
||||
} -FullWidth -MaxWidth 'md'
|
||||
}
|
||||
} -Title "CiLookup" -Icon @{
|
||||
id = '3743b2ed-0278-4678-8a47-e22ad4514afb'
|
||||
type = 'icon'
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
New-UDPage -Url "/CiTest" -Name "CiTest" -Content {
|
||||
|
||||
} -Title "CiTest" -Icon @{
|
||||
} -Generated
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
New-UDPage -Url "/ServerBuildRequestV1" -Name "ServerBuildRequestV1" -Content {
|
||||
New-UDTypography -Text "`nServer Build Request request items (RITMs) submitted after 2024/06/25"
|
||||
|
||||
$ServerInstance = "itdintsql22p1.nd.gov\INTSQL22P1"
|
||||
$Database = "ITD-Systems-Automation"
|
||||
$Table = 'ServiceNow_RitmDump_ServerBuildRequestV1'
|
||||
|
||||
New-ITDServiceNowSession -Environment Production -Credential $Secret:snow_vmcred
|
||||
|
||||
$SqlQuery = "SELECT [RitmNum],
|
||||
[RitmSysId],
|
||||
[opened_at],
|
||||
[requested_for],
|
||||
[request_type],
|
||||
[environment]
|
||||
,[host_name_ref]
|
||||
,[host_name]
|
||||
FROM [ITD-Systems-Automation].[dbo].[ServiceNow_RitmDump_ServerBuildRequestV1]"
|
||||
$SqlRecords = Invoke-Sqlcmd -ServerInstance $ServerInstance -Database $Database -Query $SqlQuery -Credential $Secret:sql_itdpsu1 -Verbose
|
||||
|
||||
|
||||
|
||||
New-UDTable -Dense -ShowPagination -PageSize 20 -Size small -Data ($SqlRecords | Sort-Object -Descending opened_at) -Columns @(
|
||||
New-UDTableColumn -Property 'RitmUrl' -Title 'RitmUrl' -Render {
|
||||
New-UDLink -Url ("https://northdakota.service-now.com/nav_to.do?uri=sc_req_item.do?sys_id=" + $EventData.RitmSysId) -Id "lnkRitm" -Content {
|
||||
New-UDImage -Url "https://psuniversal.nd.gov/PSUniversal_Extras/servicenow_logo_icon_168835.png" -Height 20 -Width 20
|
||||
}
|
||||
}
|
||||
|
||||
New-UDTableColumn -Property 'RitmNum' -Title 'RitmNum' -ShowFilter
|
||||
New-UDTableColumn -Property 'opened_at' -Title 'opened_at' -ShowFilter
|
||||
New-UDTableColumn -Property 'host_name' -Title 'host_name' -ShowFilter
|
||||
New-UDTableColumn -Property 'requested_for' -Title 'requested_for' -ShowFilter
|
||||
New-UDTableColumn -Property 'request_type' -Title 'request_type' -ShowFilter
|
||||
New-UDTableColumn -Property 'environment' -Title 'environment' -ShowFilter
|
||||
#New-UDTableColumn -Property 'additional_comments' -Title 'additional_comments' -ShowFilter
|
||||
)
|
||||
} -Title "ServerBuildRequestV1" -Icon @{
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
New-UDPage -Url "/Home" -Name "Home" -Content {
|
||||
New-UDTypography -text 'Use left side navigation to view various ServiceNow queries' -id 'homeText' -noWrap
|
||||
} -Generated -Layout (
|
||||
New-UDPageLayout -Large @(
|
||||
New-UDItemLayout -Id 'homeText' -Row 0 -Column 0 -RowSpan 1 -ColumnSpan 1
|
||||
) -Medium @(
|
||||
) -Small @(
|
||||
) -ExtraSmall @(
|
||||
) -ExtraExtraSmall @(
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user