Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $AllUsers = $AllAccounts | Select-Object LockedOut, PasswordExpired, Description, Office, SamAccountName, Name, Department, Title, accountexpirationdate, Enabled, UserPrincipalName, St, @{Name = "Details"; Expression = {
- New-UDButton -Text "Show Details" -OnClick (
- New-UDEndpoint -Endpoint {
- $TableData = @(
- [PSCustomObject]@{Name = "Username"; Value = $_.UserPrincipalName; Sort = "1"}
- [PSCustomObject]@{Name = "Name"; Value = $_.Name; Sort = "2"}
- [PSCustomObject]@{Name = "House"; Value = $_.St; Sort = "3"}
- [PSCustomObject]@{Name = "Enabled?"; Value = ($_.Enabled).tostring() ; Sort = "4"}
- [PSCustomObject]@{Name = "Locked?"; Value = $(if ($_.LockedOut -eq $false) {"Nope"} else {"Yep"}); Sort = "5"}
- ).GetEnumerator()
- Show-UDModal -Header {
- New-UDHeading -Size 4 -Text "Here's what we have on $($_.Name)"
- } -Content {
- New-UDCard -Title "Account Details" -Content {
- New-UDTable -Headers @("Attribute", "Value") -Endpoint {
- $TableData | Sort-Object Sort | Out-UDTableData -Property @("Name", "Value")
- }
- }
- }
- }
- )
- }
- }
- $Cache:AllUsers = $AllUsers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement