[active-directory] How do I find out where login scripts live?

I am looking for a way (manual or progamatic) to find out where the user's activer directory login script is located.

I can parse the results of "net user" to get the script name, but that doesn't tell me what file share the script lives on.

This question is related to active-directory

The answer is


In addition from the command prompt run SET.

This displayed the "LOGONSERVER" value which indicates the specific domain controller you are using (there can be more than one).

Then you got to that server's NetBios Share \Servername\SYSVOL\domain.local\scripts.


The default location for logon scripts is the netlogon share of a domain controller. On the server this is located:

%SystemRoot%'SYSVOL'sysvol''scripts

It can presumably be changes from this default but I've never met anyone that had a reason to.

To get list of domain controllers programatically see this article: http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1216.mspx