Forum: Win32/Win64 API (native code)
Delphi
by Remko,
23. Mär 2010
To determine if a Domain Controller is a Global Catalog you can use DsGetDomainControllerInfo and infolevel 2, this returns a DS_DOMAIN_CONTROLLER_INFO_2 structure (fIsGc flag):
DS_DOMAIN_CONTROLLER_INFO_2W = record
NetbiosName: LPWSTR; // might be NULL
DnsHostName: LPWSTR; // might be NULL
SiteName: LPWSTR; // might be NULL
SiteObjectName: LPWSTR; // might be NULL
...
Forum: Win32/Win64 API (native code)
Delphi
by Remko,
23. Mär 2010
Since you just created the user you already have it's SID!
Just retrieve it with IADs(User).Get('ObjectSid'), it will return the Sid as a PByteArray. You can cast it to PSid using VarArrayLock.