?
Solved

Wireless Profile

Posted on 2011-10-04
18
Medium Priority
?
781 Views
Last Modified: 2012-05-12
All my WIFI profile have been setup thru ProSet Intel. I've just added a new profile and I want the laptop to use this one as the defaull profile.

Let see say that the profile is called "Saint"

Thanks
Cheers
0
Comment
Question by:Bianchi928
  • 9
  • 9
18 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 36922245
Hi, this is all I could find in terms of automating the profiles:
http://www.symantec.com/connect/downloads/automating-wireless-profile-config-settings-intel-prosetwireless-software-11113-swdds

It looks you set up an Admin profile set, and deploy it.  I'm not sure whether it would automatically remove other profiles.

Rob.
0
 

Author Comment

by:Bianchi928
ID: 36927436
I had a look at the script and It looks a bit complicated to me. Like I said, I have 5 or 6 profiles in the profile list of each users

Richmond
Distribution
Somerton
GDT
StKildaRD

At the moment GDT is the one the laptop users are connected to. But because of carrier change , we need all of them to be connected to StKildaRd. That's what I want to automate, instead of me going to everyone's desk or sending some documentation.


Thanks
Cheers'
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36927549
OK, I've simplified the script a bit.  All you should need to do is follow the article to create your administrative p10 file, then run this script on the target machine, after changing the file names in the arrFiles array.  If you only have one manufacturer of systems, just make the array have one value in it.

Place the p10 file and the script in the same folder.

Make sure you test this on a test system....just in case it wipes the profiles.

Regards,

Rob.
'===================================================================
Dim Man, blnCopied
Dim WshShell, objFileSys, sWinDir, sSysDir, strScriptDir
Dim arrFiles, strFile
'-----------------------------------------------------------------
'Setting of scripting objects
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFileSys = CreateObject("Scripting.FileSystemObject")
'=====================================================================================
'Set the file names here
'MAKE SURE THE WHOLE BASE FILE NAME IS PART OF THE SYSTE MANUFACTURER THAT IS THE TARGET
'eg, the file name DELL is in DELL Inc, which is the manufacturer
arrFiles = Array("DELL.p10", "IBM.p10")
'=====================================================================================
'Force path formats to a known format, ie, ending in a backslash
strComputer = "."
sWinDir = objFileSys.GetSpecialFolder(0).Path
If Right(sWinDir,1) <> "\" Then sWinDir = sWinDir & "\"
sSysDir = objFileSys.GetSpecialFolder(1).Path
If Right(sSysDir,1) <> "\" Then sSysDir = sSysDir & "\"
strScriptDir = objFileSys.GetParentFolderName(WScript.ScriptFullName)
If Right(strScriptDir,1) <> "\" Then strScriptDir = strScriptDir & "\"
'===================================================================================================
'Verify profile files are in same folder as script
For Each strFile In arrFiles
	If Not objFileSys.FileExists(strScriptDir & strFile) Then
	'WScript.Echo "Unable to locate " & strScriptDir & strFile, vbCritical, "Error!"
	WScript.Quit 1
	End If
