Converting an SID byte array into an SID string
Hello Decisions,
The Active Directory module provides steps to retrieve data from MS Active Directory servers, including querying an account by its SID. These steps can return the Object SID as a base-64 encoded string or a byte array, but there's no way to convert the Object SID byte array into a SID string. This gap complicates the coordination of local accounts with Active Directory.
Is there a way to convert an SID byte array into a SID string?
Comments
-
Hey,
Thanks for using the Decisions Community Forum!
This is something you can absolutely do with the use of the PowerShell Module!
To accomplish this, first ensure you have the PowerShell module installed correctly, here are the steps to Install the module: https://documentation.decisions.com/v9/docs/installing-modules-decisions#from-the-platform
Once the module is installed, you'll need to create a PowerShell script step, you can follow this documentations example to set this up, I'll provide you with what to put in the fields next:
https://documentation.decisions.com/docs/powershell#example
In the fields, you'll want to input this information:
ScriptName: An Identifiable name
Inputs: base64String
Script: (Don't include the first and last single quote)
'
$byteArray = [System.Convert]::FromBase64String($base64String)
if ($byteArray.Length -lt 28) {
Return "Error: The byte array length is too short for a valid SID."
} else {
$sid = [System.Security.Principal.SecurityIdentifier]::new($byteArray, 0)
$SIDString = $sid.Value
Return $SIDString
}
'
Outputs: Leave this blank, and hit Save.
Once you've created this script, create a flow, and place the script step you just created into it, you can find the step in the toolbox > Integration > Powershell > Name of script folder > Your script step. The step itself will want an input for the base64String, which you can declare as a constant, or feed a value into it.
This should resolve your conversion.
Regards,
Levi | Decisions Support
Howdy, Stranger!
Categories
- 4.2K All Categories
- 68 General
- 11 Training
- 203 Installation / Setup
- 1.1K Flows
- 108 Rules
- 262 Administration
- 212 Portal
- 494 General Q & A
- 698 Forms
- 334 Reports
- 3 Designer Extensions
- 47 Example Flows
- 53 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 180 Pages
- 5 Process Mining
- New Features
- 179 Datastructures
- 69 Repository
- 221 Integrations
- 28 Multi-Tenant
- 27 SDK
- 80 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 92 Lunch And Learn Questions