For a setup I am creating I am required to retrieve the end user's primary domain controller and place it in a property, so that is becomes the default value.

The catch is that I cannot use VBScript, WiseScript, or any other kind of script to grab it.

Is there any way I can call a DLL or something to pull the server name into a property?
e.g. netapi32.dll

I am a n00b when it comes to making calls to DLLs.

Thanks
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
you can use app search to get the a registry value under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

DefaultDomainName

and update a property.
Answered 03/29/2006 by: bheers
Second Degree Blue Belt

Please log in to comment
0
You can also use the environment variable like this:

[%USERDOMAIN]


A useful page in the sdk for info like this is the "formatted" page
Answered 03/29/2006 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
Thanks guys.

I forgot to mention that I tried the above, but I need the server name without the leading backslashes that are included in that environment variable.

Is it possible to exclude them without any scripting?
Answered 03/30/2006 by: OldWiseMan
Senior Yellow Belt

Please log in to comment
0
You'd have to parse them off with wise script or vb script.
The variable I included will give you the domain not the domain controller. Sorry I misread the question, I guess your using [%LOGONSERVER].

You can get the PDC by calling the netapi32.dll the function is NetGetDCName. But that's as far as I go with dll calls I'm afraid!!
Answered 03/30/2006 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
Cool thanks.

One more question.

Is there any way to pass the output of a commandline application such as DSQUERY.EXE to a property?
Answered 03/30/2006 by: OldWiseMan
Senior Yellow Belt

Please log in to comment
0
Not as far as I know. The only way you could do it is if you can write the output of the command line utility to somewhere you can read it. e.g a reg key
Answered 03/30/2006 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
If you're using Wise you can populate the Windows Installer property like so:
[%LOGONSERVER]
If I find a way to extract the backslashes without any kind of script, i'll let you know. Thanks!
Answered 03/30/2006 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
I found a way to do it with an embedded VBscript. Not sure how one might do it via a a Windows API, but there's sure to be some way.

Let me know if you're interested.
Answered 03/30/2006 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
Cheers lads.

In the end I got permission to use an embedded WiseScript to parse the environment variable to remove the "\\".
Answered 03/31/2006 by: OldWiseMan
Senior Yellow Belt

Please log in to comment
0
cheers mate [;)] i think your sol. is tighter actually (relies less on vbscript, which really kinda sux).

MSFT recommends agains vbscript in custom actions because you can't guarantee a roll back.
Answered 03/31/2006 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
This command will show you the PDC
'net time /domain:domainname'
you could pipe that into a .txt file

net time /domain:domainname >> c:\temp\PDCinfo.txt

and then parse that file to read the PDC into a variable.
Answered 03/31/2006 by: Foleymon
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity