?
Solved

startup script to run IE at startup only if on corporate network

Posted on 2008-06-18
2
Medium Priority
?
232 Views
Last Modified: 2010-04-21
I want to be able to launch IE at startup to our internal main sharepoint page when people start their computers.  However since this site is not outward facing I wanted to know if there is a way I can script something so it first looks for a server or IP or anything else that would always be connected while on our network, this way if they are a laptop user it does not try to launch IE when they are off the network.  Is this possible?
0
Comment
Question by:Tim Lewis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 1000 total points
ID: 21815463
The script below (largely cribbed from http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct07/hey1012.mspx) checks the computer's IP address.  If the first three octets match those of your corporate network then it launches the webpage.  This should be adequate unless you're using CIDR or have multiple disparate subnets, in which case it gets more complicated.

Paste the script below into a text file with a .vbs extension.  Customize the value of the strCorporate variable with first three octets of your corporate network.  Customize the value of the strHomepage variable with the URL of your Sharepoint page.

If you want to specify two octets instead of three (e.g. 10.100) then edit line 15 accordingly.


On Error Resume Next
 
strCorporate = "10.0.100"
strHomepage = "http://sharepoint.yourdomain.com"
 
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
 
Set colItems = objWMIService.ExecQuery _
	("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
 
For Each objItem in colItems
	For Each objAddress in objItem.IPAddress
		arrIPAddress = Split(objAddress, ".")
		If arrIPAddress(0) <> 0 AND arrIPAddress(0) <> 169 Then
			strNetwork = arrIPAddress(0) & "." & arrIPAddress(1) & "." & arrIPAddress(2)
			Exit For
		End If
	Next
	Exit For
Next
 
If strNetwork = strCorporate Then
	Set objShell = CreateObject("WScript.Shell")
	objShell.Run(strHomepage)
End If

Open in new window

0
 

Author Closing Comment

by:Tim Lewis
ID: 31468495
Great.  Thanks.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question