Hello!
I am trying to follow this video tutorial: PowerShell Universal Dashboard - Drag and Drop with UDGridLayout
Unfortunately I can’t find a button for ‘Copy Style’. Is there anything additional I need to follow for this? Or does it just not work in Microsoft Edge and I need another browser?
I am logged in as administrator.
$Navigation = @(
New-UDListItem -Label "Startpage"
New-UDListItem -Label "Menu" -Children {
New-UDListItem -Label "Personal Data" -Href '/PersonalData'
New-UDListItem -Label "Memberships" -Href '/Memberships'
}
)
function Set-SessionVariables {
param(
$User
)
## Session variables
$session:username = $user.Split("\")[1]
Write-Verbose "[0] $user" -Verbose
Write-Verbose "[1] $($user.Split("\")[1])" -Verbose
Write-Verbose "[2] $($user.Split('\\')[1])" -Verbose
Write-Verbose "[3] $($session:username)" -Verbose
Switch -Regex ($session:username){
'^\d{7}$' {
$session:usertype = "officeuser"
$session:officeuser = Get-EDKOfficeUser -NationalID $session:username
$session:adminaccounts = Get-EDKAdminAccount -OfficeUserObject $session:officeuser -AdminType All
}
'^adc.(\d{7})$' {
$session:usertype = "adc"
$session:officeuser = Get-EDKOfficeUser -NationalID ($session:username.Split(".")[1])
$session:adminaccounts = Get-EDKAdminAccount -OfficeUserObject $session:officeuser -AdminType All
}
'^ads.(\d{7})$' {
$session:usertype = "ads"
$session:officeuser = Get-EDKOfficeUser -NationalID ($session:username.Split(".")[1])
$session:adminaccounts = Get-EDKAdminAccount -OfficeUserObject $session:officeuser -AdminType All
}
'^hva.(\d{7})$'{
$session:usertype = "hva"
$session:officeuser = Get-EDKOfficeUser -NationalID ($session:username.Split(".")[1])
$session:adminaccounts = Get-EDKAdminAccount -OfficeUserObject $session:officeuser -AdminType All
}
default {
Throw "Username isn't one of: OfficeUser, Clientadmin, Serveradmin or HVA admin ($($session:username))"
}
}
}
$Pages = @()
$Pages += New-UDPage -Name 'PersonalData' -Content {
Try{
Set-SessionVariables -User $User
}Catch{
Throw $error[0]
}
$usernameShort = "$($session:officeuser.givenname[0])$($session:officeuser.surname[0])"
New-UDGridLayout -Content {
New-UDTypography -Text "National ID"
New-UDTextbox -Id 'txtNationalId' -FullWidth -Disabled -Value $session:officeuser.SamAccountName
New-UDTypography -Text "Vorname"
New-UDTextbox -Id 'txtGivenname' -FullWidth -Disabled -Value $session:officeuser.givenname
New-UDTypography -Text "Nachname"
New-UDTextbox -Id 'txtSurname' -FullWidth -Disabled -Value $session:officeuser.surname
New-UDTypography -Text "Kostenstelle"
New-UDTextbox -Id 'txtDepartmentNumber' -FullWidth -Disabled -Value $session:officeuser.departmentNumber
} -Draggable -Resizable
}
<#$Pages += New-UDPage -Name 'Memberships' -Content {
Set-SessionVariables -User $User
New-UDTypography -Text "Memberships"
} #>
New-UDDashboard -Title "Active Directory Self-Service" -Pages $Pages -NavigationLayout permanent -Navigation $Navigation