I am trying to set up a field on the Web UI to be populated when a computer object is viewed using a script. For example: Users look at the properties of a AD computer -> script is executed, and the result is shown in a read only field.
Thanks!
I am trying to set up a field on the Web UI to be populated when a computer object is viewed using a script. For example: Users look at the properties of a AD computer -> script is executed, and the result is shown in a read only field.
Thanks!
Did you abandon your onGetEffectivePolicy handler?
My previous comment assumed you were still using that.
I am trying different things seeing if any of it works. :) The updated script should show the value in the web ui field without clicking on an icon. Just failing to get any value at all to be displayed.
I would start by placing a static line of text in the Request.Put line, just to see if things are linked and referenced properly and to see something displayed in the web interface.
$Request.Put($strAttrname, "From onPostGet Handler")
If this is successful, then there is something up with the PowerShell cmdlet populating $customValue. It is not erroring out, but it does not seem to be returning a value. You can also use native Active Roles cmdlets to get to the same information. Example:
# Retrieve LAPS password from AD $objComp = Get-QADComputer -Proxy -Identity $machineName -IncludedProperties "ms-Mcs-AdmPwd" [string]$customValue = $objComp." ms-Mcs-AdmPwd"
Thanks for the suggestion. The updated $Request.Put did display on the web ui as you suggested above so that is working. The issue is more likely the Powershell. I would love to use native cmdlets but this is the new Windows LAPS that was released in the April patches. This update uses new attributes in AD but the password is encrypted at rest. This means I can't just display the attribute value. :) I need to run the PowerShell command within the script to have it get the password and display it as plain text. I have validated the ARS servers can do this command find via the PS prompt.
I finally figured it out. The powershell command was not just outputting the value of the password which was causing it to be confused.
Updated: $customValue = Get-LapsADPassword -Identity "$machineName" -AsPlainText | ForEach-Object { $_.Password }
That's great to hear. And thanks for the encryption info on the LAPS pw now.