Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Windows User name to Gcode


Recommended Posts

In X7, we have a new function to get this information.

 

str1 = sysinfo(*val1, val2)

 

val1 = return 0 on failure, 1 if success

val2 = option for function (mode)

str1 = return string based on val2

Option 0 = NameUnknown - An unknown name type, really

 

Option 1 = NameFullyQualifiedDN - The fully-qualified distinguished name (for example, CN=Jeff Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com)

 

Option 2 = NameSamCompatible - A legacy account name (for example, Engineering\JSmith). The domain-only version includes trailing backslashes (\\)

 

Option 3 = NameDisplay - A "friendly" display name (for example, Jeff Smith). The display name is not necessarily the defining relative distinguished name (RDN)

 

Option 4 = NameUniqueId - A GUID string that the IIDFromString function returns (for example, {4fa050f0-f561-11cf-bdd9-00aa003a77b6})

 

Option 5 = NameCanonical - The complete canonical name (for example, engineering.microsoft.com/software/someone). The domain-only version includes a trailing forward slash (/)

 

Option 6 = NameUserPrincipal - The user principal name (for example, [email protected])

 

Option 7 = NameCanonicalEx - The same as NameCanonical except that the rightmost forward slash (/) is replaced with a new line character (\n), even in a domain-only case (for example, engineering.microsoft.com/software\nJSmith)

 

Option 8 = NameServicePrincipal - The generalized service principal name (for example, www/[email protected])

 

Option 9 = NameDnsDomain - The DNS domain name followed by a backward-slash and the SAM user name

 

 

You probably want to use '3' for 'val2'. This is the 'Friendly' name.

 

I started by creating a new string variable:

 

susername : ""

 

Then I used it in a function:

 

susername = sysinfo(result, 3)

 

This gave me the string: 'Colin M. Gilchrist' for output.

 

(Note that 'result' is a common 'user-defined' variable that is used as a return variable for functions. You need to be sure 'result' is already initialized, or use a different variable for the return.)

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...