Created
November 4, 2014 15:51
-
-
Save jonman364/982a38f962f258d52625 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim objNet, objShell, objProcess | |
Dim userObj | |
Dim dc, domain, username, logonscript | |
Set objNet = CreateObject("WScript.Network") | |
Set objShell = CreateObject("WScript.Shell") | |
Set objProcess = objShell.Environment("Process") | |
domain = objNet.UserDomain | |
username = objNet.UserName | |
dc = objProcess("LogonServer") | |
Set userObj = GetObject("WinNT://" & domain & "/" & username) | |
logonscript = dc & "\netlogon\" & userObj.LoginScript | |
WScript.Echo logonScript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment