Skip to content

Add WiFi Payload to Profile

This function is used to add a new WiFi payload to the specified profile.

Public Function AddWifiPayloadToProfile
(profileId As Integer, networkName As String, hiddenNetwork As Boolean, autoJoin As Boolean, securityType As String,
password As String, proxyType As String, proxyServer As String, proxyPort As String, proxyAuthentication As String,
proxyPassword As String, proxyServerConfigURL As String, changelogComment As String) As Boolean
Parameter Type Description
profileId Integer The Id of the profile to add the payload to. Get it with Get Profiles.
networkName String Required. The network name (SSID).
hiddenNetwork Boolean True if the network doesn’t broadcast its SSID.
autoJoin Boolean True if the device joins the network automatically.
securityType String The security type: None, WEP, Any (Any (Personal)) or WPA (WPA/WPA2 (Personal)). Any other value is treated as None.
password String The network password. Required if securityType isn’t None.
proxyType String The proxy type: None, Manual or Automatic. Any other value is treated as None.
proxyServer String The proxy server. Required if proxyType is Manual.
proxyPort String The proxy server port. Required if proxyType is Manual.
proxyAuthentication String The user name for the proxy server. Used if proxyType is Manual. Doesn’t apply to Android devices.
proxyPassword String The password for the proxy server. Used if proxyType is Manual. Doesn’t apply to Android devices.
proxyServerConfigURL String The URL of the proxy configuration (PAC) file. Required if proxyType is Automatic. Doesn’t apply to Android devices.
changelogComment String A comment that is added to the changelog entry of the profile.

Returns a boolean value. True if succeeded, false if not. The function returns false if the profileId doesn’t belong to a profile, for example if it’s the Id of a Device Application.

Set oCMS = CreateObject("CapaInstaller.SDK")
Wscript.echo oCMS.SetInstanceManagementPoint("2")
Dim iProfileId : iProfileId = 28
Dim sNetworkName : sNetworkName = "Prod"
Dim bHiddenNetwork : bHiddenNetwork = False
Dim bAutoJoin : bAutoJoin = True
Dim sSecurityType : sSecurityType = "WPA"
Dim sPassword : sPassword = "1234"
Dim sProxyType : sProxyType = "None"
Dim sProxyServer : sProxyServer = ""
Dim sProxyPort : sProxyPort = ""
Dim sProxyAuthentication : sProxyAuthentication = ""
Dim sProxyPassword : sProxyPassword = ""
Dim sProxyServerConfigURL : sProxyServerConfigURL = ""
Dim sChangelogComment : sChangelogComment = "Added wifi with sdk"
Wscript.echo "Added Prod wifi: " & oCMS.AddWifiPayloadToProfile(iProfileId, sNetworkName, bHiddenNetwork, bAutoJoin, sSecurityType, sPassword, sProxyType, sProxyServer, sProxyPort, sProxyAuthentication, sProxyPassword, sProxyServerConfigURL, sChangelogComment)
iProfileId = 29
sNetworkName = "Public"
bHiddenNetwork = True
bAutoJoin = True
sSecurityType = "WEP"
sPassword = "4321"
sProxyType = "Automatic"
sProxyServer = ""
sProxyPort = ""
sProxyAuthentication = ""
sProxyPassword = ""
sProxyServerConfigURL = "http://192.168.0.10:8080/proxy.pac"
sChangelogComment = "Added public wifi with sdk"
Wscript.echo "Added Public wifi: " & oCMS.AddWifiPayloadToProfile(iProfileId, sNetworkName, bHiddenNetwork, bAutoJoin, sSecurityType, sPassword, sProxyType, sProxyServer, sProxyPort, sProxyAuthentication, sProxyPassword, sProxyServerConfigURL, sChangelogComment)