|
|
|||||||
Hey all, Does anyone know a way of getting installed SSID's of a computer? I'd have thaught that WMI or COM would have a way. I did some googling and it may also be possible to get information programatically from windows zero config service, however i wouldn't know where to start for doing that. Thanks Luke |
||||||||
|
|
|||||||
Hmm i found this, although it does not look like a valid WMI class, could not find in Kixomatic http://www.dotnet247.com/247reference/msgs/43/217642.aspx |
||||||||
|
|
|||||||
I found this... http://msdn.microsoft.com/en-us/library/ms799402.aspx ...but have yet to find a working example (found some examples that didn't seem to work under vista) |
||||||||
|
|
|||||||
With a little cleanup of the output, this will give you the SSID. netsh wlan profiles interface="Wireless Network Connection" May still be a better way. |
||||||||
|
|
|||||||
This one gives more info... netsh wlan show interfaces |
||||||||
|
|
|||||||
Thanks for the posts thus far Allen. The problem is that the wlan subsection of netsh is new to vista, and there does not appear to be a way of getting the SSID from plain old command prompt in XP However!!! i think i'm on to somthing with WMI. Using the Query: Code: RedirectOutput('c:\scripts\output.txt',1) Break On $strComputer = "." $objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\wmi") $colItems = $objWMIService.ExecQuery("Select * from MSNdis_80211_ServiceSetIdentifier",,48) ? For Each $objItem in $colItems "********************"? 'has :' + UBound($objItem.Ndis80211SsId) + ' elements' ? 'The Array when Joined is (' + Join($objItem.Ndis80211SsId,',') + ')' ?? Next it returns a 32 element array, containing a decimal ascii. For example it could output: 83, 111, 109, 101, 83, 83, 73, 68 Using a Ascii decimal to Ascii converter like http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html, it spits out the correct SSID!!!!! All i now need is a method of converting decimal ascii to ascii in kix =D Cheers Luke |
||||||||
|
|
|||||||
Damn Vista... your script, like all the others I was finding outputs nothing. |
||||||||
|
|
|||||||
Hmm well that's no good Do you know a way of converting Ascii decimal to plain old ascii? i found a script somewhere a while back written in kix to go from ascii --> ascii decimal, but searching on boards over last 15 mins aint showing much. |
||||||||
|
|
|||||||
Do you mean like... Code: break on $array=83, 111, 109, 101, 83, 83, 73, 68 for each $num in $array $output=$output+chr($num) next ? $output SomeSSID |
||||||||
|
|
|||||||
By the way, I read that Vista depreciated the WMI Driver Extension Services, which is why it does not work. |
||||||||
|
|
|||||||
As Allen says, the interface will not work with Vista, but if you only need it for pre-Vista OS:
Important note! The other thing you need to be aware of is that the data returned is a "byte array", and KiXtart does not support this data type although in this case the code does work. The first four elements of the array appear to be the SSID string length so you could code a more complex array-to-string converter but as long as your SSIDs are short and contain only typeable 7-bit ASCII characters you can get away with the function as presented. |
||||||||
|
|
|||||||
Tyvm for the code guys, it seems to work well. I can now get the current connected SSID of the wireless nic, which is sort of what i am after. The problem is it only returns the connected SSID, not list all saved SSID's which would be ideal. It's basically run during logon to check that laptops have our ssid installed, and if not it attempts to add it using another script. I'll have to keep playing with some of those WMI classes. |
||||||||
|
|
|||||||
Getting a laptop to connect wirelessly before logon takes an extraordinary effort. Assuming a traditional logon script, how do you assume a client to possibly connect to other than your ssid before logon? |
||||||||
|
|
|||||||
Well the purpose of the script is to check that the ssid has been configured for that laptop, if not, add it. Otherwise if a laptop were to have the wireless nic disabled via the switch at the front and plugged into ethernet, my script so far would not detect the SSID has been configured (if it has been) and would try and install the ssid again. |
||||||||
|
|
|||||||
Try this, it works for me. Anyone want to try with Vista? It would be useful to get some feedback.
|
||||||||
|
|
|||||||
Well, I would except I'm in the process of wipping my Laptop with Vista on it. Boy has this been fun. Vista does something to the drive, and makes XP have a fit trying to install. The only thing I have found to work so far, is to slipstream SP3 on the Install Disk, and now (4 F'ing hours later) it appears to be installing. Holding my breath |
||||||||
|
|
|||||||
Awesome, thanks mate. That works perfectly. |
||||||||
|
|
|||||||
It doesn't work for me on XP using Intel PROSet. |
||||||||
|
|
|||||||
It's entirely possible that the values are proprietary. The key is (I think) for the vanilla Wireless Zero Configuration service, so I guess if you are using a different tool to manage the wireless then the data may be stored elsewhere. Also I should have mentioned that the code picks up pre-configured networks only by design - if you are simply roaming then it won't return found SSIDs. |