Jump to content

Carm01

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Carm01

  1. I do chrome defaults for all users with a combination of a master preference file and a few reedits ( GPO ) as Google like to break things and not make them work correctly like enable flash for all users. the GPO does not work correctly after like 6 or 8 month ago and we had to wipe it from our machines. master_preferences (that is its name exactly ) file looks like this: { "homepage": "https://www.yourorg.edu", "homepage_is_newtabpage": false, "browser": { "show_home_button": true, "check_default_browser": false }, "session": { "restore_on_startup": 4, "startup_urls": [ "https://www.yourorg.edu" ] }, "bookmark_bar": { "show_on_all_tabs": true }, "sync_promo": { "show_on_first_run_allowed": false }, "distribution": { "skip_first_run_ui": true, "import_bookmarks": false, "import_bookmarks_from_file": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\bookmarks.html", "import_search_engine": true, "import_history": false, "suppress_first_run_bubble": true, "create_all_shortcuts": true, "do_not_launch_chrome": true, "suppress_first_run_default_browser_prompt": true, "make_chrome_default_for_user": false, "make_chrome_default": false, "require_eula": false, "system_level": true }, "first_run_tabs": [ "https://www.yourorg.edu" ] } this file lives where the chrome exe lives The bookmark file i would just make and export to use and reference it. I apply the following regedits ( GPO; you do not need to install the admx files if you know where they go ) [HKEY_CURRENT_USER\Software\Policies\Google\Chrome] "DefaultPopupsSetting"=dword:00000001 "DefaultBrowserSettingEnabled"=dword:00000000 "DefaultCookiesSetting"=dword:00000004 Chrome like to break things as well like in the master pref file there is something in regards to the make chrome default set to false does not work on Windows 10. First runs work great until you do a second lauch then Google shoves the another tab down your throat. I have an automated silent installer I wrote that downloads the latest version from google and applies all my settings automatically which saves a tome of time. Hopefully this helps some people.
  2. why not have this person create another google account and then sign into chrome, then all that stuff will be synced to that account?
  3. I created an AutoIT script that will create a list of all files in question, and get the last modified time from them , sort them from oldest to newest and then isolate the oldest one , delete it, and replace the current one from C:\iSCSIVirtualDisks\man-vd.vhdx to the correct folder. You will need to compile this to an exe via AutoIT and https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe and you will need the editor https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe You can run this by pressing F5 in after saving the contents of this script into a txt file and renaming to .au3 file You can test it with other file types if you wish There are comments listed in here and things can be commented out to not display information I am presenting the version that has the comments in and another without comments and you are satisfied with the results. I am not sure if this is something you would be interested in working with or not but thought I would provide what I came up with. Use this one to see the results #RequireAdmin #include #include Dim $b[1][2] $filepath = 'E:\' ; this will bethe file/folder path $a = _FileListToArrayRec($filepath, '*.vhdx', $FLTAR_FILES, $FLTAR_RECUR, "", $FLTAR_FULLPATH) ; creates a list of all files within all subfolders of files with the extension .vhdx. YOU WILL HAVE TO CHANGE THE EXTENSION AFTER YOU ARE SATISIFIED _ArrayDisplay($a); displays current files with .vhdx extension remove, add a ; in front of _Arraydisplay to comment it out For $i = 1 To UBound($a) - 1 ; creates a loop of 1 to $a , $a being how many files are in the list $c = FileGetTime($a[$i], $FT_MODIFIED, $FT_STRING) ; gets last modified time the format is as follows: YYYYMMDDHHMMSS and sets to the variable $c $d = $a[$i] ; sets the full file path to the variable $d $fill = $d & "|" & $c ; creates a multi-dimensional array with the full file path in one column and the last modified time in the second column _ArrayAdd($b, $fill) ; adds it to the array Next _ArrayDisplay($b) ;displays current list _ArraySort($b, 0, 0, 0, 1) ; sorts the second column of files assending so the oldest will be on top _ArrayDisplay($b) ; displays the sorted list MsgBox(0, "this is the oldest file on the list", $b[1][0]) ; lists the oldest file $f = StringSplit($b[1][0], '\'); splits the string based on '\' so we can isolate the folder $j = $filepath & $f[uBound($f) - 2]; rebuilds the file path for the replacement file minus the file name MsgBox(0, "folder path for new file", $j); displays the folder where the new file is going to go this can be commented out when compiled. ;FileDelete($b[1][0]) ; deletes the oldest file ;FileCopy('C:\iSCSIVirtualDisks\man-vd.vhdx', $b[1][0],1) Use this one if out are satisfied and ready for a test #RequireAdmin #include #include Dim $b[1][2] $filepath = 'E:\' ; this will be E:\ in your case $a = _FileListToArrayRec($filepath, '*.vhdx', $FLTAR_FILES, $FLTAR_RECUR, "", $FLTAR_FULLPATH) ; creates a list of all files within all sub-folders of files with the extension .vhdx. YOU WILL HAVE TO CHANGE THE EXTENSION AFTER YOU ARE SATISIFIED ;_ArrayDisplay($a); displays current files with .vhdx extension remove, add a ; in front of _Arraydisplay to comment it out For $i = 1 To UBound($a) - 1 ; creates a loop of 1 to $a , $a being how many files are in the list $c = FileGetTime($a[$i], $FT_MODIFIED, $FT_STRING) ; gets last modified time the format is as follows: YYYYMMDDHHMMSS and sets to the variable $c $d = $a[$i] ; sets the full file path to the variable $d $fill = $d & "|" & $c ; creates a multi-dimensional array with the full file path in one column and the last modified time in the second column ;_ArrayAdd($b, $fill) ; adds it to the array Next ;_ArrayDisplay($b) ;displays current list ;_ArraySort($b, 0, 0, 0, 1) ; sorts the second column of files assending so the oldest will be on top ;_ArrayDisplay($b) ; displays the sorted list ;MsgBox(0, "this is the oldest file on the list", $b[1][0]) ; lists the oldest file $f = StringSplit($b[1][0], '\'); splits the string based on '\' so we can isolate the folder $j = $filepath & $f[uBound($f) - 2]; rebuilds the file path for the replacement file minus the file name ;MsgBox(0, "folder path for new file", $j); displays the folder where the new file is going to go this can be commented out when compiled. FileDelete($b[1][0]) ; deletes the oldest file FileCopy('C:\iSCSIVirtualDisks\man-vd.vhdx', $b[1][0],1)
  4. So, you want the oldest file to be deleted on E:\ and replaced with the newest man-vd.vhdx file , correct ?
  5. It might wait until the window title appears but as far as web page loading it does not wait so if the page does not fully load it will go as soon as it sees the window title. there is no way to detect that using winwaitactivate unless you use a custom UDF ( https://www.autoitscript.com/forum/topic/14380-how-do-i-wait-for-browser-items-to-appear/ ). There are some UDFs for Firefox and IE that might wait until the page loads but I have not dove into those. WinWaitActivate only looks at the window title not for a page to fully load.
  6. AutoIT script, then compile and run the exe #RequireAdmin FileCopy("\\some\location\master_preferences", "C:\Program Files (x86)\Google\Chrome\Application\master_preferences", 1); copies any file with or without extensions and overwrites it.
  7. We successfully use the following run from Altiris: C:\delprof2\delprof2.exe /ed:administrator /ed:public /ed:default /ed:localadmin /q /i it should ignore errors, however, if a user is logged in it cannot delete the logged in/locked account. We usually re-boot prior and have not had any issues deleting profiles. Did you post an example of your code , as it would be extremely helpful ?
  8. Testing this the implementation of the following: WinWaitActive("Microsoft Edge") and AutoItSetOption("WinTitleMatchMode",2) are not entirely correct. In theory they should work, however, one has the ability to add the 3 second delay into WinWaitActivate function as shown here: WinWaitActive('Microsoft Edge', "", 3) If I place that 3 second delay in , it does not function as desired, hence the Sleep(3000) has to be placed in there to correctly function. The following below is correct implementation as you have to use regular expressions to get it to work, thus you eliminate the sleep(3000) WinWaitActive('.*Microsoft Edge', "", 3) So below is the correct implementation if you want to use: AutoItSetOption("WinTitleMatchMode",2) you must do the proper pattern matching. You could also eliminate the AutoITsetoption all together and just do a WinWaitActive("[REGEXPTITLE:(?i)(.*'Microsoft Edge')]", "", 3) Below is the revised code: ; Don't display an icon in the System Tray, otherwise people can click it to pause or end the script. #NoTrayIcon ; Set the E-mail Domain. $Domain = "domain.com" ; Open Microsoft Edge at Outlook 365 signin page. Run(@ComSpec & " /c " & 'start microsoft-edge:https://outlook.office.com/owa/?realm=' & $Domain, "", @SW_HIDE) ; Set Window Title Matching Mode for String within String. AutoItSetOption("WinTitleMatchMode",2) ; Wait until a window with Microsoft Edge in the title has loaded and is the active Window. WinWaitActive('.*Microsoft Edge', "", 3) ; Type the logged on user's username, the @ symbol and e-mail domain name. Send(@UserName & '@' & $Domain)
  9. good call on launching EDGE. We/I just avoid using it.
  10. Using AutoIT - this should get you started. I can't launch EDGE like this for the world, so i uses IE as an example. Also you have to wait for the page to load before sending the keys. this will have to be compiled to an EXE. I recommend Firefox in private browsing mode as IE throws a hidden login window if you have a federated page that redirects like we do. Unfortunately the method to launch EDGE does not work and I have to research it. We avoid EDGE like the plague because it causes issues even in o365 ShellExecuteWait("C:\Program Files (x86)\Internet Explorer\iexplore.exe", "https://login.microsoftonline.com/common/oauth2/authorize?client_id=4345a7b9-9a63-4910-a426-35363201d503&response_mode=form_post&response_type=code+id_token&scope=openid+profile&state=OpenIdConnect.AuthenticationProperties%3daCx5ptREwhUgqNyOyt2dcP22_FiQ3QwwI3RSlHH3WEDH-DC4odtRR3lUglX5ODFx9jRiRyRLqpArBjWLYCzYdeqi3wGQWWNrtzHPa7w0BV4plng0iCUqWcn07-XrNOqF&nonce=636595636959171873.OTA4MDY2NDItNGFhNC00Yjk3LWI5NDQtNzM3MTRiMmFiMjA3OTk5MDcxMTktMTg4OC00YWYyLTkyYTEtYTBkODJmZTA2MTZl&redirect_uri=https%3a%2f%2fwww.office.com%2f&ui_locales=en-US&mkt=en-US&client-request-id=92b06f50-fb93-41bb-9959-15a7d89d2f03") Sleep(5000); waits 5 seconds Send('[email protected]'); sends keys Send('{ENTER}'); simulates enter key
  11. I have a piece of code I wrote that does not use WMIC, as I found it is slow and you do not need to add any lines as it will handle any java 8 version as is. If anyone is interested in the AutoIT script; you will have to compile it ?
  12. Is the link to the cert internal or can it be reached externally? If you can provide an external link I will make an attempt to Download it and install it for you and post the code here. the confirm.vbs and cert.vbs; are those just msg box scripts ?
×
×
  • Create New...