Solved

Detecting a SiteName with a vbs script

Posted on 2007-03-29
7
791 Views
Last Modified: 2013-11-26
Hello Everyone,

I have a login Script and I need it to test for the SiteName as we have over 100 of them.  If a user goes to another site the script want run unless the SiteName is changed to the site where they are.  Can anyone tell me how I can make this script test for the site.

Set objADSysInfo = CreateObject("ADSystemInfo")
If objADSysInfo.SiteName = "DummySite" Then

Thank you Very Much for your help
0
Comment
Question by:CEAllen6216
[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
  • 3
  • 2
7 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18816676
Something like this?

Dim objShell:Set objShell=CreateObject("Wscript.Shell")
Set objADSysInfo = CreateObject("ADSystemInfo")
Select Case objADSysInfo.SiteName
  Case "DummySite" Then
     objShell.Run "cscript DummySite.vbs"
  Case Else
     objShell.Run "cscript GenericLogonScript.vbs"
End Select
0
 

Author Comment

by:CEAllen6216
ID: 18818359
sirbounty,

in the case statements do I need to list all of the SiteNames in a Case Else
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18818591
List them following the format above...

Select Case objADSysInfo.SiteName
  Case  "Site1"
  Case "Site2"
  Case "Site3"
'...etc
  Case Else 'for sites not accounted for or for the same processing to occur on several...
0
 

Author Comment

by:CEAllen6216
ID: 18890056
Sir Bounty,

This was very helpful.  Thank You very much.  We implemented this and it worked for us.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18890064
Glad I could help. :^)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

752 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