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
-
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;
-
Check the result for errors and handle any errors.
if (findResult.findWLANConfigurationsReturnStatus.code != FindWLANConfigurationsReturnStatusEnumType.SUCCESS)
{
// handle any errors
}
- 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())
)
{
- Retrieve the WLAN configuration ID.
int WLANConfigId = findResult.itPolicies[i].policyId;
- Invoke
assignWLANConfigurationToUser() method.
AssignWLANConfigurationToUser request = new assignWLANConfigurationToUser();
request.wlanBaseConfigSetId = WLANConfigId;
request.userId = userID;
AssignWLANConfigurationsToUserResponse response = coreWebService.assignWLANConfigurationToUser(request);
AssignWLANConfigurationsToUserResult result = response.returnValue;
- 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.