Skip to content

Commit f54148d

Browse files
authored
Merge pull request #115 from royalapplications/transform-microsoft-samples-to-rdfx
[Refactor] Transform all microsoft samples to rdfx
2 parents aa383d8 + 280a3cb commit f54148d

File tree

4 files changed

+164
-2
lines changed

4 files changed

+164
-2
lines changed

Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfe

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<DynamicFolderExport>
2+
<Name>Dynamic Folder Export</Name>
3+
<Objects>
4+
<DynamicFolderExportObject>
5+
<Type>DynamicFolder</Type>
6+
<Name>CurrentAccount (Windows PowerShell)</Name>
7+
<Description>This returns dynamic objects reflecting data from the current user account.</Description>
8+
<Notes><![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9+
<title></title>
10+
<style type="text/css">.cs2654AE3A{text-align:left;text-indent:0pt;margin:0pt 0pt 0pt 0pt}
11+
.cs4306042E{color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:normal;}
12+
.csC8F6D76{color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:normal;font-style:normal;}
13+
.cs15B7AE4B{text-align:left;margin:0pt 0pt 0pt 0pt;list-style-type:disc;color:#000000;background-color:transparent;font-family:Arial;font-size:11pt;font-weight:normal;font-style:normal}
14+
</style>
15+
<p class="cs2654AE3A"><span class="cs4306042E">Version:</span><span class="csC8F6D76"> 1.0</span></p>
16+
17+
<p class="cs2654AE3A"><span class="cs4306042E">Requirements</span></p>
18+
19+
<p class="cs2654AE3A"><span class="csC8F6D76">&nbsp;</span></p>
20+
21+
<ul style="margin-top:0;margin-bottom:0;">
22+
<li class="cs15B7AE4B"><span class="csC8F6D76">Working PowerShell installation</span></li>
23+
<li class="cs15B7AE4B"><span class="csC8F6D76">PowerShell Script Interpreter correctly configured in Royal TS/X</span></li>
24+
</ul>
25+
]]></Notes>
26+
<ScriptInterpreter>powershell</ScriptInterpreter>
27+
<Script><![CDATA[$ErrorActionPreference = "Stop"
28+
29+
# get data
30+
$account = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
31+
$domain = $account.split("\")[0]
32+
$username = $account.split("\")[1]
33+
34+
# output objects
35+
@{
36+
Objects = @(
37+
@{
38+
ID = "CURRENT_DOMUSER";
39+
Type = "Credential";
40+
Name = "Current UserName with domain";
41+
Username = $account;
42+
Password = "";
43+
Path = "/";
44+
IconName = "VMware Clarity/Core/Avatar Solid";
45+
Description = "This reflects the current logged-on user account, including domain.";
46+
CustomProperties = @{
47+
DOMAIN = $domain;
48+
USERNAME = $username;
49+
}
50+
},
51+
@{
52+
ID = "CURRENT_USERNAME";
53+
Type = "Credential";
54+
Name = "Current UserName without domain";
55+
Username = $username;
56+
Password = "";
57+
Path = "/";
58+
IconName = "VMware Clarity/Core/Avatar Line";
59+
Description = "This reflects the current logged-on user account, without domain.";
60+
CustomProperties = @{
61+
DOMAIN = $domain;
62+
}
63+
}
64+
)
65+
} | ConvertTo-Json -Depth 10 | Write-Host
66+
]]></Script>
67+
<DynamicCredentialScriptInterpreter>json</DynamicCredentialScriptInterpreter>
68+
</DynamicFolderExportObject>
69+
</Objects>
70+
</DynamicFolderExport>

Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfe

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<DynamicFolderExport>
2+
<Name>Dynamic Folder Export</Name>
3+
<Objects>
4+
<DynamicFolderExportObject>
5+
<Type>DynamicFolder</Type>
6+
<Name>LAPS (deprecated) (Windows PowerShell)</Name>
7+
<Notes><![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8+
<title></title>
9+
<style type="text/css">.cs2654AE3A{text-align:left;text-indent:0pt;margin:0pt 0pt 0pt 0pt}
10+
.csAF99984B{color:#000000;background-color:transparent;font-family:Calibri;font-size:14pt;font-weight:bold;font-style:normal;}
11+
.csC8F6D76{color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:normal;font-style:normal;}
12+
.cs26DADAAD{color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:normal;font-style:normal;text-decoration: none;}
13+
.csCCA9035D{color:#0000FF;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:normal;font-style:normal;text-decoration: underline;}
14+
.csCB8A910D{color:#000000;background-color:transparent;font-family:Calibri;font-size:12pt;font-weight:bold;font-style:normal;}
15+
.cs9579B52F{color:#3C3C3C;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:italic;}
16+
.cs56A2682C{color:#3C3C3C;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:normal;font-style:normal;}
17+
.cs747BF1FB{color:#000000;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:bold;font-style:italic;}
18+
.cs6DC30935{color:#3C3C3C;background-color:transparent;font-family:Calibri;font-size:11pt;font-weight:normal;font-style:normal;text-decoration: none;}
19+
</style>
20+
<p class="cs2654AE3A"><span class="csAF99984B">Local Administrator Password Solution (LAPS)</span></p>
21+
22+
<p class="cs2654AE3A"><span class="csC8F6D76">&nbsp;</span></p>
23+
24+
<p class="cs2654AE3A"><span class="csC8F6D76">More information on LAPS can be found here:<br />
25+
<a class="cs26DADAAD" href="https://www.microsoft.com/en-us/download/details.aspx?id=46899"><span class="csCCA9035D">https://www.microsoft.com/en-us/download/details.aspx?id=46899</span></a></span></p>
26+
27+
<p class="cs2654AE3A"><span class="csC8F6D76">&nbsp;</span></p>
28+
29+
<p class="cs2654AE3A"><span class="csCB8A910D">Requirements:</span></p>
30+
31+
<p class="cs2654AE3A"><span class="csC8F6D76">The dynamic credential script executes the </span><span class="cs9579B52F">Get-AdmPwdPassword</span><span class="cs56A2682C"> cmdlet of the </span><span class="cs9579B52F">AdmPwd</span><span class="cs747BF1FB">.</span><span class="cs9579B52F">PS</span><span class="cs56A2682C"> module:<br />
32+
<a class="cs6DC30935" href="https://www.powershellgallery.com/packages/AdmPwd.PS"><span class="csCCA9035D">https://www.powershellgallery.com/packages/AdmPwd.PS</span></a></span></p>
33+
34+
<p class="cs2654AE3A"><span class="cs56A2682C">Make sure the module is installed/available on your system!</span></p>
35+
36+
<p class="cs2654AE3A"><span class="csC8F6D76">&nbsp;</span></p>
37+
38+
<p class="cs2654AE3A"><span class="csCB8A910D">Configuration:</span></p>
39+
40+
<p class="cs2654AE3A"><span class="csC8F6D76">The dynamic folder script creates a list of available machine from the Active Directory. Configure the </span><span class="cs747BF1FB">SearchBase</span><span class="csC8F6D76"> path in the </span><span class="cs747BF1FB">Custom Properties</span><span class="csC8F6D76">.</span></p>
41+
]]></Notes>
42+
<CustomProperties>
43+
<CustomProperty>
44+
<Name>SearchBase</Name>
45+
<Type>Text</Type>
46+
<Value>TODO</Value>
47+
</CustomProperty>
48+
</CustomProperties>
49+
<ScriptInterpreter>powershell</ScriptInterpreter>
50+
<Script><![CDATA[$ErrorActionPreference = "Stop"
51+
52+
[string] $JSON = "{ `"Objects`" : [ `n"
53+
54+
$JSON += "{`n"
55+
$JSON += " `"Type`" : `"DynamicCredential`",`n"
56+
$JSON += " `"Name`" : `"Administrator`",`n"
57+
$JSON += " `"ID`" : `"LAPS`"`n"
58+
$JSON += "},`n"
59+
60+
foreach ($comp in (Get-ADComputer -SearchBase $CustomProperty.SearchBase$ -filter *))
61+
{
62+
$JSON += "{`n"
63+
$JSON += " `"Type`" : `"RemoteDesktopConnection`",`n"
64+
$JSON += " `"Name`" : `"$($comp.Name)`",`n"
65+
$JSON += " `"ComputerName`" : `"$($comp.DNSHostName)`",`n"
66+
$JSON += " `"Path`" : `"Connections`",`n"
67+
$JSON += " `"CredentialID`" : `"LAPS`"`n"
68+
$JSON += "},`n"
69+
}
70+
71+
$JSON = $JSON.Substring(0, $JSON.Length - 2)
72+
$JSON += "`n]`n}`n"
73+
74+
Write-Host $JSON]]></Script>
75+
<DynamicCredentialScriptInterpreter>powershell</DynamicCredentialScriptInterpreter>
76+
<DynamicCredentialScript><![CDATA[$ErrorActionPreference = "Stop"
77+
78+
Import-Module AdmPwd.PS
79+
80+
$Pass = Get-AdmPwdPassword -Computername $Target.Name$
81+
82+
$JSON = ""
83+
$JSON += "{`n"
84+
$JSON += " `"Username`" : `".\\Administrator`",`n"
85+
$JSON += " `"Password`" : `"$($Pass.Password)`"`n"
86+
$JSON += "}`n"
87+
88+
Write-Host $JSON
89+
90+
91+
]]></DynamicCredentialScript>
92+
</DynamicFolderExportObject>
93+
</Objects>
94+
</DynamicFolderExport>

0 commit comments

Comments
 (0)