title: Power Shell Script Open and Close a webpage after Network is opened
body: <p>Hello Stack community I have been trying to search this for a while now but can't seem to find anything. All I want to do is launch a webpage using iexplorer.exe "www.myserverIP.com\dev\emailme.php" It is suppose to be an air gap kind of server that turns on its connection takes a backup of multiple other servers then shuts off its connection. In between turning it on and off I want it to visit my wamp server to run a php script to send me an email of when this happens :D I already made the PHP script. Any other ideas are completely welcome as well I always love trying something new!</p>
  
  <p>Code is provided below:</p>
  
  <pre><code>    # Monday Backup Script
  
  #7zip path:
  $path = "C:\Program Files\7-Zip\7z"
  $date=get-date -format "%M.%d.yy"
  
  #:: /COPYALL :: COPY ALL file info
  #:: /B :: copy files in Backup mode. 
  #:: /SEC :: copy files with SECurity
  #:: /MIR :: MIRror a directory tree 
  
  #:: /R:n :: number of Retries
  #:: /W:n :: Wait time between retries
  #:: /LOG :: Output log file
  #:: /NFL :: No file logging
  #:: /NDL :: No dir logging
  
  # Open Network
  netsh interface set interface ethernet enabled
  
  # Alert for Backup
  
  iexplore.exe "http://172.20.255.3/NeikoDev/Backup%20emails/Backup%20Emails.php"
  taskkill /IM iexplore.exe /F
  # ^^^ THIS IS THE CODE THAT DOESNT WORK FOR THIS ^^^^**
  
  
  
  # Wait for network to come online
  sleep 120
  
  # Backup NAS to local
  ROBOCOPY "\\10.0.5.100\PrivateData\." "D:\PrivateData\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\Monday.txt
  ROBOCOPY "\\10.0.5.100\PrivateData1\." "D:\PrivateData1\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\MondayPrivate1.txt
  ROBOCOPY "\\10.0.5.100\PrivateData2\." "D:\PrivateData2\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\MondayPrivate2.txt
  ROBOCOPY "\\10.0.5.100\PrivateData3\." "D:\PrivateData3\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\MondayPrivate3.txt
  ROBOCOPY "\\10.0.5.100\HomeworkArchive\." "D:\HomeworkArchive\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\MondayHomeworkArchive.txt
  ROBOCOPY "\\172.20.255.125\PortableDeviceFilesArchive\." "D:\PortableDeviceFilesArchive\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\MondayPorDevArch.txt
  ROBOCOPY "\\172.20.255.3\wamp\." "D:\3wampBackups\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\MondayWAMPSERVER.txt
  ROBOCOPY "\\172.20.255.123\wamp\." "D:\123wampBackups\." /COPYALL /B /SEC /MIR /R:0 /W:0 /LOG:C:\backups\LOGS\Monday\MondayWAMPSERVER123.txt
  
  # Wait for files to finish
  sleep 60
  
  # Zip logs
  &amp; $path a Monday.zip Monday*.txt
  
  # Copy to network
  cp Monday.zip  "$date.zip"
  cp "$date.zip" "\\10.0.5.100\PrivateData\Resource\Network\backuplogs\Monday\$date.zip"
  
  # Wait for network traffic to stop
  sleep 120
  
  # Close network
  netsh interface set interface ethernet disabled
  </code></pre>