RunAs Application Launcher
#23
Posted 25 April 2005 - 10:59 PM
wfuehrer, on Apr 25 2005, 11:40 AM, said:
You say: " Just a moment darling ...." and after some time you forgot her :)
That's the hard live of programmes (hard for the darlings, too) :">
Haha, I guess I could say I'm lucky I don't have a "darling."
So how does the Domain field work for you Wolfgang? Is it all right?
#25
Posted 26 April 2005 - 08:04 PM
JerichoJones, on Apr 26 2005, 02:57 PM, said:
A little probing yielded:
In NETAPI32.DLL
NetUserEnum
NET_API_STATUS NetUserEnum(
LPCWSTR servername,
DWORD level,
DWORD filter,
LPBYTE* bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resume_handle
);
http://msdn.microsoft.com/library/default....netuserenum.asp
#26
Posted 26 April 2005 - 10:46 PM
Saunders, on Apr 22 2005, 06:11 PM, said:
Unfortunately, I can't seem to get past "HKLM\SAM\SAM," in either RegEdit, or AutoIt's Reg* commands.
*Edit 2: I just noticed this from Registry Monitor:
4:22:35.662 PM AutoIt3.exe:2592 OpenKey HKLM\SAM\SAM\DOMAINS\Account\Users\Names\Administrator ACCDENIED Access: 0x20019 FAMILY\rob
I know how to get around that! :idea: A little thing nakuribon came up with:
RunWait(@ComSpec & ' /c ' & 'at ' & @HOUR & ':' & @MIN + 1 & ' /interactive "regedit.exe"', "", @SW_HIDE)
It opens regedit as the SYSTEM username so you can access past the SAM keys!
#27
Posted 26 April 2005 - 10:52 PM
JerichoJones, on Apr 26 2005, 11:04 AM, said:
In NETAPI32.DLL
NetUserEnum
NET_API_STATUS NetUserEnum(
LPCWSTR servername,
DWORD level,
DWORD filter,
LPBYTE* bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resume_handle
);
http://msdn.microsoft.com/library/default....netuserenum.asp
Nice find. I had found references to a function called "NetUserEnum" but nothing definitive. I'll look into this.
erifash, on Apr 26 2005, 01:46 PM, said:
RunWait(@ComSpec & ' /c ' & 'at ' & @HOUR & ':' & @MIN + 1 & ' /interactive "regedit.exe"', "", @SW_HIDE)
It opens regedit as the SYSTEM username so you can access past the SAM keys!
"at" ? I'm not at home so I can't try this yet (this system uses WinME, yuck), but I've never seen the "at" command before... Thanks.
#28
Posted 26 April 2005 - 11:00 PM
Saunders, on Apr 26 2005, 04:52 PM, said:
"at" ? I'm not at home so I can't try this yet (this system uses WinME, yuck), but I've never seen the "at" command before... Thanks.
the at command is listed when you type in "help"...
Quote
Youre welcome! :)
#30
Posted 28 April 2005 - 09:09 AM
Saunders, on Apr 23 2005, 01:11 AM, said:
There are no more keys on our pc's unter this tree .....
I tested the changings in our domain and it's working fine. Keep in mind not to start the program from a network share. After first login step (switching user) the share is no longer mapped and the restart of RunAs will fail.
Thank you :king: for the excellent work ... :D
#31
Posted 29 April 2005 - 01:20 AM
wfuehrer, on Apr 28 2005, 12:09 AM, said:
Hmm. Maybe I can have a check for that... if you don't mind, see if a FileExists() returns the file as being there or not. I think I will have it check that, and if the file is not there then the Switch Users command will be disabled.
Quote
Thank you for helping to test it.
#32
Posted 30 April 2005 - 11:44 PM
JerichoJones, on Apr 26 2005, 11:04 AM, said:
In NETAPI32.DLL
NetUserEnum
NET_API_STATUS NetUserEnum(
LPCWSTR servername,
DWORD level,
DWORD filter,
LPBYTE* bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resume_handle
);
http://msdn.microsoft.com/library/default....netuserenum.asp
I can't figure out how to get this to work.
Currently, I'm trying this code, but it just keeps hard crashing AutoIt (windows error box, etc)
$FILTER_TEMP_DUPLICATE_ACCOUNT = 0x0001 $var = DllCall('NetApi32.dll', 'str', 'NetUserEnum', _ 'str', '', _ 'int', 0, _ 'int', $FILTER_TEMP_DUPLICATE_ACCOUNT, _ 'ptr', 0, _ 'int', 100, _ 'int', 0, _ 'int', 0, _ 'int', 0)
Any ideas? I'm a virtual know-nothing when it comes to DllCall. :(
erifash, on Apr 26 2005, 01:46 PM, said:
RunWait(@ComSpec & ' /c ' & 'at ' & @HOUR & ':' & @MIN + 1 & ' /interactive "regedit.exe"', "", @SW_HIDE)
It opens regedit as the SYSTEM username so you can access past the SAM keys!
While this method is awesome (it completely opens up the SAM key) in one way, it's no good in another. It can take up to a full minute before the scheduled command would run. Waiting that long just to get a list of users is not a viable option. Thanks though. I need to see if I can get this information with RegRead in some other way...
At the moment though, I'm liking this method the most:
$usernames = '' $oDomain = ObjGet("WinNT://" & @ComputerName) For $oDomainItem In $oDomain If $oDomainItem.Class = "User" Then $usernames &= $oDomainItem.Name & @LF EndIf Next
Only problem is that it's fairly slow (about 2 seconds).
This post has been edited by Saunders: 01 May 2005 - 12:01 AM
#33
Posted 06 May 2005 - 10:10 AM
I'm working with this tool every day and have many entries.
It would be nice to get a sorted history list to find the programs more easy.
So i modified the _LoadHistory() Function:
Quote
Global $s_MRUList = RegRead($s_RegKey & '\MRUList', '')
Global $a_MRUList = StringSplit($s_MRUList, '')
Global $a_HistoryItems[$a_MRUList[0]+ 1]
$a_HistoryItems[0] = $a_MRUList[0]
GuiCtrlSetData($gui_Main_va_OpenCmd, '')
For $i = 1 To $a_MRUList[0]
$s_RegRead = RegRead($s_RegKey & '\MRUList', $a_MRUList[$i])
If @error Or $s_RegRead = '' Then
ContinueLoop
EndIf
$s_Alph = StringReplace($s_Alph, $a_MRUList[$i], '')
$a_HistoryItems[$i] = StringReplace($s_RegRead, '|', '')
; ### here disabled ###
;GuiCtrlSetData($gui_Main_va_OpenCmd, $a_HistoryItems[$i], $a_HistoryItems[1])
Next
; ### order array ###
_ArraySort($a_HistoryItems,0,1)
For $i = 1 To $a_MRUList[0]
GuiCtrlSetData($gui_Main_va_OpenCmd, $a_HistoryItems[$i], $a_HistoryItems[1])
Next
EndFunc;<==_LoadHistory
You have to insert the _ArraySort(), __ArrayQuickSort1D() and __ArrayQuickSort2D() functions from the Include folder, too.
This post has been edited by wfuehrer: 06 May 2005 - 11:21 AM
#34
Posted 07 May 2005 - 08:20 PM
#35
Posted 08 May 2005 - 02:10 PM
The idea of an Favorites/Bookmark menu is great. It would be nice to have a possibility to give a bookmark a name to shorten the full path entry.
But i thing that's some work to enhance the structure and adding an extra dialog for the input of an ordinary name.
I'm working as admin in a domain and have a lot of tools which i have to start with "Runas ..." to get the necessary permissions. Your tool simplify my daily work with userhelp and server administration.
#36
Posted 09 May 2005 - 01:40 AM
#37
Posted 31 January 2008 - 09:42 PM
Thank you for sharing your script.
I did a runas script with another approach :
http://www.autoitscript.com/forum/index.ph...c=62677&hl=
It helps you creating runas shortcuts in the start menu.
Greetings
Lou

Sign In
Register
Help


MultiQuote