SID Function (Database)

Retrieves the security identifier (SID) of a Windows user account.

Sid := SID(UserAccount);

Parameters

  • UserAccount
    The Windows user account for which you want to get the SID. You must specify a domain and user name, such as 'cronus\simon'.

Property Value/Return Value

Type: Text

The SID of the specified Windows user account.

Remarks

In the Classic client, if you add an alias to the Windows Logins form, then the SID for the alias is automatically added to the form. The SID is the primary key on the Windows Login table. In the RoleTailored client, if you create a page for adding Windows logins, then you must use the SID function to retrieve the SID for the user account so that you can enter the new login into the Windows Login table.

This function only runs on the computer running Microsoft Dynamics NAV Server. If you call this function from the Classic client, then no action occurs.

Example

This example assigns the SID for Simon's Windows user account to a variable. This example requires that you create the following variables.

Name DataType Length

NewSID

Text

119

UserAccount

Text

132

UserAccount := 'cronus\simon';
NewSID := SID(UserAccount);

See Also

Reference

SYNCHRONIZEALLLOGINS Function (Database)
SYNCHRONIZESINGLELOGIN Function (Database)

Concepts

Security Model and Synchronization