Assign a WLAN configuration to a user account

To assign a WLAN configuration to a user account, you can use the assignWLANConfigurationToUser() method.
Before you begin: Retrieve the following variables:
  • userID integer for the user account that you want assign the WLAN configuration to
  • configName string for the name of the WLAN configuration
  1. Invoke findWLANConfigurations() to retrieve all WLAN configurations.
    FindWLANConfigurations findRequest = new findWLANConfigurations();
    findRequest.locale = locale;
    findRequest.includePolicyItems = true;
    FindWLANConfigurationsResponse findResponse = coreWebService.findWLANConfigurations(findRequest);
    FindWLANConfigurationsResult findResult = findResponse.returnValue;
  2. Check the result for errors and handle any errors.
    if (findResult.findWLANConfigurationsReturnStatus.code != FindWLANConfigurationsReturnStatusEnumType.SUCCESS) 
    {
           // handle any errors
    }
  3. Search for the WLAN configuration that you want to assign to the user account.
    if (findResult.itPolicies.Length>0) 
    {
           for (int i=0; i<findResult.ITPolicies.size; i++) 
           {
               if(findResult.itPolicies[i].policyName.ToUpper().Equals(configName.ToUpper())
    )
               {
  4. Retrieve the WLAN configuration ID.
                 int WLANConfigId = findResult.itPolicies[i].policyId;
  5. Invoke assignWLANConfigurationToUser() method.
                 AssignWLANConfigurationToUser request = new assignWLANConfigurationToUser();
                     request.wlanBaseConfigSetId = WLANConfigId;
                     request.userId = userID;
                     AssignWLANConfigurationsToUserResponse response = coreWebService.assignWLANConfigurationToUser(request);
                     AssignWLANConfigurationsToUserResult result = response.returnValue;
  6. Check the result for errors and handle any errors.
                     if (result.assignWLANConfigurationToUserReturnStatus.code != AssignWLANConfigurationToUserReturnStatusEnumType.SUCCESS) {
                     {
                           //handle any errors
                     }    
                     return;
               }
           }
    }

Was this information helpful? Send us your comments.