We have in our logon script a command to download updates from the main
server to the PC you are logging into. This works great except for when we
log into either a server, or to Citrix servers. I need to detect whether
the computer that you are logging into is NOT a server, then run the script.
We are using vbscript and mapping drives, functions through "member of" and
"case" statements. The output is sent through IE. Here is the portion of
the script that will need to be modified:

Case UCase("cn=CCGG Jwalk
Users,OU=Common,OU=CC,DC=corp,DC=tcc,DC=inet")
strStatus = strStatus & vbCRLF & "Running JWalk Update"
ie.document.all.wstatus.InnerText = strStatus
WshShell.Run "W:\JWalk\jwalkjwc.bat", 1, true

We need to detect if the computer that is getting logged into is a server or
not - this would need to work whether at the console, RDP, Citrix, or other
means. It needs to work for a normal user, as some Citrix users also log in
via a "normal" PC.

Thank you
Randy

RE: Skip download when logging onto a server or to Citrix by tholland

tholland
Mon Feb 21 19:21:01 CST 2005

One easy solution would be to adopt a naming convention for your servers that
has something like 2kSvr or 2k3Svr in it. This allows you to do an instr on
the computer name and easily identify a server. Know it's tough to do that
with servers in place now, but you could script in known names now and adopt
a new naming convention going forward.

"Randy Reimers" wrote:

> We have in our logon script a command to download updates from the main
> server to the PC you are logging into. This works great except for when we
> log into either a server, or to Citrix servers. I need to detect whether
> the computer that you are logging into is NOT a server, then run the script.
> We are using vbscript and mapping drives, functions through "member of" and
> "case" statements. The output is sent through IE. Here is the portion of
> the script that will need to be modified:
>
> Case UCase("cn=CCGG Jwalk
> Users,OU=Common,OU=CC,DC=corp,DC=tcc,DC=inet")
> strStatus = strStatus & vbCRLF & "Running JWalk Update"
> ie.document.all.wstatus.InnerText = strStatus
> WshShell.Run "W:\JWalk\jwalkjwc.bat", 1, true
>
> We need to detect if the computer that is getting logged into is a server or
> not - this would need to work whether at the console, RDP, Citrix, or other
> means. It needs to work for a normal user, as some Citrix users also log in
> via a "normal" PC.
>
> Thank you
> Randy
>
>
>

Re: Skip download when logging onto a server or to Citrix by Al

Al
Mon Feb 21 22:31:38 CST 2005


"tholland" <tholland@discussions.microsoft.com> wrote in message
news:D171E53A-2B63-4978-BB1A-78E7865EA195@microsoft.com...
> One easy solution would be to adopt a naming convention for your servers
that
> has something like 2kSvr or 2k3Svr in it. This allows you to do an instr
on
> the computer name and easily identify a server. Know it's tough to do
that
> with servers in place now, but you could script in known names now and
adopt
> a new naming convention going forward.

A good (and *enforced*) workstation/server naming convention is obviously
the simplest - unless it means renaming servers. Since you are already
testing user group membership, you could test the workstation's membership
in a special group created for identifying those systems that meet your
definition of server or citrix server.

/Al

> "Randy Reimers" wrote:
>
> > We have in our logon script a command to download updates from the main
> > server to the PC you are logging into. This works great except for when
we
> > log into either a server, or to Citrix servers. I need to detect
whether
> > the computer that you are logging into is NOT a server, then run the
script.
> > We are using vbscript and mapping drives, functions through "member of"
and
> > "case" statements. The output is sent through IE. Here is the portion
of
> > the script that will need to be modified:
> >
> > Case UCase("cn=CCGG Jwalk
> > Users,OU=Common,OU=CC,DC=corp,DC=tcc,DC=inet")
> > strStatus = strStatus & vbCRLF & "Running JWalk Update"
> > ie.document.all.wstatus.InnerText = strStatus
> > WshShell.Run "W:\JWalk\jwalkjwc.bat", 1, true
> >
> > We need to detect if the computer that is getting logged into is a
server or
> > not - this would need to work whether at the console, RDP, Citrix, or
other
> > means. It needs to work for a normal user, as some Citrix users also
log in
> > via a "normal" PC.
> >
> > Thank you
> > Randy
> >
> >
> >



Re: Skip download when logging onto a server or to Citrix by Torgeir

Torgeir
Tue Feb 22 05:30:03 CST 2005

Randy Reimers wrote:

> We have in our logon script a command to download updates from the main
> server to the PC you are logging into. This works great except for when we
> log into either a server, or to Citrix servers. I need to detect whether
> the computer that you are logging into is NOT a server, then run the script.
> We are using vbscript and mapping drives, functions through "member of" and
> "case" statements. The output is sent through IE. Here is the portion of
> the script that will need to be modified:
>
> Case UCase("cn=CCGG Jwalk
> Users,OU=Common,OU=CC,DC=corp,DC=tcc,DC=inet")
> strStatus = strStatus & vbCRLF & "Running JWalk Update"
> ie.document.all.wstatus.InnerText = strStatus
> WshShell.Run "W:\JWalk\jwalkjwc.bat", 1, true
>
> We need to detect if the computer that is getting logged into is a server or
> not - this would need to work whether at the console, RDP, Citrix, or other
> means. It needs to work for a normal user, as some Citrix users also log in
> via a "normal" PC.
Hi

With VBScript:

'--------------------8<----------------------

If IsServer Then
WScript.Echo "Server detected, quitting"
WScript.Quit
End If


Function IsServer()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Determines platform by reading reg val & comparing to known values
' http://support.microsoft.com/default.aspx?scid=kb;EN-US;152078
'
' Returns True if server platform, False if not
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim oShell, sOStype, sOSversion
Set oShell = CreateObject("Wscript.Shell")

On Error Resume Next
sOStype = oShell.RegRead(_
"HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType")
If Err.Number <> 0 Then
' - Could not find this key, OS must be Win9x/ME
Err.Clear
IsServer = False
Exit Function ' >>>
End If

Select Case sOStype
Case "LanmanNT"
IsServer = True
Case "ServerNT"
IsServer = True
Case "WinNT"
IsServer = False
End Select

End Function
'--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Skip download when logging onto a server or to Citrix by Randy

Randy
Tue Feb 22 14:52:33 CST 2005

Thank you Torgeir - that example is EXACTLY what I needed! Our servers
already exist, there is a naming convention (mostly), but I need to
guarantee that this command (or others like it in the future) do not run on
servers now or in the future.

Again, thanks!
Randy Reimers


"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:uvNs1HNGFHA.3492@TK2MSFTNGP12.phx.gbl...
> Randy Reimers wrote:
>
>> We have in our logon script a command to download updates from the main
>> server to the PC you are logging into. This works great except for when
>> we log into either a server, or to Citrix servers. I need to detect
>> whether the computer that you are logging into is NOT a server, then run
>> the script. We are using vbscript and mapping drives, functions through
>> "member of" and "case" statements. The output is sent through IE. Here
>> is the portion of the script that will need to be modified:
>>
>> Case UCase("cn=CCGG Jwalk
>> Users,OU=Common,OU=CC,DC=corp,DC=tcc,DC=inet")
>> strStatus = strStatus & vbCRLF & "Running JWalk Update"
>> ie.document.all.wstatus.InnerText = strStatus
>> WshShell.Run "W:\JWalk\jwalkjwc.bat", 1, true
>>
>> We need to detect if the computer that is getting logged into is a server
>> or not - this would need to work whether at the console, RDP, Citrix, or
>> other means. It needs to work for a normal user, as some Citrix users
>> also log in via a "normal" PC.
> Hi
>
> With VBScript:
>
> '--------------------8<----------------------
>
> If IsServer Then
> WScript.Echo "Server detected, quitting"
> WScript.Quit
> End If
>
>
> Function IsServer()
> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> ' Determines platform by reading reg val & comparing to known values
> ' http://support.microsoft.com/default.aspx?scid=kb;EN-US;152078
> '
> ' Returns True if server platform, False if not
> '
> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> Dim oShell, sOStype, sOSversion
> Set oShell = CreateObject("Wscript.Shell")
>
> On Error Resume Next
> sOStype = oShell.RegRead(_
> "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType")
> If Err.Number <> 0 Then
> ' - Could not find this key, OS must be Win9x/ME
> Err.Clear
> IsServer = False
> Exit Function ' >>>
> End If
>
> Select Case sOStype
> Case "LanmanNT"
> IsServer = True
> Case "ServerNT"
> IsServer = True
> Case "WinNT"
> IsServer = False
> End Select
>
> End Function
> '--------------------8<----------------------
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx