Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- New-UDPage -Name "Testing Tabs 2" -Icon table -AuthorizedRole @("Dev") -Content {
- New-UDHeading -Size 1 -Text "A|D|U| Management" -Color '#00529b'
- New-UDIcon -Icon users -Size 7x -Color '#00529b'
- New-UDCard -Title "User Account Search" -BackgroundColor '#eeeeee' -Content {
- New-UDInput -Title "Search" -Endpoint {
- param(
- [Parameter(Mandatory=$false)]
- [ValidateCount(1,20)]
- [string]$FirstName,
- [Parameter(Mandatory=$false)]
- [ValidateCount(1,20)]
- [string]$LastName
- )
- $Session:FirstName = $FirstName
- $Session:LastName = $LastName
- $Session:RequestingUser = $user
- New-UDInputAction -Content {
- New-UDGrid -NoExport -Title "" -Headers @("Name", "UserName", "Enabled", "Options") -Properties @("Name", "UserName", "Enabled", "Button") -Endpoint {
- $Cache:ADUser | Where-Object { ($_.GivenName -match $Session:FirstName) -or ($_.SurName -match $Session:LastName) } | ForEach-Object {
- [PSCustomObject]@{
- Name = $_.Name
- UserName = $_.SamAccountName
- Enabled = $_.Enabled
- Button = New-UDButton -Text "Select User" -Icon user_edit -OnClick (New-UDEndpoint -Endpoint {
- $Session:SelectedUserSAN = $_.SamAccountName
- $Session:SelectedUserName = $_.Name
- $Session:GridData = Invoke-ADUMUEGridData -SamAccountName $Session:SelectedUserSAN
- #Sync/update table and cards to show infor for currently selected user
- Sync-UDElement -Id 'DivBox2'
- })#end new-udendpoint in pscustomobject
- }#end psobject
- } | Select-Object -Property Name, UserName, Enabled, button | sort Name | Out-UDGridData
- }#end udgrid endpoint
- }#end udinputAction content
- }#end udinput endpoint
- }#end udcard search
- New-UDElement -Tag div -Id 'DivBox2' -Endpoint {
- New-UDCard -Title "Account Status" -BackgroundColor '#eeeeee' -Content {
- New-UDRow -Columns {
- New-UDColumn -size 12 {
- New-UDColumn -size 1 {
- New-UDIcon -Icon user_cog -Size 8x -Color "#00529b"
- }
- New-UDColumn -size 10 {
- New-UDHeading -Text "Your currently selected user is: $Session:SelectedUserName - $Session:SelectedUserSAN" -Size 4
- }
- }
- }#end udrow
- New-UDRow -Columns {
- New-UDColumn -size 12 {
- New-UDColumn -size 1 {
- $Session:AccountStatusIcon
- }
- New-UDColumn -size 10 {
- $Session:AccountStatus
- }
- }
- }#end udrow
- New-UDRow -Columns {
- New-UDTable -Title "" -AutoRefresh -RefreshInterval 5 -Headers @("DisplayName","UserName","EmployeeID","Email","Title","Department","AccountLocked","AccountExpired","AccountEnabled","PasswordExpired","PasswordLastSet","LastBadPasswordAttempt","LastLogonDate","AccountCreated") -Endpoint {
- $Session:GridData | Out-UDTableData -Property @("DisplayName","UserName","EmployeeID","Email","Title","Department","AccountLocked","AccountExpired","AccountEnabled","PasswordExpired","PasswordLastSet","LastBadPasswordAttempt","LastLogonDate","AccountCreated")
- }#end udtable
- }#end udrow
- }#end udcard
- }#end udelement divbox2
- New-UDLayout -Columns 3 {
- New-UDCard -Title "Set EmployeeID" -BackgroundColor pink -Content {}
- New-UDCard -Title "Set Department" -BackgroundColor '#9B4900' -Content {}
- New-UDCard -Title "Set Title" -BackgroundColor teal -Content {}
- }
- }#end udpage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement