Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

WindowsCredentials.Write

Creates a new credential or modifies an existing credential in the user's credential set.

Component Version macOS Windows Linux Server iOS SDK
WindowsCredentials 16.5 ❌ No ✅ Yes ❌ No ❌ No ❌ No
MBS( "WindowsCredentials.Write"; Credential )   More

Parameters

Parameter Description Example
Credential The JSON with the details for the new object.

Result

Returns OK or error.

Description

Creates a new credential or modifies an existing credential in the user's credential set.
The new credential JOSN may contain:
  • TargetName
  • Comment: Optional.
  • UserName: The user name.
  • Persist: Optional, can be Session, Enterprise, LocalMachine or None.
  • CredentialBlob: Hex encoded credential data.
  • CredentialText: Credentials as text as alternative to CredentialBlob.
  • Attributes: Array of JSON with entries for attributes with Flags, Keyword, ValueText and/or ValueBlob.

Examples

Write a new credential:

MBS( "WindowsCredentials.Write";
JSONSetElement ( "{}";
    ["TargetName"; "FMTest2"; JSONString];
    ["Comment"; "Just a test"; JSONString];
    ["Persist"; "LocalMachine"; JSONString];
    ["CredentialText"; "test"; JSONString];
    ["Attributes[0].Keyword"; "id"; JSONString];
    ["Attributes[0].ValueText"; "1234"; JSONString]
))

Add a password for a FileMaker database:

MBS( "WindowsCredentials.Write";
JSONSetElement ( "{}";
    ["TargetName"; "FMP: Assets"; JSONString];
    ["UserName"; "Admin"; JSONString];
    ["Comment"; "FileMaker Pro password"; JSONString];
    ["Persist"; "LocalMachine"; JSONString];
    ["CredentialText"; "test"; JSONString]
))

See also

This function checks for a license.

Created 20th October 2026, last changed 28th October 2026


WindowsCredentials.SessionTypes - WindowsLocation.Initialize


MarkDown version: WindowsCredentialsWrite.md