Skip to content

Edit WiFi Payload

This function is used to Edit an existing WiFi payload in the specified profile. The payload is found by its network name. All settings of the payload are replaced by the values you specify.

Public Function EditWifiPayload
(profileId As Integer, currentNetworkName As String, 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 that contains the payload. Get it with Get Profiles.
currentNetworkName String The current network name (SSID) of the WiFi payload you want to edit.
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, and doesn’t change the profile, if no WiFi payload with the network name in currentNetworkName is found.

Set oCMS = CreateObject("CapaInstaller.SDK")
Wscript.echo oCMS.SetInstanceManagementPoint("2")
Dim iProfileId : iProfileId = 28
Dim sCurrentNetworkName : sCurrentNetworkName = "Prod"
Dim sNetworkName : sNetworkName = "Prod"
Dim bHiddenNetwork : bHiddenNetwork = True
Dim bAutoJoin : bAutoJoin = True
Dim sSecurityType : sSecurityType = "WPA"
Dim sPassword : sPassword = "123456789"
Dim sProxyType : sProxyType = "None"
Dim sProxyServer : sProxyServer = ""
Dim sProxyPort : sProxyPort = ""
Dim sProxyAuthentication : sProxyAuthentication = ""
Dim sProxyPassword : sProxyPassword = ""
Dim sProxyServerConfigURL : sProxyServerConfigURL = ""
Dim sChangelogComment : sChangelogComment = "Changed wifi password with sdk"
Wscript.echo "Changed Prod wifi: " & oCMS.EditWifiPayload(iProfileId, sCurrentNetworkName, sNetworkName, bHiddenNetwork, bAutoJoin, sSecurityType, sPassword, sProxyType, sProxyServer, sProxyPort, sProxyAuthentication, sProxyPassword, sProxyServerConfigURL, sChangelogComment)