This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AuthMethod = New-UDAuthenticationMethod -Endpoint { | |
param([pscredential]$Credential) | |
New-UDAuthenticationResult -Success -UserName $Credential.UserName | |
} | |
$AuthPolicy = New-UDAuthorizationPolicy -Name "Policy" -Endpoint { | |
param($ClaimsPrincipal) | |
$UserName = $ClaimsPrincipal.Identity.Name | |
$Session:UserRole = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DBG]: PS C:\Users\adamr>> Get-UAScript -AppToken $AppToken.Token | |
Id : 1 | |
Name : Script.ps1 | |
Description : | |
CreatedTime : 1/31/2020 10:51:40 AM | |
ManualTime : 0 | |
CommitId : c45063d8f9f68805ffdf68231015aaaec47b13d6 | |
Content : Write-Host "Hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DBG]: PS C:\Users\adamr>> $Role = Get-UARole -Name Reader | |
[DBG]: PS C:\Users\adamr>> $Role | |
Id Name Description | |
-- ---- ----------- | |
3 Reader Readers have read-only access to UA. They cannot make changes to any entity within the system. | |
[DBG]: PS C:\Users\adamr>> $Identity = New-UAIdentity -Name Jeff -Role $Role | |
[DBG]: PS C:\Users\adamr>> $AppToken = Grant-UAAppToken -Identity $Identity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module UniversalAutomation | |
Import-Module UniversalAuotmation.Dashboard | |
Import-Module PSSecretStore | |
$ComputerName = "http://localhost:10000" | |
Start-UAServer -Port 10000 | |
$Cache:ComputerName = $ComputerName | |
Connect-UAServer -ComputerName $ComputerName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Script = Get-UAScript -Name 'whoami.ps1' | |
New-UASchedule -Script $Script -Credential $Credential -Cron '*/2 * * * *' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Script = Get-UAScript -Name 'whoami.ps1' | |
Invoke-UAScript -Script $Script -Credential $Credential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PasswordVariable = Get-UAVariable -Name 'password' | |
$Credential = New-UACredential -UserName 'iis' -Password $PasswordVariable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SecretManager = Get-UASecretManager -Name 'PSSecretStore' | |
Set-UAVariable -Name 'password' -Value 'P@$$w0rd' -SecretManager $SecretManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-UASecretManager -Name 'PSSecretStore' -Get { | |
param($Name) | |
Get-SSSecret -Name $Name -KeyPath C:\keyfile.bin -StorePath C:\store.bin | |
} -Set { | |
param($Name, $Value) | |
Set-SSSecret -Name $Name -Value $Value -KeyPath C:\keyfile.bin -StorePath C:\store.bin | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-SSSecret -Name 'password' -KeyPath C:\keyfile.bin -StorePath C:\store.bin |