With the Set Nomad as Download Program step highlighted, click Add and choose New Group. This group contains steps that will validate the WiFi and VPN credentials entered by the user in the Windows Servicing Assistant. If the Task Sequence was not initiated through WSA (i.e. 1EWSA is not true), this group will be skipped. If the Task Sequence was initiated through WSA, this group will validate the credentials by disconnecting WiFi and VPN (if applicable) and attempting to reconnect using the supplied credentials. If the validation fails, the Task Sequence will fail and the user will be notified through the final WSA page that there was a problem with either the WiFi or VPN credentials. This group is included in the Task Sequence to fail before doing anything destructive on the PC if there are any problems with the supplied credentials. |
On the Properties tab | On the Options tab |
---|
- Name the group Test Connection
| - Click Add Condition > Task Sequence Variable.
Enter the following details. Variable | 1EWSA |
---|
Condition | equals | Value | True |
- Click OK.
- Click Apply.
| When the task sequence runs, connectivity to the Configuration Manager site must be maintained after any system restart into the full OS. Throughout the task sequence, the 1E WSA Actions step attempts to automatically establish WiFi connections (using WSA gathered credentials) when either of the Refresh Content Locations or Switch Between online and offline content options are selected. For locations using VPN, the Connect to VPN step uses the ConnectVPN.PS1 PowerShell script to establish a VPN connections. Provided the VPN profile name has been defined in the task sequence, VPN connection credentials have been entered during running of the Assistant and an external network exists, the script will attempt to establish the connection. Currently, WSA has been developed for use with the Microsoft VPN Client. The VPN connection process within WSA can be extended to accommodate other VPN client solutions. Future releases of WSA will also supports solutions implementing two factor authentication, where user input may be required at the time the connection is established. The steps defined within the Test Connections group are designed to exercise those connection credentials supplied by the user when they ran WSA wizard and establish their validity before proceeding any further in the task sequence. With the Test Connection group highlighted, click Add and from the menu choose General > Run Powershell Script.
On the Properties tab | On the Options tab |
---|
Enter the following details: Step parameter | Value |
---|
Name | Validate WiFi VPN Credentials | Description | Test WiFi and VPN connection credentials before allowing the task sequence to continue | Package | Browse to the WSA Scripts package | Script name | ValidateWiFiVPNCreds.ps1 | Parameters | -VPNProfile <VPNProfile> | PowerShell Execution Policy | Set the PowerShell execution policy to Bypass. |
- Click Apply.
| - Select Continue on error.
There is a known issue where a Run PowerShell Script step can erroneously return 1 to the Task Sequence, causing this step to fail even though the script completes successfully. This step is configured to continue on error, but the next step will report back any actual error to the Task Sequence if the return code from this step is neither 0 or 1. |
|
Both the ValidateWiFiVPNCreds.ps1 script and the VPN connection script ConnectVPN.PS1 , require a VPN profile name in order to establish the connection. <VPNProfile> must be the same name defined in the rasphone.pbk included in the WSA Scripts Package. If the profile name includes spaces, surround it in single quotes (e.g. '1E (UK)'). If rasphone.pbk includes multiple profiles (e.g. US and UK), the parameter can be configured to use a Collection variable (e.g. -VPNProfile '%VPNProfile%' ) - if you use this approach, ensure there is a Collection variable named VPNProfile defined for all clients that will run WSA otherwise this step in the Task Sequence will fail. |
Click Add and from the menu choose General > Run command line. This step is to work around an issue when running PowerShell script steps where a command in the script returns 1 but the script does not error and completes successfully. CM reports this as an error even though the ValidateWiFiVPNCreds.ps1 script finally exits with 0. The step will be skipped if the last action (Validate WiFi VPN Credentials) returns either 0 or 1 and the Task Sequence will continue to execute. Otherwise it will return the actual return code from the Validate WiFi VPN Credentials and the TS will fail. |
On the Properties tab | On the Options tab |
---|
Enter the following details, leaving the remaining options unchecked. Step parameter | Value |
---|
Name | Filter return codes from Validation script | Description | Allows TS to continue if the previous step returns 0 or 1, otherwise fails with the return code of the previous step | Command line | cmd /c exit %_SMSTSLastActionRetCode% |
- Click Apply.
| - Click Add Condition and choose Task Sequence Variable
Enter the following details: Variable | _SMSTSLastActionRetCode |
---|
Condition | not equals | Value | 1 |
- Click OK.
- Click Add Condition and choose Task Sequence Variable.
Enter the following details: Variable | _SMSTSLastActionRetCode |
---|
Condition | not equals | Value | 0 |
- Click OK.
|
Click Add and from the menu, choose General > Run PowerShell script.
This step establishes a VPN connection if the Task Sequence was initiated by a remote user. |
On the Properties tab | On the Options tab |
---|
Enter the following details: Step parameter | Value |
---|
Name | 1E WSA Connect VPN | Description | Connect VPN using WSA Gathered credentials | Package | Browse to the WSA Scripts package | Script name | ConnectVPN.ps1 | Parameters | -VPNProfile <VPNProfile> | PowerShell Execution Policy | Set the PowerShell execution policy to Bypass. | <VPNProfile> must match the name of the profile defined in rasphone.pbk. - Click Apply.
| - Click Add Condition and choose Task Sequence Variable.
Enter the following details: Variable | 1EWSA_RemoteUser |
---|
Condition | equals | Value | True |
- Click OK.
- Click Apply.
|
|