System Center Orchestrator
A family of System Center products that provide an automation platform for orchestrating and integrating both Microsoft and non-Microsoft IT tools.
252 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Is there a possibility to mask the .Net Activity Output Value in the logs without deactivate "storing published data" to pass through sensible data.
Hi,
As far as I know, .Net Activity does not have this feature built-in.
To mask the PowerShell output value in logs without deactivating "storing published data," you can use several techniques to ensure sensitive data is not exposed.
Here are some approaches:
Convert sensitive data to a SecureString
to prevent it from being logged in plain text.
# Convert plain text password to SecureString
$password = ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force
# Use the SecureString in your command
$credential = New-Object System.Management.Automation.PSCredential ("username", $password)
You can use regex to mask sensitive data before logging it.
# Function to mask sensitive data
function Mask-SensitiveData {
param (
[string]$input
)
# Example: Mask email addresses
$input -replace '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}', '*****'
}
# Example usage
$output = "User email: user@example.com"
$maskedOutput = Mask-SensitiveData -input $output
Write-Output $maskedOutput