From 280a3cb14b4a4c6ceda04f9544acb71f0155a1c1 Mon Sep 17 00:00:00 2001 From: eiabea Date: Fri, 13 Dec 2024 15:17:44 +0100 Subject: [PATCH] [Refactor] Transform all microsoft samples to rdfx --- .../CurrentAccount (Windows PowerShell).rdfe | 1 - .../CurrentAccount (Windows PowerShell).rdfx | 70 ++++++++++++++ ...APS (deprecated) (Windows PowerShell).rdfe | 1 - ...APS (deprecated) (Windows PowerShell).rdfx | 94 +++++++++++++++++++ 4 files changed, 164 insertions(+), 2 deletions(-) delete mode 100644 Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfe create mode 100644 Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfx delete mode 100644 Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfe create mode 100644 Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfx diff --git a/Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfe b/Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfe deleted file mode 100644 index 15ca85c..0000000 --- a/Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfe +++ /dev/null @@ -1 +0,0 @@ -{"Name":"Dynamic Folder Export","Objects":[{"Type":"DynamicFolder","Name":"Current Account","Description":"This returns dynamic objects reflecting data from the current user account.","Notes":"\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t

Version: 1.0

Requirements

 

\r\n\t\r\n\r\n","ScriptInterpreter":"powershell","DynamicCredentialScriptInterpreter":"json","Script":"$ErrorActionPreference = \"Stop\"\r\n\r\n# get data\r\n$account = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name\r\n$domain = $account.split(\"\\\")[0]\r\n$username = $account.split(\"\\\")[1]\r\n\r\n# output objects\r\n@{\r\n Objects = @(\r\n @{\r\n ID = \"CURRENT_DOMUSER\";\r\n Type = \"Credential\";\r\n Name = \"Current UserName with domain\";\r\n Username = $account;\r\n Password = \"\";\r\n Path = \"/\";\r\n IconName = \"VMware Clarity/Core/Avatar Solid\";\r\n Description = \"This reflects the current logged-on user account, including domain.\";\r\n CustomProperties = @{\r\n DOMAIN = $domain;\r\n USERNAME = $username;\r\n }\r\n },\r\n @{\r\n ID = \"CURRENT_USERNAME\";\r\n Type = \"Credential\";\r\n Name = \"Current UserName without domain\";\r\n Username = $username;\r\n Password = \"\";\r\n Path = \"/\";\r\n IconName = \"VMware Clarity/Core/Avatar Line\";\r\n Description = \"This reflects the current logged-on user account, without domain.\";\r\n CustomProperties = @{\r\n DOMAIN = $domain;\r\n }\r\n }\r\n )\r\n} | ConvertTo-Json -Depth 10 | Write-Host\r\n"}]} \ No newline at end of file diff --git a/Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfx b/Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfx new file mode 100644 index 0000000..5422898 --- /dev/null +++ b/Dynamic Folder/Microsoft/Windows/CurrentAccount (Windows PowerShell).rdfx @@ -0,0 +1,70 @@ + + Dynamic Folder Export + + + DynamicFolder + CurrentAccount (Windows PowerShell) + This returns dynamic objects reflecting data from the current user account. + + + +

Version: 1.0

+ +

Requirements

+ +

 

+ +
    +
  • Working PowerShell installation
  • +
  • PowerShell Script Interpreter correctly configured in Royal TS/X
  • +
+]]>
+ powershell + + json +
+
+
diff --git a/Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfe b/Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfe deleted file mode 100644 index e480ee6..0000000 --- a/Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfe +++ /dev/null @@ -1 +0,0 @@ -{"Name":"Dynamic Folder Export","Objects":[{"Type":"DynamicFolder","Name":"Server (LAPS)","Notes":"\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t

Local Administrator Password Solution (LAPS)

 

More information on LAPS can be found here:
https://www.microsoft.com/en-us/download/details.aspx?id=46899

 

Requirements:

The dynamic credential script executes the Get-AdmPwdPassword cmdlet of the AdmPwd.PS module:
https://www.powershellgallery.com/packages/AdmPwd.PS

Make sure the module is installed/available on your system!

 

Configuration:

The dynamic folder script creates a list of available machine from the Active Directory. Configure the SearchBase path in the Custom Properties.

\r\n\r\n","CustomProperties":[{"Name":"SearchBase","Type":"Text","Value":"OU=Server,OU=contoso,DC=com"}],"ScriptInterpreter":"powershell","DynamicCredentialScriptInterpreter":"powershell","DynamicCredentialScript":"$ErrorActionPreference = \"Stop\"\r\n\r\nImport-Module AdmPwd.PS\r\n\r\n$Pass = Get-AdmPwdPassword -Computername $Target.Name$\r\n\r\n$JSON = \"\"\r\n$JSON += \"{`n\"\r\n$JSON += \" `\"Username`\" : `\".\\\\Administrator`\",`n\"\r\n$JSON += \" `\"Password`\" : `\"$($Pass.Password)`\"`n\"\r\n$JSON += \"}`n\"\r\n\r\nWrite-Host $JSON\r\n\r\n\r\n","Script":"$ErrorActionPreference = \"Stop\"\r\n\r\n[string] $JSON = \"{ `\"Objects`\" : [ `n\"\r\n\r\n$JSON += \"{`n\"\r\n$JSON += \" `\"Type`\" : `\"DynamicCredential`\",`n\"\r\n$JSON += \" `\"Name`\" : `\"Administrator`\",`n\"\r\n$JSON += \" `\"ID`\" : `\"LAPS`\"`n\"\r\n$JSON += \"},`n\"\r\n\r\nforeach ($comp in (Get-ADComputer -SearchBase $CustomProperty.SearchBase$ -filter *))\r\n{\r\n $JSON += \"{`n\"\r\n $JSON += \" `\"Type`\" : `\"RemoteDesktopConnection`\",`n\"\r\n $JSON += \" `\"Name`\" : `\"$($comp.Name)`\",`n\"\r\n $JSON += \" `\"ComputerName`\" : `\"$($comp.DNSHostName)`\",`n\"\r\n\t$JSON += \" `\"Path`\" : `\"Connections`\",`n\"\r\n\t$JSON += \" `\"CredentialID`\" : `\"LAPS`\"`n\"\r\n $JSON += \"},`n\"\r\n}\r\n\r\n$JSON = $JSON.Substring(0, $JSON.Length - 2)\r\n$JSON += \"`n]`n}`n\"\r\n\r\nWrite-Host $JSON"}]} diff --git a/Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfx b/Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfx new file mode 100644 index 0000000..8d7e64e --- /dev/null +++ b/Dynamic Folder/Microsoft/Windows/LAPS (deprecated) (Windows PowerShell).rdfx @@ -0,0 +1,94 @@ + + Dynamic Folder Export + + + DynamicFolder + LAPS (deprecated) (Windows PowerShell) + + + +

Local Administrator Password Solution (LAPS)

+ +

 

+ +

More information on LAPS can be found here:
+https://www.microsoft.com/en-us/download/details.aspx?id=46899

+ +

 

+ +

Requirements:

+ +

The dynamic credential script executes the Get-AdmPwdPassword cmdlet of the AdmPwd.PS module:
+https://www.powershellgallery.com/packages/AdmPwd.PS

+ +

Make sure the module is installed/available on your system!

+ +

 

+ +

Configuration:

+ +

The dynamic folder script creates a list of available machine from the Active Directory. Configure the SearchBase path in the Custom Properties.

+]]>
+ + + SearchBase + Text + TODO + + + powershell + + powershell + +
+
+