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.
boolean includePolicyItems=true;
FindWLANConfigurationsResult WLANConfigurationsResult = coreWebService.findWLANConfigurations(locale, includePolicyItems);
-
Check the result for errors and handle any errors.
if (WLANConfigurationsResult.getFindWLANConfigurationsReturnStatus().getCode()!= FindWLANConfigurationsReturnStatusEnumType.SUCCESS)
{
// handle any errors
}
- Search for the WLAN configuration that you want to assign to the user account.
if (WLANConfigurationsResult.getITPolicies().size()> 0)
{
for (ITPolicy itr:WLANConfigurationsResult.getITPolicies())
{
if(itr.getPolicyName().equalsIgnoreCase(configName))
{
- Retrieve the WLAN configuration ID.
int WLANConfigId=WLANConfigurationsResult.getITPolicies().get(0).getPolicyId();
- Invoke
assignWLANConfigurationToUser() method.
AssignWLANConfigurationToUserResult result = coreWebService.assignWLANConfigurationToUser(WLANConfigId, userId);
- Check the result for errors and handle any errors.
if (result.getAssignWLANConfigurationToUserReturnStatus().getCode() != AssignWLANConfigurationToUserReturnStatusEnumType.SUCCESS) {
{
//handle any errors
}
return;
}
}
}
Was this information helpful? Send us your comments.