Next
'====================================================================================================
' Get Manufacturer of the Computer System
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
Man = objItem.Manufacturer
Next
'===================================================================================
If objFileSys.FileExists("C:\Progra~1\Intel\Wireless\Bin\PfWizard.exe") Then
	For Each strFile In arrFiles
		'Execute Wireless configuration Profile
		If InStr(LCase(Man), LCase(Left(strFile, InStrRev(strFile, ".") - 1)) Then
			objFileSys.CopyFile strScriptDir & strFile, "C:\WINDOWS\Temp\", True
			WshShell.Run "C:\WINDOWS\Temp\" & strFile, 1, True
		End If
	Next
End if
'====================================================================================
blnCopied = True
For Each strFile In arrFiles
	If objFileSys.FileExists("C:\WINDOWS\Temp\" & strFile) = False Then blnCopied = False
Next
If blnCopied = False Then
	WScript.Quit 1
Else
	WScript.Quit 0
End If
'====================================  The End  ================================

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Bianchi928
ID: 36927811
HI Rob,

You're nearly there...2 Issues
It's complaining about a ")" in teh following

If InStr(LCase(Man), LCase(Left(strFile, InStrRev(strFile, ".") - 1)) Then

Next
some laptops have WIFI instead of Wireless in

C:\Progra~1\Intel\Wireless\Bin\PfWizard.exe"

Thanks
Cheers
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 1000 total points
ID: 36927835
Sorry, try this.

Rob.
'===================================================================
Dim Man, blnCopied
Dim WshShell, objFileSys, sWinDir, sSysDir, strScriptDir
Dim arrFiles, strFile
'-----------------------------------------------------------------
'Setting of scripting objects
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFileSys = CreateObject("Scripting.FileSystemObject")
'=====================================================================================
'Set the file names here
'MAKE SURE THE WHOLE BASE FILE NAME IS PART OF THE SYSTE MANUFACTURER THAT IS THE TARGET
'eg, the file name DELL is in DELL Inc, which is the manufacturer
arrFiles = Array("DELL.p10", "IBM.p10")
'=====================================================================================
'Force path formats to a known format, ie, ending in a backslash
strComputer = "."
sWinDir = objFileSys.GetSpecialFolder(0).Path
If Right(sWinDir,1) <> "\" Then sWinDir = sWinDir & "\"
sSysDir = objFileSys.GetSpecialFolder(1).Path
If Right(sSysDir,1) <> "\" Then sSysDir = sSysDir & "\"
strScriptDir = objFileSys.GetParentFolderName(WScript.ScriptFullName)
If Right(strScriptDir,1) <> "\" Then strScriptDir = strScriptDir & "\"
'===================================================================================================
'Verify profile files are in same folder as script
For Each strFile In arrFiles
	If Not objFileSys.FileExists(strScriptDir & strFile) Then
	'WScript.Echo "Unable to locate " & strScriptDir & strFile, vbCritical, "Error!"
	WScript.Quit 1
	End If
Next
'====================================================================================================
' Get Manufacturer of the Computer System
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
Man = objItem.Manufacturer
Next
'===================================================================================
If objFileSys.FileExists("C:\Progra~1\Intel\Wireless\Bin\PfWizard.exe") = True Or objFileSys.FileExists("C:\Progra~1\Intel\WiFi\Bin\PfWizard.exe") = True Then
	For Each strFile In arrFiles
		'Execute Wireless configuration Profile
		If InStr(LCase(Man), LCase(Left(strFile, InStrRev(strFile, ".") - 1))) > 0 Then
			objFileSys.CopyFile strScriptDir & strFile, "C:\WINDOWS\Temp\", True
			WshShell.Run "C:\WINDOWS\Temp\" & strFile, 1, True
		End If
	Next
End if
'====================================================================================
blnCopied = True
For Each strFile In arrFiles
	If objFileSys.FileExists("C:\WINDOWS\Temp\" & strFile) = False Then blnCopied = False
Next
If blnCopied = False Then
	WScript.Quit 1
Else
	WScript.Quit 0
End If
'====================================  The End  ================================

Open in new window

0
 

Author Comment

by:Bianchi928
ID: 36927882
I'm running it on a test laptop which is already connected to a profile called "Richmond". The script (modified the array to have only StKildaRD.P10) and the P10 (StKildaRd) are both sitting on the desktop.

I ran the script and it looks that nothing happens. As a test I have remove the P10 file and it complains that he couldn't find it. At least I know it reached this spot in the script.

Cheers
0
 

Author Comment

by:Bianchi928
ID: 36928049
Okay.I've been a bit further in the script..The P10 is copied to c:windows\temp and run. It's added to the profile list, but it's doesn't make it the active one.

So, it looks that the script is doing the same as copying the P10 in Autoimport and automatically adds it to the profile list

Cheers
Christian
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36928067
OK, try this.  If you have Dell machines, name the file
DELL-StKildaRd.p10
and see if it works.

Rob.
'===================================================================
Dim Man, blnCopied
Dim WshShell, objFileSys, sWinDir, sSysDir, strScriptDir
Dim arrFiles, strFile
'-----------------------------------------------------------------
'Setting of scripting objects
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFileSys = CreateObject("Scripting.FileSystemObject")
'=====================================================================================
'Set the file names here
'MAKE SURE THE WHOLE BASE FILE NAME IS PART OF THE SYSTE MANUFACTURER THAT IS THE TARGET
' For example, for a DELL system, enter DELL-ProfileName.p10
' The hyphen must be included
'eg, the file name DELL is in DELL Inc, which is the manufacturer
arrFiles = Array("DELL-ProfileName.p10", "IBM-ProfileName.p10")
'=====================================================================================
'Force path formats to a known format, ie, ending in a backslash
strComputer = "."
sWinDir = objFileSys.GetSpecialFolder(0).Path
If Right(sWinDir,1) <> "\" Then sWinDir = sWinDir & "\"
sSysDir = objFileSys.GetSpecialFolder(1).Path
If Right(sSysDir,1) <> "\" Then sSysDir = sSysDir & "\"
strScriptDir = objFileSys.GetParentFolderName(WScript.ScriptFullName)
If Right(strScriptDir,1) <> "\" Then strScriptDir = strScriptDir & "\"
'===================================================================================================
'Verify profile files are in same folder as script
For Each strFile In arrFiles
	If Not objFileSys.FileExists(strScriptDir & strFile) Then
	'WScript.Echo "Unable to locate " & strScriptDir & strFile, vbCritical, "Error!"
	WScript.Quit 1
	End If
Next
'====================================================================================================
' Get Manufacturer of the Computer System
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
Man = objItem.Manufacturer
Next
'===================================================================================
If objFileSys.FileExists("C:\Progra~1\Intel\Wireless\Bin\PfWizard.exe") = True Or objFileSys.FileExists("C:\Progra~1\Intel\WiFi\Bin\PfWizard.exe") = True Then
	For Each strFile In arrFiles
		'Execute Wireless configuration Profile
		If InStr(LCase(Man), LCase(Left(strFile, InStr(strFile, "-") - 1))) > 0 Then
			objFileSys.CopyFile strScriptDir & strFile, "C:\WINDOWS\Temp\", True
			WshShell.Run "C:\WINDOWS\Temp\" & strFile, 1, True
		End If
	Next
End if
'====================================================================================
blnCopied = True
For Each strFile In arrFiles
	If objFileSys.FileExists("C:\WINDOWS\Temp\" & strFile) = False Then blnCopied = False
Next
If blnCopied = False Then
	WScript.Quit 1
Else
	WScript.Quit 0
End If
'====================================  The End  ================================

Open in new window

0
 

Author Comment

by:Bianchi928
ID: 36928131
Okay.

I have done what you suggested..Unless I comment out the following line. I had to do that before too.

If InStr(LCase(Man), LCase(Left(strFile, InStr(strFile, "-") - 1))) > 0

It won't copy the P10 to c:\windows\temp
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36928147
Hmmm, above this line:
If InStr(LCase(Man), LCase(Left(strFile, InStr(strFile, "-") - 1))) > 0 Then

put this:
MsgBox "Manufacturer: " & LCase(Man) & VbCrLf & "Looking for " & LCase(Left(strFile, InStr(strFile, "-") - 1))

and see what the message says....we're trying to match the name you put as the start of the file name, to see if it's in the manufacturer string.

Regards,

Rob.
0
 

Author Comment

by:Bianchi928
ID: 36928176
Okay ..that's what I get

xx.JPG
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36928196
That's strange.  There's no reason that it shouldn't be copying the file....

If you change this bit:
	For Each strFile In arrFiles
		'Execute Wireless configuration Profile
		MsgBox "Manufacturer: " & LCase(Man) & VbCrLf & "Looking for " & LCase(Left(strFile, InStr(strFile, "-") - 1))
		If InStr(LCase(Man), LCase(Left(strFile, InStr(strFile, "-") - 1))) > 0 Then
			objFileSys.CopyFile strScriptDir & strFile, "C:\WINDOWS\Temp\", True
			WshShell.Run "C:\WINDOWS\Temp\" & strFile, 1, True
		End If
	Next

Open in new window


to this:
	For Each strFile In arrFiles
		'Execute Wireless configuration Profile
		MsgBox "Manufacturer: " & LCase(Man) & VbCrLf & "Looking for " & LCase(Left(strFile, InStr(strFile, "-") - 1))
		If InStr(LCase(Man), LCase(Left(strFile, InStr(strFile, "-") - 1))) > 0 Then
			MsgBox "Manufacturer matched. Copying " & strFile
			objFileSys.CopyFile strScriptDir & strFile, "C:\WINDOWS\Temp\", True
			MsgBox "Running C:\WINDOWS\Temp\" & strFile
			WshShell.Run "C:\WINDOWS\Temp\" & strFile, 1, True
		Else
			MsgBox "Manufacturer not matched. Not copying " & strFile
		End If
	Next

Open in new window


you'll get some more output.....

Rob.
0
 

Author Comment

by:Bianchi928
ID: 36928209
Okay....I found something wrong in the name..It's copying the StKildaRd.P10 file now. But, how to make the laptop connect to this new profile instead of the GDT one.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36928250
I'm not sure yet.....if it's the first one you add, does it become the default?

Perhaps you could delete all profiles, then add the ones you want, adding the default one as the first one?

Otherwise I'll have to play around with it next week when I'm back at work.

Rob.
0
 

Author Comment

by:Bianchi928
ID: 36928267
If I delete all the other profiles and run the script. It adds StKIldaRd profile and connects to it..

Okay..leave it till next week when you're back at work.

Thanks mate
Cheers
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36928399
Just thinking...are you allowing them to have profiles of their own?  As we know, deleting the Profiles.enc will remove all profiles...so, after doing that, if you just add the ones you need through this script, would it work?

Otherwise, I think we'll just have to try to add one, and make it the default somehow....I'm not really liking our chances on that though, since everything appears to be in the Profiles.enc file, and it's structure is unknown.

Rob.
0
 

Author Comment

by:Bianchi928
ID: 36928439
Yes I do. If I delete all profiles and add StKIldaRd, the system automatically makes it the deault one and it works

Do your best
Thanks
Cheers
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36977710
Hi, I really don't think it's possible to script the profiles of the Intel ProSet stuff.  In the manual, there is a setting called "Microsoft Windows XP Coexistence" which may allow you to use both ProSet and Windows Wireless Zero Configuration to manage the profiles, in which case you can add profiles with your P10 files, and then use the batch script I provided earlier to delete other ones....

The manual can be found here:
http://support.dell.com/support/edocs/network/P65126/en/utilintc.htm

There are some WMI classes installed with it, but they are mostly informational, and don't allow you to change anything.

Rob.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

850 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