Advertisement
Jacob_Evans

Untitled

Sep 10th, 2019
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $AllUsers = $AllAccounts |  Select-Object LockedOut, PasswordExpired, Description, Office, SamAccountName, Name, Department, Title, accountexpirationdate, Enabled, UserPrincipalName, St, @{Name = "Details"; Expression = {
  2.             New-UDButton -Text "Show Details" -OnClick (
  3.                 New-UDEndpoint -Endpoint {
  4.                     $TableData = @(
  5.                         [PSCustomObject]@{Name = "Username"; Value = $_.UserPrincipalName; Sort = "1"}
  6.                         [PSCustomObject]@{Name = "Name"; Value = $_.Name; Sort = "2"}
  7.                         [PSCustomObject]@{Name = "House"; Value = $_.St; Sort = "3"}
  8.                         [PSCustomObject]@{Name = "Enabled?"; Value = ($_.Enabled).tostring() ; Sort = "4"}
  9.                         [PSCustomObject]@{Name = "Locked?"; Value = $(if ($_.LockedOut -eq $false) {"Nope"} else {"Yep"}); Sort = "5"}
  10.  
  11.                     ).GetEnumerator()
  12.                     Show-UDModal -Header {
  13.                         New-UDHeading -Size 4 -Text "Here's what we have on $($_.Name)"
  14.                     } -Content {
  15.                         New-UDCard -Title "Account Details" -Content {
  16.                             New-UDTable -Headers @("Attribute", "Value") -Endpoint {
  17.                                 $TableData | Sort-Object Sort | Out-UDTableData -Property @("Name", "Value")
  18.                             }
  19.                         }
  20.                     }
  21.                 }
  22.             )
  23.         }
  24.     }
  25.  
  26. $Cache:AllUsers = $AllUsers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement