Check this doc
http://superuser.com/questions/133097/netsh-wlan-add-profile-not-importing-encrypted-passphrase



Jimmy Martin
(901) 227-8209

From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Underwood, Bob
Sent: Thursday, June 05, 2014 3:20 PM
To: mssms@lists.myitforum.com
Subject: [mssms] RE: Error installing a wireless profile only through configmgr

Not sure of your specific requirements, but I've been doing this from an OSD 
task sequence for a  while now with no issue.  The only differences are that a) 
I've added the profile XMLs to my toolkit package, and b) I'm not using the 
"user" switch (but it installs for all users anyway).

The exact command line in the TS is as follows:

cmd.exe /c netsh wlan add profile filename="%ScriptRoot%\wirelessprofile.xml"



From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Jason Condo
Sent: Thursday, June 05, 2014 2:47 PM
To: mssms@lists.myitforum.com
Subject: [mssms] RE: Error installing a wireless profile only through configmgr

I would think configmgr running as user would eliminate the SYSTEM issue. I ran 
from a console window psecex -s mybatch.bat and it installed. Looks like it is 
just a configmgr issue I guess. I think I will try a call or start in the batch 
to launch a separate process maybe.

Attached is the batch:

::script will install the WiFi profile for Windows 7 and 8 portable devices

::change path to where the script is running from
pushd %~dp0

::logging
echo %USERNAME% >>"%TEMP%\jdata_profile.log"

::Verify file exists
IF EXIST "jData.xml" (

               ::add the profile with settings that we want
               netsh wlan add profile filename="jData.xml" user=all 
>>"%TEMP%\jdata_profile.log"

) ELSE (

               ::log the file wasn't there and exit with error
               echo "Network profile not found for import" 
>>"%TEMP%\jdata_profile.log"
               exit /b 2
)

Jason Condo | Bennett Adelson<http://www.bennettadelson.com/> | Cleveland Region
Principal Consultant - Systems Management & Operations

From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Daniel Ratliff
Sent: Thursday, June 5, 2014 2:58 PM
To: mssms@lists.myitforum.com
Subject: [mssms] RE: Error installing a wireless profile only through configmgr

It doesn't. :) But it will help narrow down what the culprit is. If you can't 
run it as SYSTEM then the issue may not be ConfigMgr related, or not entirely 
anyway.

Do all failures, even the user based ones have the same error?

Another thing I noticed is youa re calling the .xml file directly, but since 
you are running in a batch file you may need %~dp0. Maybe try out this:

Netsh wlan add profile filename="%~dp0myprofile.xml" user=all

Daniel Ratliff

From: listsad...@lists.myitforum.com<mailto:listsad...@lists.myitforum.com> 
[mailto:listsad...@lists.myitforum.com] On Behalf Of Jason Condo
Sent: Thursday, June 05, 2014 2:41 PM
To: mssms@lists.myitforum.com<mailto:mssms@lists.myitforum.com>
Subject: [mssms] RE: Error installing a wireless profile only through configmgr

Will try that after this test machine finishes the OSD sweep. How does that 
address the fact that the interactive programs running as the user failed with 
the same error though?

Jason Condo | Bennett Adelson<http://www.bennettadelson.com/> | Cleveland Region
Principal Consultant - Systems Management & Operations

From: listsad...@lists.myitforum.com<mailto:listsad...@lists.myitforum.com> 
[mailto:listsad...@lists.myitforum.com] On Behalf Of Daniel Ratliff
Sent: Thursday, June 5, 2014 2:29 PM
To: mssms@lists.myitforum.com<mailto:mssms@lists.myitforum.com>
Subject: [mssms] RE: Error installing a wireless profile only through configmgr

Have you tried running it with psexec -s? See if you get the same error then 
you will know if its related to running as SYSTEM context.

Daniel Ratliff

From: listsad...@lists.myitforum.com<mailto:listsad...@lists.myitforum.com> 
[mailto:listsad...@lists.myitforum.com] On Behalf Of Jason Condo
Sent: Thursday, June 05, 2014 2:24 PM
To: mssms@lists.myitforum.com<mailto:mssms@lists.myitforum.com>
Subject: [mssms] Error installing a wireless profile only through configmgr

I'm really scratching my head on this one and hope maybe one of you can shed 
some light.

Scenario:
Installing a wireless profile via script for use in OSD or even after through a 
deployment.
It executes the following command in batch file: Netsh wlan add profile 
filename="myprofile.xml" user=all
If I execute this from a deployment, it fails stating the profile is corrupt 
(Profile Format Error 0×80420011 The Network Connection Profile Is Corrupted). 
However, before you say it is the profile file, if I then open a console window 
(as user or as admin) and run netsh or the batch directly from the ccmcache 
using the xml file from the ccmcache and it works.

I have tried numerous different scenarios for program options trying to get it 
to work and all of them say the profile is corrupt. Things I have tried:


*        Program install during OSD task sequence, Program runs cmd /c 
mybatch.bat >>mylog.log as administrator, whether or not logged on, no 
interaction - logs that it runs as computer account - fails

*        Program install during OSD task sequence, Program runs mybatch.bat as 
administrator, whether or not logged on, no interaction - logs that it runs as 
computer account - fails

*        Execute Command during OSD task sequence, step executes Netsh wlan add 
profile filename="myprofile.xml" user=all from package - fails

*

*        Program runs cmd /c mybatch.bat >>mylog.log as administrator, whether 
or not logged on, no interaction, available deployment to user - logs that it 
runs as computer account - fails

*        Program runs cmd /c mybatch.bat >>mylog.log as administrator, user 
logged on, with interaction, available deployment to user - logs that it runs 
as computer account - fails

*        Program runs cmd /c mybatch.bat >>mylog.log as user, only logged on, 
available deployment to user - logs that it runs as user account - fails

*

*        Program runs mybatch.bat as administrator, whether or not logged on, 
no interaction, available deployment to user - logs that it runs as computer 
account - fails

*

*        Program runs Netsh wlan add profile filename="myprofile.xml" user=all 
as administrator, whether or not logged on, no interaction, available 
deployment to user - fails

*        Program runs Netsh wlan add profile filename="myprofile.xml" user=all 
as user, only logged on, available deployment to user - fails

*

*        From Run, run cmd /c "C:\windows\ccmcache\<folder>\mybatch.bat" 
>>"%temp%\mylog.log" - non-admin user logged in - succeeds

*        From console window, run Netsh wlan add profile filename=" 
C:\windows\ccmcache\<folder>\myprofile.xml" user=all - non-admin user logged in 
- succeeds

*        From console window, run "C:\windows\ccmcache\<folder>\mybatch.bat" 
>>"%temp%\mylog.log" - non-admin user logged in - succeeds

I am really baffled as to why, even running in the user context interactively, 
that is fails when ConfigMgr 2012 kicks it off. There are other ways this can 
be done through GPO or login scripts or even ConfigMgr Compliance Settings 
(which work fine for Win8 systems), but they only want this for new deployments 
coming from OSD and now this is a challenge for me to understand.


Jason Condo | Bennett Adelson<http://www.bennettadelson.com/> | Cleveland Region
Principal Consultant - Systems Management & Operations










The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information 
in error,
please contact the sender and delete or destroy the material/information.



The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information 
in error,
please contact the sender and delete or destroy the material/information.



[CONFIDENTIALITY AND PRIVACY NOTICE] Information transmitted by this email is 
proprietary to Medtronic and is intended for use only by the individual or 
entity to which it is addressed, and may contain information that is private, 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
delete this mail from your records. To view this notice in other languages you 
can either select the following link or manually copy and paste the link into 
the address bar of a web browser: http://emaildisclaimer.medtronic.com



This message and any files transmitted with it may contain legally privileged, 
confidential, or proprietary information. If you are not the intended recipient 
of this message, you are not permitted to use, copy, or forward it, in whole or 
in part without the express consent of the sender. Please notify the sender of 
the error by reply email, disregard the foregoing messages, and delete it 
immediately.

P Please consider the environment before printing this email...




Reply via email to