Link to home
Create AccountLog in
Avatar of Bianchi928
Bianchi928

asked on

Wireless Profile

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
Avatar of RobSampson
RobSampson
Flag of Australia image

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.
Avatar of Bianchi928
Bianchi928

ASKER

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'
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

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
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
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
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
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

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
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.
Okay ..that's what I get

xx.JPG
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.
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.
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.
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
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.
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
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.