Richard
Tue Feb 27 13:00:32 CST 2007
"Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
message news:eRO8CAqWHHA.1432@TK2MSFTNGP02.phx.gbl...
>
> <jim_nospam_beasley@yahoo.com> wrote in message
> news:1172601014.582812.266220@a75g2000cwd.googlegroups.com...
>>I would like to run a script at startup (and afeter hibernation) that
>> checked my location, based on the network connection I get. From that,
>> I would like to establish some defaults, like default printer.
>>
>> I don't know much about initiating this type of script, how to
>> evaluate my network connection, and how to control default devices. If
>> someone can point mem toward some tutorial-like info, I would
>> appreciate it.
>
> Some ideas:
>
> 1. You can retrieve the site name for the ADSystemInfo object.
> Set objSysInfo = CreateObject("ADSystemInfo")
> strSite = objSysInfo.SiteName
> 2. You can retrieve the IP address and parse for subnet. A function I've
> used is in this example logon script:
>
>
http://www.rlmueller.net/Logon5.htm
>
> The function GetIPAddresses is at the end of the script. I use this
> because it works on all clients.
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab -
http://www.rlmueller.net
> --
>
>
Simple VBScript code to connect a default printer:
=============
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.AddWindowsPrinterConnection "\\PrintServer\HPLaser2"
objNetwork.SetDefaultPrinter "\\PrintServer\HPLaser2"
============
Use group policy to configure startup scripts. I don't know of any way to
have a script run when you wake the system up from hibernation. I have an
FAQ on logon scripts, that also explains how to configure startup scripts
here:
http://www.rlmueller.net/LogonScriptFAQ.htm
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net
--