DomTrust Sample: Manage Trusted Domains

Click to open or copy the files for the DomTrust sample.

Click to open or copy the Include files (required).

The DomTrust sample illustrates how to manage Windows® NT trusted domains at the domain controller level.

The first command line argument indicates the name of the new or existing trusted domain to create or modify.

The second command line argument indicates the new password for the trusted domain specified in the first argument.

The optional third argument indicates the domain name that is the target of the trusted domain update operation. If this argument is not specified, the update will occur on the local domain. Note that this sample will not allow a trusted domain update to occur on a nondomain controller.

This sample works correctly when compiled as ANSI or Unicode. Note that the LAN Manager NetXxx APIs are Unicode only, and the Windows NT LSA APIs are Unicode only.

Building SDK Samples

This sample uses the following keywords:

copysid; displayerror; displayntstatus; formatmessagea; fprintf; freelibrary; freesid; getdomainsid; getlasterror; getlengthsid; getprocessheap; getstdhandle; heapalloc; heapfree; initlsastring; isvalidsid; loadlibraryex; localfree; lsaclose; lsadeletetrusteddomain; lsafreememory; lsantstatustowinerror; lsaopenpolicy; lsaquerytrusteddomaininfo; lsasettrusteddomaininformation; lstrcatw; lstrcmpiw; lstrcpyw; lstrlenw; makelangid; netapibufferfree; netgetdcname; netservergetinfo; netuseadd; netusedel; netusermodalsget; openpolicy; printf; setlasterror; settrusteddomaininfo; switch; text; towupper; verifytrustrelationship; wmain; writefile; zeromemory