|
|
Logon script
Making a logon script for two locations and want the script to understand
what location is logged on to.
I can determen this with %logonserver% but is there any properties in vb
script that gives me the same function?
Or any other suggestions.
-T
|
|
0
|
|
|
|
Reply
|
Terry
|
11/22/2009 10:42:59 PM |
|
"Terry" <terje@itl.no> wrote in message
news:%23mVurU8aKHA.4688@TK2MSFTNGP06.phx.gbl...
> Making a logon script for two locations and want the script to understand
> what location is logged on to.
> I can determen this with %logonserver% but is there any properties in vb
> script that gives me the same function?
>
> Or any other suggestions.
>
> -T
Check out script56.chm for the function "ExpandEnvironmentStrings" of the
WshShell object. There is an example there too.
|
|
0
|
|
|
|
Reply
|
Pegasus
|
11/22/2009 10:57:21 PM
|
|
"Pegasus [MVP]" <news@microsoft.com> wrote in message
news:#h5onc8aKHA.1596@TK2MSFTNGP06.phx.gbl...
>
> "Terry" <terje@itl.no> wrote in message
> news:%23mVurU8aKHA.4688@TK2MSFTNGP06.phx.gbl...
>> Making a logon script for two locations and want the script to understand
>> what location is logged on to.
>> I can determen this with %logonserver% but is there any properties in vb
>> script that gives me the same function?
>>
>> Or any other suggestions.
>>
>> -T
>
> Check out script56.chm for the function "ExpandEnvironmentStrings" of the
> WshShell object. There is an example there too.
I don't know of any environment variables that would contain hints about the
logical location of a workstation. While useful, Logonserver is not fool
proof. We have one DC at our location. If we take it offline for service,
our users will authenticate against potentially distant DC's.
Another approach would be to use the ADSystemInfo to determine the Active
Directory site, I extracted the short script that follows from the end of
this page: http://www.fpschultze.de/?tag=active-directory
01.On Error Resume Next
02.
03.Set objSysInfo = WScript.CreateObject("ADSystemInfo")
04.Set objNetwork = WScript.CreateObject("Wscript.Network")
05.
06.strSiteName = objSysInfo.SiteName
07.
08.Select Case strSiteName
09. Case "Amsterdam"
10. objNetwork.MapNetworkDrive "X:", "\\fs-nl\data"
11. Case "Berlin"
12. objNetwork.MapNetworkDrive "X:", "\\fs-de\data"
13. Case "London"
14. objNetwork.MapNetworkDrive "X:", "\\fd-gb\data"
15. Case "Paris"
16. objNetwork.MapNetworkDrive "X:", "\\fs-fr\data"
17.End Select
Of course, this assumes that the AD site is sufficient for your purposes.
/Al
|
|
0
|
|
|
|
Reply
|
Al
|
11/23/2009 3:16:37 AM
|
|
|
2 Replies
244 Views
(page loaded in 0.057 seconds)
Similiar Articles: long name for logon script user - microsoft.public.scripting ...in the domain I have thousands of users, each with its logonscript, according as it will have a different user: eg "user1" has the logon script:... SBS Logon Script - microsoft.public.windows.server.sbsHi Bill: SBS 2003? You can search for it, as in *logon*.* Show all files in Explorer. There are two copies, but they replicate, so you only have to modify ... Windows SBS 2008 logon script problem - microsoft.public.scripting ...HI, I am having a problem with a script that I have in user logon that maps some drives I need. Here is an example of the script: Dim objNetwo... Windows 7 logon vbscript not working - microsoft.public.scripting ...Any help on why windows 7 does not process logon vbscripts? Our logon vb scripts no longer works in windows 7. ... Cannot run a batch file for logon/logoff - microsoft.public ...Hi everyone, Thank you very much for your help in advance. I wrote a script and put it in our group policy/user/scripts/logon/logoff. I make s... Login Script does not run on SBS2008 with win7 client - microsoft ...Please run RSOP.msc on the Windows 7 client and check User Configuration -> Windows Settings -> Scripts -> Logon , see if that login script is there. Windows 7 login vbscript not working - microsoft.public.scripting ...Hi, I'm very new with vbscript. Our logon vbscripts work just fine with windows xp. However, after a few clients were upgraded to windows 7, the l... Shared Drive via Netlogon Script - microsoft.public.windows.server ...Hi In SBS2003 you could edit the default script in the NETLOGON share to include 'net use Z: \\SERVER\SHARE In SBS2008 the default script file... Login Script to create a new Outlook Profile - microsoft.public ...I was hoping there is a script out the that would do this for current users. ... If necessary, create a group policy to apply the new logon script [or edit an ... VB Script to update users desktop short-cuts when migrating ...VB Script to update users desktop short-cuts when migrating ... Windows SBS 2008 logon script problem - microsoft.public.scripting ... VB Script to update users desktop ... Creating logon scripts: Scripting; GeneralCreating logon scripts. Updated: January 21, 2005. Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server ... Logon Script FAQ - Hilltop LabFrequently Asked Questions About Logon Scripts: How do I setup Logon scripts in a domain with Active Directory? Why would I choose one method over another? Windows Logon Scripts - VBScript examples to create printers, map ...Create a windows logon script. Examples of how to map a network drive and create printers. Advice on assigning logon scripts via Group Policy How to Make a Logon Script | eHow.comLogon scripts can help a network administrator perform multiple functions such as mapping a network drive, which is basically assigning a shared folder a drive letter ... How to Assign a Logon Script to a Profile for a Local UserThis article describes how to assign a logon script to a profile for a local user's account on a Windows XP-based workstation or on a Windows-based server ... 7/14/2012 3:40:03 AM
|
|
|
|
|
|
|
|
|