Page 1 of 1 1
Topic Options
#201783 - 2011-03-25 02:09 AM Wireless
Alucard_Kakashi Offline
Fresh Scripter

Registered: 2009-02-05
Posts: 37
Loc: USA
Hey everyone,

Need some help. We implemented wireless in our environment, but we have our login scripts running but the network drives are not mapping. I'm trying to figure out if it's possible to create a script that recongize the user when they are using our SSID and run the network share scripts to map there drive within our wireless network.

my thought on how to approach this, but can't figure it out or put it together in code:

Sessiontype
if sessiontype = "wireless"
;do or run our office's network script
else you are not in our wireless network

can anyone help me out

Top
#201786 - 2011-03-25 09:01 AM Re: Wireless [Re: Alucard_Kakashi]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Is the wireless available BEFORE they logon or does it activate and become available DURING the logon process of Windows?

If it's not available before logon then you'll need to be a bit more creative in getting it to work.

Top
#201790 - 2011-03-25 03:19 PM Re: Wireless [Re: NTDOC]
Alucard_Kakashi Offline
Fresh Scripter

Registered: 2009-02-05
Posts: 37
Loc: USA
The wireless is already connected because as soon as the user logs in our login script kicks in, but the network drives do not want to mount.
Top
#201792 - 2011-03-25 05:03 PM Re: Wireless [Re: Alucard_Kakashi]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Here is one way to get the SSID using WMI...

 Code:
Break On

? GetCurrentSSID()
get $

Function GetCurrentSSID()
   $objWMIService = GetObject("winmgmts:\\"+@WkSta+"\root\WMI")
   $colItems = $objWMIService.ExecQuery("SELECT * FROM MSNdis_80211_ServiceSetIdentifier Where active=true")
   For Each $objItem In $colItems
      if len($GetCurrentSSID)=0
         $strNdis80211SsId = Join($objItem.Ndis80211SsId,"")
         $y=5
         for $x=0 to len($strNdis80211SsId)
            $GetCurrentSSID=""+$GetCurrentSSID+Chr(substr($strNdis80211SsId,$y,3))
            $y=$y+3
         next
      endif
   Next
EndFunction

Top
#201793 - 2011-03-25 08:14 PM Re: Wireless [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Here is another way to get the SSID via the registry. Unfortunately I only have this one windows xp home computer to test this on, so it may not work in other environments.

 Code:
? GetCurrentSSID()
get $

Function GetCurrentSSID()
   $rootkey="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class"
   for each $key in fEnumKey(@WkSta,$rootkey)
      if readvalue($rootkey+"\"+$key,"")="network adapters"
         for each $subkey in fEnumKey(@WkSta,$rootkey+"\"+$key)
            if len(readvalue($rootkey+"\"+$key+"\"+$subkey,"SSID"))>0
               $GetCurrentSSID=readvalue($rootkey+"\"+$key+"\"+$subkey,"SSID")
            endif
         next
      endif
   next
EndFunction

Function fEnumKey($Server, $Key)
   Dim $Index, $Error, $x
   $Index = 0
   Dim $KeyName[$Index]
   If $Server <> ""
      $Key = "\\" + $Server + "\" + $Key
   Endif
   If KeyExist($Key)
      Do
         $x = ENUMKEY($Key, $Index)
         $Error = @Error
         If NOT $Error and $Index > Ubound($KeyName)
            ReDim PRESERVE $KeyName[$Index]
         Endif
         If NOT $Error
            $KeyName[$Index] = $x
            $Index = $Index + 1
         Endif
      Until $Error
   Else
      $KeyName[0] = ""
      Exit 2
   Endif
   $fEnumKey = $KeyName
   Exit 0
Endfunction

Top
#201795 - 2011-03-26 11:58 AM Re: Wireless [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok...
if the wireless is on and the logonscript runs but the drives don't map, you need to figure out why the drives don't map instead of making more logic into your script.

do a simple logging in your script, so you will see why they won't map and examine it... something like:
 Code:
use s: "\\ourserver\share"
shell "%comspec% /c echo " + @date + " mapping s: (error:" + @error + ") >> %temp%\logon.log"
use b: "\\ourserver\share_b"
shell "%comspec% /c echo " + @date + " mapping b: (error:" + @error + ") >> %temp%\logon.log"
_________________________
!

download KiXnet

Top
#201830 - 2011-04-01 03:01 PM Re: Wireless [Re: Lonkero]
Alucard_Kakashi Offline
Fresh Scripter

Registered: 2009-02-05
Posts: 37
Loc: USA
okay, awesome i finally got the wireless to work, but how can I determine when a user is a laptop or workstation within kix's?
Top
#201833 - 2011-04-01 03:16 PM Re: Wireless [Re: Alucard_Kakashi]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Please do not double post questions...

IsLaptop() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84566

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1376 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.065 seconds in which 0.033 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org