|
| 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"> </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"> </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"> </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