Jump to content

UniPer

Active Members
  • Posts

    26
  • Joined

  • Last visited

UniPer's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Why don't you use PSEXEC from the Sysinternals (http://technet.microsoft.com/en-us/sysinternals/bb842062) to start the prompt with other credentials?
  2. Really...really..thanks! Great job...I see what you did..it makes me understand it a lot better now! Thanks again.. Cheers, UniPer
  3. Sorry, I read the topic but I really don't know how to use it with my script. I included the function but I still have got the same issue...I'm not that experienced. Can please tell me, or put in the right direction, where I went wrong: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "Misc.au3" HotKeySet ( "^g", "google" ) HotKeySet ( "^l", "linkedin" ) HotKeySet ( "^f", "facebook" ) HotKeySet ( "^h", "hyves" ) While 1 sleep(100) WEnd ;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys still down. ;Requires misc.au3 to be included in the script for the _IsPressed function. Func _SendEx($ss, $warn = "") Local $iT = TimerInit() While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12") If $warn <> "" And TimerDiff($iT) > 1000 Then MsgBox(262144, "Warning", $warn) EndIf Sleep(50) WEnd Send($ss) EndFunc;==>_SendEx Func google() Send ("username") Send ("{TAB}") Send ("password") Send ("{Enter}") _SendEx("{LCTRL}"); EndFunc Func linkedin() Send ("username") Send ("{TAB}") Send ("password") Send ("{Enter}") _SendEx("{LCTRL}"); EndFunc Func facebook() Send ("username") Send ("{TAB}") Send ("password") Send ("{Enter}") _SendEx("{LCTRL}"); EndFunc Func hyves() Send ("username") Send ("{TAB}") Send ("password") _SendEx("{LCTRL}"); EndFunc Exit
  4. Hi All, I'm trying to create a script that makes it able to just hit a combination like CTRL+G to login to Gmail.com and CTRL+F to login on Facebook. The problem is that when I used one of those hotkeys it seems to hold down the CTRL button so everytime I hit the 'F' or 'G' it runs the function. My script below: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** HotKeySet ( "^g", "google" ) HotKeySet ( "^l", "linkedin" ) HotKeySet ( "^f", "facebook" ) HotKeySet ( "^h", "hyves" ) While 1;loop forever sleep(100) WEnd Func Google() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Func linkedin() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Func facebook() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Func hyves() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Exit Why is that happening?
  5. It doesn't have to be webbased, the ping script can just run local on one of the servers, the only thing I need is that the scriptgenerates a HTML file with the ping results so I can load that on the Intranet server.
  6. If I only would know how that script runs and what it does... :S Pfff... But thanks for your input, I'll have a look at it.
  7. Ok..the problem is that my php knowlegde is not very good so I'm just able to read and change existing scripts and that's it. I want the output to be like this: Click Here Where the icon is red when the host is unavailable and green when it's online. Can please give me push in the right direction or help me with this script? Kind Regards, UniPer
  8. Hi All, This is what the script should do: 1. Run in 'hide'/'background' mode 1. reads a list of servers from a *.txt file 2. start a ping command to each server 3. create an output file in html format with the status of each server I really don't know where to start....... It's no problem to run the ping command, it's also no problem to run the script in 'hide'/'background' mode. But the rest......???? What we want is to make a php page available for all our employees so that they can check if a server is on- or offline. I tried to do it with php but that also gave me some problems I could't solve.. Can someone please advise/help me on what to do and how to start? Thanks in advance, Kind Regards, UniPer
  9. You can try this command to see if it works, I've tested this command myself and I know it works. If this fails aswell it has nothing to do with your script method: RunWait (@Comspec & ' /k ' & $netdom & ' join . /Domain:DOMAIN.COM /UserD:deploy /PasswordD:xxxx ') Cheers,
  10. Ok...still one problem When I join this PC to the domain with Windows it's automaticly moved to the right container: \Company\Europe\Country\Workstations When I use the script to join the PC to the domain it's being added to: \Computers The problem is that none of the machines in the \Computers folder gets the company policy I tried to use the netdom command as follows: netdom join . /domain:domain.com /ou:"Company\Europe\Country\Workstations" /UserD:admin /PasswordD:password The strange thing is that when I try that it's giving me the message: Username or Password incorrect or insuffient privelleges. If I change the string to: netdom join . /domain:domain.com /UserD:admin /PasswordD:password /OU:"OU=corporate\europe\computers,DC=domain,DC=com" I get the message that the account allready exicists, but I perform a full domain search for the account it doesn't excist. Whaaa...I'm going crazy Anyone know what to do?
  11. Got it working now. For all who are intrested in how I managed it all I attachted the script. Below I'll explain which files I used and where I used them for: 1. newsid.exe --> To change the SystemID 2. Forum Script --> To rename the PC 3. NETDOM.EXE --> To join the PC to the Domain 4. restore_reg.reg --> To disable the autlogon by resetting so keys and value's 5. stage1.chk / stage2.chk / stage3.chk --> After every part of the script 1 file is copied to the windows dir so the script knows what to do next time it runs. #include <GUIConstants.au3> ;This script will silently join the PC to the domain and rename it conform the Company Policy. ;Written with: SciTE4AutoIt3 Version 1.76 ;Compiled with: AutoIt v3.2.12.1 ;This script will run just once ;Created by UniPer ;Variables must be declared before using them AutoItSetOption("TrayMenuMode",1) ;The name of the application (used as title for message boxes) Global $appName = "Domain Tool V1.1" Global $logonFlag = 0 ; 0 - Interactive logon with no profile. 1 - Interactive logon with profile. 2 - Network Global $extraParameters = " /silent" ; " /silent" "" Global $runAsWaitFlag = @SW_SHOW ; @SW_HIDE @SW_SHOW $netdom = "C:\temp\netdom.exe" If Not FileExists ("C:\windows\stage1.chk") Then ;The registry will be overwritten with a fixed username and password and AutoLogon will be enabled RegDelete ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName") RegDelete ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName") RegDelete ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword") RegDelete ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon") RegDelete ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon") RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", "") RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUsername" , "REG_SZ", "*******") RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword" , "REG_SZ", "*******") RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon" , "REG_SZ", "1") RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon" , "REG_SZ", "1") TrayTip($appName & " - Autologon is Enabled", "AutoLogon Enabled.. ", 1) TraySetToolTip($appName & " - Autologon is Enabled") Sleep ( 3000 ) ;Newsid.exe will run silently and will provide a new ID for the system ShellExecute ( "C:\temp\newsid", "/a" ) Sleep ( 3000 ) Send ("{SPACE}") TrayTip($appName & " - Your SystemID renewed ", "Your SystemID has been renewed", 1) TraySetToolTip($appName & " - Your SystemID renewed " ) ;Stage1.chk will be copied to the Windows directory to be sure the script came this far FileCopy ( "C:\temp\stage1.chk", "C:\windows\") Sleep ( 3000 ) TrayTip($appName & " - System reboot..", "System will reboot in a few minutes..", 1) TraySetToolTip($appName & " - System reboot.." ) Sleep ( 10000 ) Shutdown (2) Else If Not FileExists ("C:\windows\stage2.chk") then ;Script will read the Machine Serialnumber from the registry to convert it into variable $reg Dim $reg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Organization\Setup", "MachineSerial") ;$reg will be changed with so that the new serial is: NL-XXXXXXX after that this will be converted to variable $serial Dim $serial="NL-"& $reg TrayTip($appName & " - Systemserial is:", "The Machines Serial is "& $serial, 1 ) TraySetToolTip($appName & " - Systemserial is:") #include <GUIConstants.au3> GUICreate("Rename", 255, 85, 255, 255) GUICtrlCreateLabel("Please type the new computername", 5, 5) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $inv = GUICtrlCreateInput($serial, 75, 25, 100, 20) $btn = GUICtrlCreateButton("Rename", 95, 55, 60, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $btn _Rename() ExitLoop EndSelect WEnd Send ("{}") Send ("{SPACE}") ;Stage2.chk will be copied to the Windows directory to be sure the script came this far FileCopy ( "C:\temp\stage2.chk", "C:\windows\") send ("{ENTER}") Shutdown (2) Else If Not FileExists ("C:\windows\stage3.chk") then ;System will be joined to the Domain RunWait (@Comspec & ' /k ' & $netdom & ' join . /Domain:DOMAIN.COM /UserD:******* /PasswordD:******* ') Sleep (2000) send ("{y}") Sleep (2000) Send ("{exit}") TrayTip($appName & " - System joined DOMAIN", "System joined the DOMAIN.COM Domain", 1) TraySetToolTip($appName & " - System joined DOMAIN") Sleep ( 3000 ) TrayTip($appName & " - System reboot..", "System will reboot in a few seconds..", 1) TraySetToolTip($appName & " - System reboot..") ;Stage2.chk will be copied to the Windows directory to be sure the script came this far FileCopy ( "C:\temp\stage2.chk", "C:\windows\") Sleep (10000) ;The Registry will be restored to his old original state and AutoLogon will be disabled ShellExecute ( "C:\windows\regedit", "-s C:\temp\restore_reg.reg" ) TrayTip($appName & " - Autologon is Disabled", "Autologon disabled again", 1) TraySetToolTip($appName & " - Autologon is Disabled") ;Stage3.chk will be copied to the Windows directory to be sure the script came this far FileCopy ( "C:\temp\stage3.chk", "C:\windows\") Sleep ( 3000 ) TrayTip($appName & " - System reboot..", "System will reboot in a few seconds..", 1) TraySetToolTip($appName & " - System reboot..") Shutdown ( 2 ) Else MsgBox (4096, "Finished", "System is Configured") Shutdown (2) EndIf EndIf EndIf Func _Rename() Run(@ComSpec & " /c sysdm.cpl", "", @SW_HIDE) WinWaitActive("System Properties") Send("{RIGHT}") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{ENTER}") $x = GUICtrlRead($inv) Send($x) EndFunc ;==>_Renamejoin_domain_p.au3
  12. Tried that with the following output: ERROR: Code = 0x80041017 Description = Invalid Query Facility = WMI
  13. So that you all know: It works perfect! The only problem is, what I really want is to rename the computername before joining it to the domain, only as far as I can see, 'netdom.exe' only supports pc's that are joined to a domain.... Anybody suggestions on how to fix this?
  14. Hehehe Allright...I hoped it was something serious but I recieved the message "Name allready exists on the domain" So...deleted the account and you know what....IT'S WORKING Now I'm restoring the PC to basic config to test the whole script at once! I'll let you all know!
  15. I think not because when I use the following command manual by typing it into a 'cmd' screen it works: C:\temp\netdom renamecomputer . /UserD:admin /PasswordD:admin /newname:Test12345 So...netdom seems to have a problem with the '& $serial) part.
×
×
  • Create New...