Files
Zack Meier 1d304511b8 update
2026-04-15 15:45:50 -05:00

34 lines
1.6 KiB
PowerShell

New-UDPage -Url "/ADServiceAccount" -Name "ADServiceAccount" -Content {
New-UDTypography -Text 'ADServiceAccount'
$ServerInstance = "itdintsql22p1.nd.gov\INTSQL22P1"
$Database = "ITD-Systems-Automation"
$SqlQuery = "SELECT TOP (1000) [RequestedBy]
,[PSUJobId]
,[SamAccountName]
,[Description]
,[PasswordstateTitle]
,[PasswordstateList]
,[SnowCHGNum]
,[Status]
,[DomainName]
,[DateTime]
FROM [ITD-Systems-Automation].[dbo].[Infra_ActiveDirectory_Object_NewITDADServiceAccount_PRD]
ORDER BY [DateTime] DESC"
$SqlRecords = Invoke-Sqlcmd -ServerInstance $ServerInstance -Database $Database -Query $SqlQuery -Credential $Secret:sql_itdpsu1 -Verbose
New-UDTable -Columns @(
New-UDTableColumn -Property 'PSUJobId' -Title 'PSUJobId' -ShowFilter
New-UDTableColumn -Property 'DateTime' -Title 'DateTime' -ShowFilter
New-UDTableColumn -Property 'RequestedBy' -Title 'PSUJobId' -ShowFilter
New-UDTableColumn -Property 'SamAccountName' -Title 'SamAccountName' -ShowFilter
New-UDTableColumn -Property 'PasswordstateList' -Title 'PasswordstateList' -ShowFilter
New-UDTableColumn -Property 'PasswordstateTitle' -Title 'PasswordstateTitle' -ShowFilter
New-UDTableColumn -Property 'SnowCHGNum' -Title 'SnowCHGNum' -ShowFilter
New-UDTableColumn -Property 'Status' -Title 'Status' -ShowFilter
New-UDTableColumn -Property 'Domainname' -Title 'DomainName' -ShowFilter
) -Data ($SqlRecords | Sort-Object -Descending Id) -ShowPagination -PageSize 20 -Dense
} -Icon @{
type = 'icon'
id = '259b4c05-17df-4440-9907-57ab4df1e6c9'
}